Advertisement

Enabling/Disabling Blending for diff textures

Started by July 21, 2003 10:19 PM
5 comments, last by Scraniel 21 years, 7 months ago
I am creating a 3d room where the walls are a certain texture and show up perfectly when GL_BLEND is disabled, however, when I create my fire out of particles based on Lesson 19, it requires enabling GL_BLEND to display a realistic fire. But since it turns blending on for the fire, my wall textures become transparent and blend too? is there a way to just blend certain textures and not others so all my world textures aren''t transparent but my fire looks real and blended. Any advice would be appreciated. Thanks. ~Dan~
Disable belending before you draw the walls. Enable it after the walls are drawn and before you draw the fire.
Advertisement
Thanks. I tried that, but instead of the texture become transparent, they look normal, but the front face of the bookcases in the room become transparent while the back and sides of the case remain normal. This causes quite a weird image and the front of the bookcase displays whatever is behind it instead of the books. I don''t get it at all. Your suggestions makes sense and should, but how come it doesn''t do it for all textures....

~Dan~
Ok, how do i post a picture of the screenshot i am talking about...
You need to render the objects in the following order:

1.Any non-transparent objects first(preferably front to back for early z rejection)
2.Transparent objects in back to front order.

There are many ways of ordering the polygons in back to front order, google for it if you need info.

James
hmm, that doesn''t seem to work though, i tried rendering my fire first and it still makes certain textures transparent. In fact, it looks normal, not completely transparent, until you see the opposite side of the bookcase appear in the texture. How do I upload a screenshot on this forum?
Advertisement
To do screenshots you need to post it on a website and remotely link to it using html - all html is valid in you post so just use the img tag to show your image.

This topic is closed to new replies.

Advertisement