|
AllegroGL and translucent textures |
samwyse
Member #7,610
August 2006
|
I can't get the alpha-channel to work on textures. I've gone so far as to dump the bitmap that I'm using and, yes, the information is there. I'm suspecting that there's a flag somewhere that I'm forgetting to set, but as this is the first time I've tried doing this, I'm not sure what it would be. Anyway, here's the code I'm using to create the texture (with embedded logging):
And here's what I get when I run it:
I've got a half-meg screen dump if you really want to see it, but trust me when I say that you can't see the river bottom through the water. But that does bring up a second small issue. I've noticed that save_bitmap is inverting my screenshots. I presume that this is due to Allegro putting (0,0) in the upper left and OpenGL putting it in the lower left. Is there any way to fix this, or should I resign myself to manually flipping things? |
Jakub Wasilewski
Member #3,653
June 2003
|
Just to be sure - you do call glBlendFunc and glEnable(GL_BLEND) prior to drawing anything with those textures, right? You can also try using GL_RGBA instead of the -1 with make_texture_ex to force a pixel format that contains alpha. --------------------------- |
ImLeftFooted
Member #3,935
October 2003
|
Heres my init code
For loading textures i just do this: texture = allegro_gl_make_texture(src); Alpha channel works perfect for me. How are you drawing the texture to the screen? |
samwyse
Member #7,610
August 2006
|
Jakub Wasilewski said: Just to be sure - you do call glBlendFunc and glEnable(GL_BLEND) prior to drawing anything with those textures, right? D'oh! Note to self: In the future, I must make sure that I haven't commented out any code before posting questions to the forum. Dustin Dettmer said: Heres my init code Wow!!! That's some heavy duty code. Thanks for sharing, I think I'll spend the rest of the week-end studying it. |
Jakub Wasilewski
Member #3,653
June 2003
|
Quote: Note to self: In the future, I must make sure that I haven't commented out any code before posting questions to the forum. Nothing to be ashamed of, I just mentioned it because I once made the same error (GL_BLEND disabled) and then wondered for an hour what's wrong. --------------------------- |
ImLeftFooted
Member #3,935
October 2003
|
If anything doesnt make sense you can ask me about it. Heres how i draw.
|
|