GL_BLEND problems

Started by
4 comments, last by jmoses 21 years, 2 months ago
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?
- John Moses
Advertisement
Draw all blended geometry last.. and sort only those objects/polygons
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.
- To learn, we share... Give some to take some -
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?
- John Moses
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
Man, this problem had been bothering me for weeks. And you guys solved it in a day.

You Guys Kick Ass.
- John Moses

This topic is closed to new replies.

Advertisement