PDA

View Full Version : Texture blending



Nisar Ahmed
04-14-2012, 08:22 AM
Hello,

I am new to OpenGL and I need to blend 2 textures returned from 2 different sources. I am using FBO to render textures in a loop but only the last texture rendered is visible.

Are there any specific guidelines for creating and rendering textures with blending?

Please advice
Nisar

BionicBytes
04-14-2012, 09:43 AM
What are you doing currently with blend?
Have you enabled the state? What blend functions are you using?
Do your textures have alpha, are they supposed to be semi-transparent?

Nisar Ahmed
04-14-2012, 01:13 PM
I have set GL_MDULATE while creating FBO texture

glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);

and before rendering to FBO

glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);