Advertisement

transparency

Started by December 17, 2000 03:03 PM
0 comments, last by Noodles 23 years, 11 months ago
What is the simplest way of color keying in OpenGL so that part of the textures are transparent? thanks.
Easiest way that I know is to loop through the pixels in the texture and if the red,green,blue values are equal to the to color you don''t want to show, set the alpha channel to 0, otherwise set it to 255. Then you must turn on blending.

Thats the theory anyways, in practice it largely depends on how you organized your data. If its organized RGBRGBRGB with no room for a alpha channel you will have to create a new memory buffer thats (Width*Height*4) bytes in size. Then you can do it.

Hope this helps,

Jason A.

---
I write code.
DelphiGL (http://delphigl.cfxweb.net)
---I write code.DelphiGL (http://delphigl.cfxweb.net)

This topic is closed to new replies.

Advertisement