Alpha test BEFORE fragment procesing

Hi; In my app, the alpha channel in difuse textures is used as a mask (like fences, leaves…). When i use

glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER,0.5f);

with GLSL shaders, it didnt work, all pixels r drawned…but when i use it with nv_reg_combiners or ati_fragment_shader, it works…whats happening?

Alpha testing happens after fragment processing. You should make sure that the alpha you’re outputting is correct.

When I use Alpha Test + GLSL + Pbuffers on my 9600 it needs a lot of time to compute. But if I use a depth buffer with depth test, there is no such performance drop. Why does this happen?
Alpha test should be the most simplest test (no writing to a depth buffer, … )

I think you should perform alpha test manually…

Originally posted by olmeca:
When I use Alpha Test + GLSL + Pbuffers on my 9600 it needs a lot of time to compute. But if I use a depth buffer with depth test, there is no such performance drop. Why does this happen?
Alpha test should be the most simplest test (no writing to a depth buffer, … )

How much is “lot of time” in this context?

Originally posted by Coluna:
[b]Hi; In my app, the alpha channel in difuse textures is used as a mask (like fences, leaves…). When i use

glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER,0.5f);

with GLSL shaders, it didnt work, all pixels r drawned…but when i use it with nv_reg_combiners or ati_fragment_shader, it works…whats happening?[/b]
Consider using alpha-to-coverage instead of alpha testing.
http://www.humus.ca/index.php?page=3D&ID=61

excellent as always humus (grrr now ive gotta go and play with this, as if i dont have anuf to do already)

Consider using alpha-to-coverage instead of alpha testing.
And what is the cost of this technique?

In the demo it’s about 10-15% slower than alpha testing.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.