How do I discard a vertex in a vertex shader? I read there is a ‘discard’ command in the fragment shader, but not the vertex shader.
I am drawing lines and am running a log() function on the points via a vertex shader. I need to throw away the point if the value is <= 0 since the log is not a number.
You can also make the primitive degenerate, i.e. make two vertices the same coordinate post transformation, but that would require at least two vertices to be rejected or additional attributes per vertex an significant work to reject.
Thanks for the replies. I suspected skipping a vertex wouldn’t be easy. So I can’t use a fragment shader because for lines, I seem to lose all the regular antialiasing, and thus it looks really bad.
Setting a default position sounds like my best option. I’m wondering though, how many decimal places out should I be able to go out in GLSL? (I’m not sure how to calculate what my minimum should be.)
Also, I am unclear on how to make the primitive degenerate. Is this something that can be done in a shader?