Re: clipping planes bypassed in CG vertex shaders

Rhadamés Carmona <[email protected]>
Newsgroups gmane.games.devel.opengl
Organization Fat City Network Services, San Diego, California
Message-ID <[email protected]>
Guys, thanks for all comments.

Well, clipping must be applied per primitive (i.e. triangle)... so, it could 
be done before shading... Primitives can be removed, or clipped (it could 
add new verteces). So, in vertex shader, we can receive unclipped or new 
verteces, and we can play with them as we need (modify: move, translate, 
whatever). I think, it is good.

After vertex shader, clipping even works, but it could not be good enough, 
because we do not want to waste gpu time shading verteces of objects which 
are going to be removed by clipping.

Well, anyway, the point is that user clipping planes are disable in 
programmable pipeline (at least in my fx5200 and fx6800). I think, it is a 
little damn for some programmers.

Regards
Rhadamés

Rhadamés Carmona wrote:

> I agree. It must not be implemented in vertex shader. But, it can be
> implemented after or before vertex shader.

No - it can't be implemented before the vertex shader because the vertex
shader can move the vertex around. Since any pre-shader clipper would have
no idea where the vertex would ultimately end up - there is no way it could
possibly clip it correctly.

I have vertex shaders that totally ignore the incoming vertex coordinate
and instead read the coordinate out of texture memory. There is no possible
way that a pre-shader clipper could figure that out.

It has to go AFTER the vertex shader. However, it could be implemented
either before or after the fragment shader. The frag shader can't move
the positions of vertices - so clipping either before or after that stage
would be OK. (Although you'd hope it would be before frag shader because
it's more efficient there).

> I found in internet that user clipping planes are disable for programmable
> pipeline. Only frustum clipping planes work after vertex shader...

Where did you see that?
--
Author: Stephen J Baker
INET: sjbaker@...

----- 
FAQ and OpenGL Resources at:
  http://www.geocities.com/SiliconValley/Hills/9956/OpenGL

-- 
Author: =?iso-8859-1?Q?Rhadam=E9s_Carmona?=
  INET: [email protected]

Fat City Hosting, San Diego, California -- http://www.fatcity.com
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [email protected] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB OPENGL-GAMEDEV-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.