Blending offscreen rendered textures

Hi,

I have three pbuffers that I render different scenes into. Then I bind them to three different textures and (try to) use multitexturing to blend them together in the frame buffer on top of a quad.

The problem I have is that they’re not blended even though I use GL_MODULATE as texenv for each texture.

Instead the last texture just replace the previous layer and I end up with just the last layer visible.

Anyone know what I might be doing wrong?

Thanks,
Peter

glActiveTexture(GL_TEXTURE0);
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
glBindTexture(GL_TEXTURE_2D,tex0);

glActiveTexture(GL_TEXTURE1);
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
glBindTexture(GL_TEXTURE_2D,tex1);

glActiveTexture(GL_TEXTURE2);
glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE,GL_MODULATE);
glBindTexture(GL_TEXTURE_2D,tex2);

Bye
ScottManDeath

[This message has been edited by ScottManDeath (edited 12-16-2002).]

Ok, that’s what I’m doing.

So I guess I must have implemented a bug somewhere else…

Thanks for verifying that I’m doing that part right, back to bug hunting again…

Cheers,
Peter

[This message has been edited by PeterP (edited 12-17-2002).]