View Full Version : Alpha test BEFORE fragment procesing
Coluna
02-14-2005, 07:30 AM
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?
Korval
02-14-2005, 10:12 AM
Alpha testing happens after fragment processing. You should make sure that the alpha you're outputting is correct.
olmeca
06-20-2005, 11:47 AM
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, ... )
Zengar
06-23-2005, 06:54 AM
I think you should perform alpha test manually...
Humus
06-23-2005, 03:13 PM
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?
Humus
06-23-2005, 03:15 PM
Originally posted by Coluna:
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?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)
Korval
06-23-2005, 04:39 PM
Consider using alpha-to-coverage instead of alpha testing.And what is the cost of this technique?
Humus
06-24-2005, 03:51 AM
In the demo it's about 10-15% slower than alpha testing.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.