vertex program and cull face fake?

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.

Thanks.

force the output vertex color to have zero alpha, and enable the alpha test, maybe?

There was possibility to “kill” a vertex from the program but i think it’s disabled in the newer versions.

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?

– Tom

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.

You can “not render” your vertex by pushing it off screen.

Of course, things may look screwy if some of the vertices of a primitive are still onscreen.

I was told that we may get programming control of the triangle assembly stage as well, among other things. But don’t hold your breath.

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.