All right I have potentially a bit of a problem here. I need to apply
textures to some models. What's my problem you ask? Well..
I have to provide transparency for the textures.
Fortunately I don't believe any blending is needed for this part just
texture tranparency in the right places. The caveat is some of the
texture values are set transparent that aren't black.
What am I doing? Well the playstation does the following operations on a texture.
if (bit15) is set on the color
if the color value 0x8000 (IE the transparency bit set and the rest 0) the color is solid black (no transparency).
else the color is blended with what's on the screen ( 1 of 4 modes)
else
if the color value is 0 then it's transparent and invisible
else it's an opaque color
The models I'm rendering were made for the playstation so I have to
convert the textures into something that can be used in openGL.
I was thinking of using
I don't want to use DECAL mode because it will mess up textures in general.
Is another option since the alpha is either on or off and I am not sure
if the textures are blended into the model. (not likely).
Cyb - suggestions welcome..
textures to some models. What's my problem you ask? Well..
I have to provide transparency for the textures.
Fortunately I don't believe any blending is needed for this part just
texture tranparency in the right places. The caveat is some of the
texture values are set transparent that aren't black.
What am I doing? Well the playstation does the following operations on a texture.
if (bit15) is set on the color
if the color value 0x8000 (IE the transparency bit set and the rest 0) the color is solid black (no transparency).
else the color is blended with what's on the screen ( 1 of 4 modes)
else
if the color value is 0 then it's transparent and invisible
else it's an opaque color
The models I'm rendering were made for the playstation so I have to
convert the textures into something that can be used in openGL.
I was thinking of using
Code:
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
Code:
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0);
if the textures are blended into the model. (not likely).
Cyb - suggestions welcome..