Graphics Reference
In-Depth Information
You can enable and disable primitive restart as follows:
glEnable ( GL_PRIMITIVE_RESTART_FIXED_INDEX );
// Draw primitives
glDisable ( GL_PRIMITIVE_RESTART_FIXED_INDEX );
Provoking Vertex
Without qualifiers, output values of the vertex shader are linearly
interpolated across the primitive. However, with the use of flat shading
(described in the Interpolation Qualifiers section in Chapter 5), no
interpolation occurs. Because no interpolation occurs, only one of the
vertex values can be used in the fragment shader. For a given primitive
instance, the provoking vertex determines which of the vertices output
from the vertex shader are used, as only one can be used. Table 7-1 shows
the rule for the provoking vertex selection.
Table 7-1
Provoking Vertex Selection for the i ith Primitive Instance Where
Vertices Are Numbered from 1 to n , and n Is the Number of Vertices
Drawn
Type of Primitive i
Provoking Vertex
GL_POINTS
i
GL_LINES
2 i
GL_LINE_LOOP
i + 1, if i < n
1, if i = n
GL_LINE_STRIP
i + 1
GL_TRIANGLES
3 i
GL_TRIANGLE_STRIP
i + 2
GL_TRIANGLE_FAN
i + 2
Geometry Instancing
Geometry instancing allows for efficiently rendering an object multiple
times with different attributes (such as a different transformation matrix,
color, or size) using a single API call. This feature is useful in rendering
large quantities of similar objects, such as in crowd rendering. Geometry
instancing reduces the overhead of CPU processing to send many API calls
 
 
 
 
Search WWH ::




Custom Search