Re: clipping planes bypassed in CG vertex shaders
"Stephen J Baker" <[email protected]>
| Newsgroups | gmane.games.devel.opengl |
|---|---|
| Organization | Fat City Network Services, San Diego, California |
| Message-ID | <[email protected]> |
Well, I guess it pays to RTFM.
According to the nVidia vertex_program extension:
"What part of OpenGL do vertex programs specifically bypass?
Vertex programs bypass the following OpenGL functionality:
o Normal transformation and normalization
o Color material
o Per-vertex lighting
o Texture coordinate generation
o The texture matrix
o The normalization of AUTO_NORMAL evaluated normals
o The modelview and projection matrix transforms
o The per-vertex processing in EXT_point_parameters
o The per-vertex processing in NV_fog_distance
o Raster position transformation
===> o Client-defined clip planes"
...and it's right there on the last line.
A further question clarifies the reasoning:
"Should client-defined clip planes operate when vertex program mode is
enabled?
RESOLUTION. No.
OpenGL's client-defined clip planes are specified in eye-space.
Vertex programs generate homogeneous clip space positions.
Unlike the conventional OpenGL vertex transformation mode, vertex
program mode requires no semantic equivalent to eye-space.
Applications that require client-defined clip planes can simulate
OpenGL-style client-defined clip planes by generating texture
coordinates and using alpha testing or other per-fragment tests
such as NV_texture_shader's CULL_FRAGMENT_NV program to discard
fragments. In many ways, these schemes provide a more flexible
mechanism for clipping than client-defined clip planes.
Unfortunately, vertex programs used in conjunction with selection
or feedback will not have a means to support client-defined clip
planes because the per-fragment culling mechanisms described in the
previous paragraph are not available in the selection or feedback
render modes. Oh well.
Finally, as a practical concern, client-defined clip planes
greatly complicate clipping for various hardware rasterization
architectures."
...so the recommendation is to use the texture hack that older nVidia
hardware uses (urgh!).
I'm horrified.
-----------------------------------------------------------------------
The second law of Frisbee throwing states: "Never precede any maneuver
by a comment more predictive than "Watch this!"...it turns out that
this also applies to writing Fragment Shaders.
-----------------------------------------------------------------------
Steve Baker (817)619-2657 (Vox/Vox-Mail)
L3Com/Link Simulation & Training (817)619-2466 (Fax)
Work: [email protected] http://www.link.com
Home: [email protected] http://www.sjbaker.org
-----
FAQ and OpenGL Resources at:
http://www.geocities.com/SiliconValley/Hills/9956/OpenGL
--
Author: Stephen J Baker
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).