Hello!
I am doing a OpenGL project. In this i need to display one Image on the another Image Transparently. In my machine multitexturing is not supported. So iam using texture mapping; when i place one image on the another the bottom image is not visible.
How is it possible to display the overlapped images? Please give info.?
bye.,
[This message has been edited by ramana (edited 10-11-2003).]
Blending is applied to the framebuffer and not per-fragment.So if you want proper blending,you’ll have to sort your objects according to their z-position.
If you only have a few transparent objects,then just draw your solid objects first and your transparent objects last.
Panzer: an image probably doesn’t have triangle sort issues.
Leyder: he said multitexture wasn’t supported on his hardware.
ramana: I suggest you read a good reference about multi-passing and blending, such as the red book. In brief, you want to glEnable( GL_BLEND ); before drawing the second image, and you want to set your glBlendFunc() appropriately, such as glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) if the second image has an alpha (coverage) channel, or glBlendFunc( GL_ONE, GL_ONE ) if you want to add them together. Don’t forget to disable the blend when you’re done!
Hmm, I just noticed this is the “advanced” board. Neither the question nor the replies seemed to indicate such was the case, though Curious.