JavaScript EditorFree JavaScript Editor     Ajax Editor 



Main Page
Previous Page
Next Page

9.8. User Clipping

To take advantage of OpenGL's user clipping (which remains as fixed functionality between vertex processing and fragment processing in programmable OpenGL), a vertex shader must transform the incoming vertex position into the same coordinate space as that in which the user clip planes are stored. The usual case is that the user clip planes are stored in eye space coordinates, so the OpenGL shader code shown in Listing 9.23 can provide the transformed vertex position.

Listing 9.23. User-clipping computation

gl_ClipVertex = gl_ModelViewMatrix * gl_Vertex;


Previous Page
Next Page



essay maker
JavaScript EditorAjax Editor     JavaScript Editor