6 The rasterizer state controls the rendering of points, lines and triangles.
7 Attributes include polygon culling state, line width, line stipple,
8 multisample state, scissoring and flat/smooth shading.
16 If set, the provoking vertex of each polygon is used to determine the color
17 of the entire polygon. If not set, fragment colors will be interpolated
18 between the vertex colors.
20 The actual interpolated shading algorithm is obviously
21 implementation-dependent, but will usually be Gourard for most hardware.
25 This is separate from the fragment shader input attributes
26 CONSTANT, LINEAR and PERSPECTIVE. The flatshade state is needed at
27 clipping time to determine how to set the color of new vertices.
29 :ref:`Draw` can implement flat shading by copying the provoking vertex
30 color to all the other vertices in the primitive.
35 Whether the first vertex should be the provoking vertex, for most primitives.
36 If not set, the last vertex is the provoking vertex.
38 There are several important exceptions to the specification of this rule.
40 * ``PIPE_PRIMITIVE_POLYGON``: The provoking vertex is always the first
41 vertex. If the caller wishes to change the provoking vertex, they merely
42 need to rotate the vertices themselves.
43 * ``PIPE_PRIMITIVE_QUAD``, ``PIPE_PRIMITIVE_QUAD_STRIP``: This option has no
44 effect; the provoking vertex is always the last vertex.
45 * ``PIPE_PRIMITIVE_TRIANGLE_FAN``: When set, the provoking vertex is the
46 second vertex, not the first. This permits each segment of the fan to have
55 If set, there are per-vertex back-facing colors. The hardware
56 (perhaps assisted by :ref:`Draw`) should be set up to use this state
57 along with the front/back information to set the final vertex colors
58 prior to rasterization.
60 The frontface vertex shader color output is marked with TGSI semantic
61 COLOR[0], and backface COLOR[1].
64 Indicates whether the window order of front-facing polygons is
65 counter-clockwise (TRUE) or clockwise (FALSE).
68 Indicates which faces of polygons to cull, either PIPE_FACE_NONE
69 (cull no polygons), PIPE_FACE_FRONT (cull front-facing polygons),
70 PIPE_FACE_BACK (cull back-facing polygons), or
71 PIPE_FACE_FRONT_AND_BACK (cull all polygons).
74 Indicates how to fill front-facing polygons, either
75 PIPE_POLYGON_MODE_FILL, PIPE_POLYGON_MODE_LINE or
76 PIPE_POLYGON_MODE_POINT.
78 Indicates how to fill back-facing polygons, either
79 PIPE_POLYGON_MODE_FILL, PIPE_POLYGON_MODE_LINE or
80 PIPE_POLYGON_MODE_POINT.
83 Whether polygon stippling is enabled.
85 Controls OpenGL-style polygon smoothing/antialiasing
88 If set, point-filled polygons will have polygon offset factors applied
90 If set, line-filled polygons will have polygon offset factors applied
92 If set, filled polygons will have polygon offset factors applied
95 Specifies the polygon offset bias
97 Specifies the polygon offset scale
107 Whether lines should be smoothed. Line smoothing is simply anti-aliasing.
109 Whether line stippling is enabled.
111 16-bit bitfield of on/off flags, used to pattern the line stipple.
113 When drawing a stippled line, each bit in the stipple pattern is
114 repeated N times, where N = line_stipple_factor + 1.
116 Controls whether the last pixel in a line is drawn or not. OpenGL
117 omits the last pixel to avoid double-drawing pixels at the ends of lines
118 when drawing connected lines.
127 Specifies if a texture unit has its texture coordinates replaced or not. This
128 is a packed bitfield containing the enable for all texcoords -- if all bits
129 are zero, point sprites are effectively disabled.
131 If any bit is set, then point_smooth MUST be disabled (there are no
132 round sprites) and point_quad_rasterization MUST be true (sprites are
133 always rasterized as quads). Any mismatch between these states should
134 be considered a bug in the state-tracker.
136 If enabled, the four vertices of the resulting quad will be assigned
137 texture coordinates, according to sprite_coord_mode.
142 Specifies how the value for each shader output should be computed when drawing
143 point sprites. For PIPE_SPRITE_COORD_LOWER_LEFT, the lower-left vertex will
144 have coordinates (0,0,0,1). For PIPE_SPRITE_COORD_UPPER_LEFT, the upper-left
145 vertex will have coordinates (0,0,0,1).
146 This state is used by :ref:`Draw` to generate texcoords.
148 point_quad_rasterization
149 ^^^^^^^^^^^^^^^^^^^^^^^^
151 Determines if points should be rasterized according to quad or point
154 OpenGL actually has quite different rasterization rules for points and
155 point sprites - hence this indicates if points should be rasterized as
156 points or according to point sprite (which decomposes them into quads,
159 Additionally Direct3D will always use quad rasterization rules for
160 points, regardless of whether point sprites are enabled or not.
162 If this state is enabled, point smoothing and antialiasing are
163 disabled. If it is disabled, point sprite coordinates are not
168 Some renderers always internally translate points into quads; this state
169 still affects those renderers by overriding other rasterization state.
172 Whether points should be smoothed. Point smoothing turns rectangular
173 points into circles or ovals.
174 point_size_per_vertex
175 Whether the vertex shader is expected to have a point size output.
176 Undefined behaviour is permitted if there is disagreement between
177 this flag and the actual bound shader.
179 The size of points, if not specified per-vertex.
187 Whether the scissor test is enabled.
190 Whether :term:`MSAA` is enabled.
192 gl_rasterization_rules
193 Whether the rasterizer should use (0.5, 0.5) pixel centers. When not set,
194 the rasterizer will use (0, 0) for pixel centers.