Outline and Fill States

Primitives that have no textures are rendered with the color specified by their material, or with the colors specified for the vertices, if any. The method used to fill them can be selected with the D3DFILLMODE enumerated type. See D3DRENDERSTATE_FILLMODE.

Direct3D uses the standard Windows ROP2 binary raster operations when it fills a primitive. The default value is R2_COPYPEN, which sets the pixel to the current pen color. For details, see GetROP2 and SetROP2 in the Platform SDK documentation. Although most applications will not need to change the default value, your application can change the raster fill operation by using the D3DRENDERSTATE_ROP2 enumerated value.

If you want your applications to enable dithering, it must pass the D3DRENDERSTATE_DITHERENABLE enumerated value as the first parameter to IDirect3DDevice3::SetRenderState. It must set the second parameter to TRUE to enable dithering, and FALSE to disable it.

A stippled fill pattern can be used if stippling is enabled. See D3DRENDERSTATE_STIPPLEENABLE. A 32x32 stipple pattern is specified using the enumerated values D3DRENDERSTATE_STIPPLEPATTERN00 through D3DRENDERSTATE_STIPPLEPATTERN31. Each of these enumerated values corresponds to one line of the stipple pattern. For example, to set the first line of the stipple pattern, pass D3DRENDERSTATE_STIPPLEPATTERN00 as the first parameter to IDirect3DDevice3::SetRenderState. Pass the hexadecimal value of the stipple pattern as the second parameter.

At times, drawing the last pixel in a line can cause unsightly overlap with surrounding primitives. This can be controlled using the D3DRENDERSTATE_LASTPIXEL enumerated value. However, this setting should not be altered without some forethought. Under some conditions, suppressing the rendering of the last pixel can cause unsightly gaps between primitives.

By default, Direct3D devices use a solid outline for primitives. The outline pattern can be changed using the D3DLINEPATTERN structure. See D3DRENDERSTATE_LINEPATTERN.