• Advertisement

Archived

This topic is now archived and is closed to further replies.

GL_BLEND problems

This topic is 5494 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Sorry if this has already been answered, but The search button doesn''t work on the website. I made a little level editor and now i''m adding Shader/special effects support to it. The problem is whenever I have a object with the texture with the property GL_BLEND to it, it doesnt draw the faces behind it. I was told to turn GL_DEPTH_TEST off to fix this, but then I have everything all messed up as you know. So the only way I can see of fixing this is writing a sort routine to everything that is to be drawn to the screen. This would slow down my engine and all.... Well what do you guys think?

Share this post


Link to post
Share on other sites
Advertisement
try this:
1. render all non-blended objects
2. disable depth writing using glDepthMask()
3. render all ur blended polygons, preferably sorted back to front

disabling depth test is bad since it disables the z-buffer. using depthmask may help coz any previous depth info is maintained, discarding new info.. which is wat u usually want when rendering blended objects.

Share this post


Link to post
Share on other sites
Well if I draw the not blended objects first, then the blended objects last with the depth_test off, it just draws the blended objects on top of my unblended ones. so I guess I have to draw my whole level with the depth_test off, and draw my blended and not blended objects from furthest to closest? Any other ideas? and if this is what I have to do, does anyone have any fast algorithims to do so?

Share this post


Link to post
Share on other sites
read what CraZeE saiz he doesnt say disable depth tests just disable depthwrites

http://uk.geocities.com/sloppyturds/kea/kea.html
http://uk.geocities.com/sloppyturds/gotterdammerung.html

Share this post


Link to post
Share on other sites
Man, this problem had been bothering me for weeks. And you guys solved it in a day.

You Guys Kick Ass.

Share this post


Link to post
Share on other sites

  • Advertisement