Is there a quick way to not render some faces (or vertices) with vertex program even if there are included in the drawelement subroutine?
For exemple:
Only vertices with normal front of light must be rendered.
What will be the trick code in vertex program for that?
I would like it working in the Vprogram opcode.
Originally posted by Mihail121: There was possibility to “kill” a vertex from the program but i think it’s disabled in the newer versions.
I never heard of this. Killing a single vertex doesn’t make any sense whatsoever – what would you say should happen to the triangles that use this vertex?
No, killing a vertex was never possible. The only thing possible, was to “kill” a fragment in a fragment program.
But Cg had a bug with that some time ago, so it didn´t work there.
The ARB vertex program specification explicity tells that culling is not treated by vertex programs. At best you could generate an output vertex position which forces the front-face / back-face to be in the direction pointed by face culling. But even in that case you would need to have control over the neighbour triangles which might be quite hard to setup. Well, maybe if the output vertex has an infinite coordinate pointing towards the camera … ?
V-Man : a triangle program would be great for interacting with how coordinates are interpolated over the triangle. For instance, texture coordinate set #0 could use perspective correction while texture coordinate set #1 would not correct perspective.