Compartilhar via


Rasterization Rules

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

Microsoft® Direct3D® Mobile uses the following rules for turning a primitive and its transformed coordinates into a set of pixels to be processed.

  • Direct3D Mobile considers the center of the pixel to lie at the integer coordinates. If the center of the pixel is in the primitive, then it is shaded, otherwise, it is not. Transformed coordinates use four sub-pixel addressing, and the interpolation and digital differential analyzer (DDA) algorithms to generate edges do the same.
  • Point primitives are always the single pixel nearest to the coordinate. Direct3D Mobile does not support point diameters.
  • Line primitives are always the single pixel line drawn between the two endpoints with four bit sub-pixel precision. Direct3D Mobile does not support line width. The line rasterization behavior may be modified by the D3DMRS_LASTPIXEL render state (see D3DMRENDERSTATETYPE). If this render state is set to TRUE, then the last pixel in the line is drawn. If the render state is equal to FALSE, the last pixel of the line is not drawn.
  • The D3DMRS_LASTPIXEL render state only applies to the D3DMPT_LINESTRIP and D3DMPT_LINELIST primitive types. When rasterizing D3DMPM_LINELIST primitives, each line in the list is drawn in the style specified by the current render state setting for D3DMRS_LASTPIXEL, which is TRUE by default. In the case of the D3DMPT_LINESTRIP, the rasterization rule is dependent on which line in the strip is being drawn. All lines in the strip from [0..(N-1)] are always drawn with D3DMRS_LASTPIXEL set to FALSE. This is a fixed characteristic of the Direct3D Mobile middleware that the application cannot change. Only the Nth line of the strip is drawn based on the current setting for D3DMRS_LASTPIXEL.
  • Triangle primitives are rasterized according to top-left rules. This specifies that the top and left edges of the triangle are in, but the bottom and right edges are not. This rule is applied only when the triangle edge goes directly through the center of the pixel. This allows multiple triangles to be placed side by side, as in a strip or fan, and not have gaps in between the triangles or pixels rasterized twice.
  • In the top-left filling convention, top refers to the vertical location of horizontal spans, and left refers to the horizontal location of pixels within a span. An edge cannot be a top edge unless it is horizontal.
  • Direct3D Mobile allows the application to modify the default rasterization mode for a given primitive via the fill mode. The fill mode is accessed through the D3DMRS_FILLMODE render state and accepts values from the D3DMFILLMODE enumeration. Its default value is D3DMFILL_SOLID.

See Also

Concepts

Rasterization