PDA

View Full Version : How can i implement a translucent texture?



hu_yuxiao
03-08-2004, 03:00 PM
I am writing an image morphing program. I want to blend two images as textures of a grid with alpha channel. But i wonder how to implement this in openGL. Who can help please?

Nychold
03-09-2004, 10:29 AM
If you want to blend two images, use the blending functions of OpenGL:

glEnable(GL_BLEND);
glBlendFunc(...);
glBlendEquationEXT(...); requires loading an extension
glBlendFuncSeparateEXT(...); see above
glDisable(GL_BLEND);

if you need to do something more intricate than that, your best bet might be to use pixel shaders or something similar.