Sign in to follow this  
klepto2

no depth when using GL_ALPHA_TEST

Recommended Posts

klepto2    122
hi, i've started to integrate shadowmapping in my 3d engine. The engine uses almost fixed function with the ability to use shader. After setting up my depth FBO everything seems to be fine. The depth values are correct. at least for normal objects. If i try to render Alpha masked shadows then they don't whole mesh doesn't write anything in the depthbuffer. the depthbuffer FBO is set up like the one from ATIs SDK. If the textures are masked I use: glEnable(GL_ALPHA_TEST) and on initiation I define the glalphafunc to be GL_LEQUAL,0.5 well, the textures are diplayed correctly but the mesh is not displayed in the depthbuffer. If i disable GL_ALPHA_TEST the whole match is shown in depth, but eg trees or grass needs masked textures. Any ideas?

Share this post


Link to post
Share on other sites
V-man    813
If you use alpha testing, then fragments that don't pass the test aren't rendered.
Fragments that pass, they get rendered so you get something in depth buffer.

Share this post


Link to post
Share on other sites
klepto2    122
hi, thx for your answer. Thats exactly what i thought, too. But instead I get this:

no depth as you see


As you see the tree is not written to the depthbuffer. And I have no idea why. Depthtesting and zwriting is enabled. Maybe a driver bug. I will test it on other gfx cards today. btw. I'm using ATI.

[Edit]

Just tested in on nvidia and it works. I will send a report to ATI.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this