PDA

View Full Version : Non Power Of 2 Texture



powerpad
06-02-2005, 01:50 AM
I use the pbuffer as a non power of 2 texture with the texture_rectangle extension of nvidia.

Is there any other way to do pbuffer with non power of 2 sizes but to not use the nvidia extension?

Is there any other method to get the depth buffer contents into a texture (other than glReadPixels)?

Does glCopyTexImage2D support copying from the depth buffer?

Chuck0
06-02-2005, 02:47 AM
Originally posted by powerpad:

Is there any other method to get the depth buffer contents into a texture (other than glReadPixels)?

Does glCopyTexImage2D support copying from the depth buffer?yes you answered your question yourself. you can use glCopyTexSubImage2D to copy the contents of the depth buffer into a texture. on nv hardware i think you can even bind the depth buffer of a pbuffer directly as depth texture.

powerpad
06-02-2005, 03:14 AM
I bound the pbuffer to the depth buffer.

I was not able to find information in the msdn that says how the component could be copied by glCopyTex*Image*().

Is this a never possibility (via extensions)?

T101
06-02-2005, 03:53 AM
Then again, OpenGL is not part of Microsofts strategy, so don't expect it to answer all your questions.

In addition to searching the web (or posting on this forum) the OpenGL 2.0 spec may be useful. It's not easy to read though. But at least it's available on the site.

Jan
06-02-2005, 03:59 AM
To copy the content of the depth-buffer into a texture, the texture needs to be of the type DEPTH_COMPONENT (there is an extension ARB_depth_texture or so, which defines this). If the texture is of this type, then glCopyTexSubImage will automatically copy from the depth-buffer instead of the color-buffer.

Hope that helps,
Jan.

powerpad
06-02-2005, 06:12 AM
tnx for the help and I will read the spec for this extension

PickleWorld
06-02-2005, 06:52 AM
"Is there any other way to do pbuffer with non power of 2 sizes but to not use the nvidia extension?"

Sure, use the ARB extension GL_TEXTURE_RECTANGLE_ARB.

Also, to follow up on what was said above, you want to use something like...

glCopyTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_DEPTH_COMPONENT32_ARB , offsetX, offsetY, width, height, 0);

To copy from the depth buffer to a texture.

powerpad
06-02-2005, 09:29 AM
yes I found the depth buffer read and glCopyTex** in the relevant extension.

So there is a non NVidia extension that deals with this texture rectangle...
I read the paper by Chris Wynn and he covers (of course) only the NVidia site.

But how do I set up my pbuffer to support this non power of two texture since I define

WGL_TEXTURE_TARGET_ARB, WGL_TEXTURE_RECTANGLE_NV

but what is the non NVidia way for doing it ..

Thanks for all your help.

Humus
06-04-2005, 11:13 AM
Just create a pBuffer without the WGL_ARB_render_texture stuff. You don't need it anyway if you're going to do a glCopyTexImage2D().

V-man
06-04-2005, 01:48 PM
There is no vendor neutral way to do this.
ATI has WGL_ATI_render_texture_rectangle. I have never used it, but maybe it's like NV's extension.

stanlylee
06-05-2005, 05:41 AM
I have not used the Pbuffer + RendertoTexture. I prefer FBO . but util last month, nvidia's dirver not surpport NPOT in FBO.