PDA

View Full Version : Problem with render-to-texture



Jens Scheddin
08-26-2005, 04:19 AM
Hi,

I have successfully rendered into two rectangle float pbuffers (they do have different content). Now I want to bind these two buffers to two different texture units (with two different texture objects) and render them in a fragment program to the window's frame buffer.

Problem:
It seems, that I can only sample from the last pbuffer I've bound using wglBindTexImage().

Here's the code I use for settung up the pbuffers (no texture enabling because of the fragment program):

glActiveTextureARB(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 1);
wglBindTexImage(pBuffer1, WGL_FRONT_LEFT);

glActiveTextureARB(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_RECTANGLE_ARB, 2);
wglBindTexImage(pBuffer2, WGL_FRONT_LEFT);The following fragment program code ALWAYS samples from the last pbuffer I've bound:

TEX tex0, fragment.texcoord[0], texture[0], RECT;
TEX tex1, fragment.texcoord[1], texture[1], RECT;Has anyone any clue on this?

Thanks in advance,
Jay

API
08-26-2005, 10:18 AM
You try use wglShareLists(...)?

API

Jens Scheddin
08-26-2005, 03:25 PM
Originally posted by API:
You try use wglShareLists(...)?

APIAll my pbuffers already share the context with the main window. The problem must be somewhere else...