Depending on some properties, I want to set a fragment to invisible.
To do that, I set the alpha value to 0. But it doesn’t work. Why? Do I have to set special properties?
SUBC tmp.x, val1, val2
MOV frag_color.a, 0.0;
MOV result.color, frag_color;[/i]
You must enable alpha test in program
No… it doesn’t work.
I have glEnable(GL_DEPTH_TEST) and glEnable(GL_ALPHA_TEST),but things are still not tranpsarent.
But it works with glEnable(GL_BLEND) and glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA).
But I don’t want to use blending…
Why not just kill the fragment? With ARB_fragment_program there is the KIL instruction…
Because the alpha test is one of the first operation to be done and I didn’t find any precise information about KIL.
I need the fastest way of “disable/kill” a fragment. And set the alpha value to zero seem to be the fastest. But if somebody has any information about it…
For alpha-test to work, you also need to set the correct alpha-function.
glAlphaFunc (GL_GREATER, 0.1f);
This means only fragments with an alpha-value greater than 0.1f will pass the test.
If you don’t specify the alpha-function, it might be some default function like GL_ALWAYS and hence will not work.
Jan is right, you must set the correct alpha function.
Dont use the KILL instruction to alpha test(if you have opportunity). I get about 20% speed up with classic alpha test instead KILL instruction.
256bit NV35 revision A1 with 128 MB DDR.
Thank you, I hope they fixed this up with NV4x. Maybe I’ll try a simple test in the next few days.
This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.