Hi, I need to find a way to reject certain triangles in the vertex shader.
For example if I find a vertex match a criteria I wish to reject it (and also the other 2 forming that triangle).
Now I send the vertex far away from the camera like this
if (in.Position.y < 0.0f ) in. Position,xyz = 1000.0f ;
The problem is, that not all the verices of a triangle could have Position.y < 0.0 and if not all of the vertices arent moved away from the camera of course very long, streched and annoying triangles appear [pig]
How can I reject a triangle in the vertex shader, if I find one of the verices match certain criteria ?
As a side question, can I get a calculate a value in a shader program and send it back to the application ?
I tried something like this :
float fmyGlobalShaderFloat ;
vertex shader (...)
{
fmyGlobalShaderFloat = something ;
}
and in the application
float f ;
effect->GetFloat("fmyGlobalShaderFloat" , &f ) ;
but that doesn't work obviously.