darn glBlend

Started by
3 comments, last by Julio 23 years, 10 months ago
ok, my program uses OpenGL. At the beginning of my program I call glEnable(GL_BLEND) because this seems to be the only was to draw the different objects in my world with keeping the colors correct. well, the colors are correct, but the objects are transparent. do I need to disable GL_BLEND before I draw a polygon and then re-enable it again? is there some function I''m missing? I''ve reviewed tutorials and books and found nothing. Thanks, Joe JoeMont001@aol.com
My HomepageSome shoot to kill, others shoot to mame. I say clear the chamber and let the lord decide. - Reno 911
Advertisement
quote:Original post by Julio

At the beginning of my program I call glEnable(GL_BLEND) because this seems to be the only was to draw the different objects in my world with keeping the colors correct.


The way to draw your colors correctly is DISABLING blend. Use blending when you want transparency. What happens with your colors when you disable blending?


Nicodemus.

----
"When everything goes well, something will go wrong." - Murphy
Nicodemus.----"When everything goes well, something will go wrong." - Murphy
ya. well, when I disable it, (when I don''t call it at the beggining) it draws the textures fine, then it draws the colored polygons black.
Thanks,
Joe

JoeMont001@aol.com
My HomepageSome shoot to kill, others shoot to mame. I say clear the chamber and let the lord decide. - Reno 911
Before you draw your colored polygons, disable GL_TEXTURE_2D. They get black because OpenGL tries to apply a texture to them (That I think you set glBindTexture to texture 0).

Nicodemus.

----
"When everything goes well, something will go wrong." - Murphy
Nicodemus.----"When everything goes well, something will go wrong." - Murphy
Yep, it worked. I would have never of guessed. Thanks a lot!
Joe

JoeMont001@aol.com
My HomepageSome shoot to kill, others shoot to mame. I say clear the chamber and let the lord decide. - Reno 911

This topic is closed to new replies.

Advertisement