PDA

View Full Version : Off-screen textures



04-09-2003, 02:05 AM
I have three render contexts: One the main screen RC, and the other two are off screen textures (p-buffers).
I'm trying to render a scene to the first texture, then render a textured full screen quad to the second texture using the first texture, then finally render to the main RC using the second texture. I can't get it to work, but have no problem when rendering to only one off-screen texture/render context and using that as a texture for rendering back to the main RC.

Here's an outline of what I'm doing in my render function -
make tex1 current RC
glClear(color|depth) and render scene
make tex2 current RC
glBindTexture(tex1)
wglBindTexImageARB(tex1's pbuffer handle)
glClear(color|depth) and draw tex 1 textured quad
wglReleaseTexImageARB(tex1's pbuf handle)
make main window current RC
glClear(color|depth) and render scene
glBindTexture(tex2)
wglBindTexImageARB(tex2's pbuf handle)
draw tex2 textured quad
wglReleaseTexImageARB(tex2's pbuf handle)

The final textured quad on the main screen is just white and untextured (GL_TEXTURE_2D is enabled). Can anyone suggest what might be wrong, please?
Do I need to do anything with wglShareLists?

Mazy
04-09-2003, 03:16 AM
yes, you need to share lists between the pbuffers and the 'screen' context.

also make sure that your pbuffers have the ^2 pixels size