PDA

View Full Version : vertex program and cull face fake?



Antorian
06-26-2003, 02:51 AM
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.

knackered
06-26-2003, 02:57 AM
force the output vertex color to have zero alpha, and enable the alpha test, maybe?

Mihail121
06-26-2003, 04:18 AM
There was possibility to "kill" a vertex from the program but i think it's disabled in the newer versions.

Tom Nuydens
06-26-2003, 05:31 AM
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

Jan
06-26-2003, 05:33 AM
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.

V-man
06-26-2003, 06:50 AM
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.

vincoof
06-26-2003, 10:07 AM
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.