- D3DRS_ZENABLE
- Depth-buffering state as one member of the CONST_D3DZBUFFERTYPE enumeration. Set this state to D3DZB_TRUE to enable z-buffering, D3DZB_USEW to enable w-buffering, or D3DZB_FALSE to disable depth buffering.
The default value for this render state is D3DZB_TRUE if a depth stencil was created along with the swap chain by setting the EnableAutoDepthStencil member of the D3DPRESENT_PARAMETERS structure to TRUE, and D3DZB_FALSE otherwise.
- D3DRS_FILLMODE
- One or more members of the CONST_D3DFILLMODE enumeration. The default value is D3DFILL_SOLID.
- D3DRS_SHADEMODE
- One or more members of the CONST_D3DSHADEMODE enumeration. The default value is D3DSHADE_GOURAUD.
- D3DRS_LINEPATTERN
- D3DLINEPATTERN type. The default values are 0 for wRepeatPattern, and 0 for wLinePattern.
- D3DRS_ZWRITEENABLE
- TRUE to enable the application to write to the depth buffer. The default value is TRUE. This member enables an application to prevent the system from updating the depth buffer with new depth values. If FALSE, depth comparisons are still made according to the render state D3DRS_ZFUNC, assuming that depth buffering is taking place, but depth values are not written to the buffer.
- D3DRS_ALPHATESTENABLE
- TRUE to enable alpha tests. The default value is FALSE. This member enables applications to turn off the tests that accept or reject a pixel, based on its alpha value.
The incoming alpha value is compared with the reference alpha value, using the comparison function provided by the D3DRS_ALPHAFUNC render state. When this mode is enabled, alpha blending occurs only if the test succeeds.
- D3DRS_LASTPIXEL
- FALSE to enable drawing the last pixel in a line or triangle. The default value is TRUE.
- D3DRS_SRCBLEND
- One member of the CONST_D3DBLEND enumeration. The default value is D3DBLEND_ONE.
- D3DRS_DESTBLEND
- One member of the CONST_D3DBLEND enumeration. The default value is D3DBLEND_ZERO.
- D3DRS_CULLMODE
- Specifies how back-facing triangles are culled, if at all. This can be set to one member of the CONST_D3DCULL enumerated type. The default value is D3DCULL_CCW.
- D3DRS_ZFUNC
- One member of the CONST_D3DCMPFUNC enumeration. The default value is D3DCMP_LESSEQUAL. This member enables an application to accept or reject a pixel, based on its distance from the .
The depth value of the pixel is compared with the depth-buffer value. If the depth value of the pixel passes the comparison function, the pixel is written.
The depth value is written to the depth buffer only if the render state is TRUE.
Software rasterizers and many hardware accelerators work faster if the depth test fails, because there is no need to filter and modulate the texture if the pixel is not going to be rendered.
- D3DRS_ALPHAREF
- Value specifying a reference alpha value against which pixels are tested when alpha-testing is enabled. This can be a 16:16 fixed point value (D3DFIXED) ranging from 0 to 1, inclusive, where 1.0 is represented as &H00010000. The default value is 0.0.
- D3DRS_ALPHAFUNC
- One member of the CONST_D3DCMPFUNC enumeration. The default value is D3DCMP_ALWAYS. This member enables an application to accept or reject a pixel, based on its alpha value.
- D3DRS_DITHERENABLE
- TRUE to enable dithering. The default value is FALSE.
- D3DRS_ALPHABLENDENABLE
- TRUE to enable alpha-blended transparency. The default value is FALSE.
The type of alpha blending is determined by the D3DRS_SRCBLEND and D3DRS_DESTBLEND render states.
Applications should check the D3DDEVCAPS_DRAWPRIMTLVERTEX flag in the DevCaps member of the D3DCAPS8 type to find out whether this render state is supported.
- D3DRS_FOGENABLE
- TRUE to enable fog blending. The default value is FALSE.
- D3DRS_SPECULARENABLE
- TRUE to enable specular highlights. The default value is FALSE.
Specular highlights are calculated as though every vertex in the object being lit were at the object's origin. This gives the expected results as long as the object is modeled around the origin and the distance from the light to the object is relatively large.
When this member is set to TRUE, the specular color is added to the base color after the texture cascade but before alpha blending.
- D3DRS_ZVISIBLE
- Not supported.
- D3DRS_FOGCOLOR
- Value of type Long indicating RGB color. The default value is 0.
- D3DRS_FOGTABLEMODE
- The fog formula to be used for pixel fog. Set to one of the members of the CONST_D3DFOGMODE enumeration. The default value is D3DFOG_NONE.
- D3DRS_FOGSTART
- Depth at which pixel or vertex fog effects begin for linear fog mode. Depth is specified in world space for vertex fog, and either device space [0.0, 1.0] or world space for pixel fog. For pixel fog, these values are in device space when the system uses z for fog calculations, and world-space when the system is using eye-relative fog (w-fog).
- D3DRS_FOGEND
- Depth at which pixel or vertex fog effects end for linear fog mode. Depth is specified in world space for vertex fog, and either device space [0.0, 1.0] or world space for pixel fog. For pixel fog, these values are in device space when the system uses z for fog calculations, and world-space when the system is using eye-relative fog (w-fog).
- D3DRS_FOGDENSITY
- Fog density for pixel or vertex fog used in the exponential fog modes (D3DFOG_EXP and D3DFOG_EXP2). Valid density values range from 0.0 through 1.0. The default value is 1.0.
- D3DRS_EDGEANTIALIAS
- TRUE to antialias lines forming the convex outline of objects. The default value is FALSE. If TRUE, applications should render only lines, and only to the exterior edges of polygons in a scene. The behavior is undefined if triangles or points are drawn when this render state is set. Antialiasing is performed by averaging the values of neighboring pixels. Although this is not the best way to perform antialiasing, it can be very efficient; hardware that supports this kind of operation is becoming more common.
You can enable edge antialiasing only on devices that expose the D3DPRASTERCAPS_ANTIALIASEDGES capability.
- D3DRS_ZBIAS
- An integer value in the range 0 to 16 that causes polygons that are physically coplanar to appear separate. Polygons with a high z-bias value will appear in front of polygons with a low value, without requiring sorting for drawing order. Polygons with a value of 1 appear in front of polygons with a value of 0, and so on. The default value is zero.
- D3DRS_RANGEFOGENABLE
- TRUE to enable range-based vertex fog. The default value is FALSE, in which case the system uses depth-based fog. In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object (that is, the z-coordinate) in the scene. In range-based fog, all fog methods work as usual, except that they use range instead of depth in the computations.
Range is the correct factor to use for fog computations, but depth is commonly used instead because range is expensive to compute and depth is generally already available. Using depth to calculate fog has the undesirable effect of having the fogginess of peripheral objects change as the viewer's eye moves—in this case, the depth changes, and the range remains constant.
Because no hardware currently supports per-pixel range-based fog, range correction is offered only for vertex fog.
- D3DRS_STENCILENABLE
- TRUE to enable stenciling, or FALSE to disable stenciling. The default value is FALSE.
- D3DRS_STENCILFAIL
- Stencil operation to perform if the stencil test fails. This can be one member of the CONST_D3DSTENCILOP enumeration. The default value is D3DSTENCILOP_KEEP.
- D3DRS_STENCILZFAIL
- Stencil operation to perform if the stencil test passes and the depth test (z-test) fails. This can be one of the members of the CONST_D3DSTENCILOP enumeration. The default value is D3DSTENCILOP_KEEP.
- D3DRS_STENCILPASS
- Stencil operation to perform if both the stencil and the depth (z) tests pass. This can be one member of the CONST_D3DSTENCILOP enumeration. The default value is D3DSTENCILOP_KEEP.
- D3DRS_STENCILFUNC
- Comparison function for the stencil test. This can be one member of the CONST_D3DCMPFUNC enumeration. The default value is D3DCMP_ALWAYS.
The comparison function is used to compare the reference value to a stencil buffer entry. This comparison applies only to the bits in the reference value and stencil buffer entry that are set in the stencil mask (set by the D3DRS_STENCILMASK render state). If TRUE, the stencil test passes.
- D3DRS_STENCILREF
- Integer reference value for the stencil test. The default value is 0.
- D3DRS_STENCILMASK
- Mask applied to the reference value and each stencil buffer entry to determine the significant bits for the stencil test. The default mask is &HFFFFFFFF.
- D3DRS_STENCILWRITEMASK
- Mask applied to the reference value and each stencil buffer entry to determine the significant bits for the stencil test. The default mask is &HFFFFFFFF.
- D3DRS_TEXTUREFACTOR
- Color used for multiple-texture blending with the D3DTA_TFACTOR texture-blending argument or the D3DTOP_BLENDFACTORALPHA texture-blending operation.
- D3DRS_WRAP0 through D3DRS_WRAP7
- Texture-wrapping behavior for multiple sets of texture coordinates. Valid values for these render states can be any combination of the D3DWRAPCOORD_0 (or D3DWRAP_U), D3DWRAPCOORD_1 (or D3DWRAP_V), D3DWRAPCOORD_2 (or D3DWRAP_W), and D3DWRAPCOORD_3 flags defined by the CONST_D3DWRAPFLAGS enumeration. These cause the system to wrap in the direction of the first, second, third, and fourth dimensions, sometimes referred to at the s, t, r, and q directions, for a given texture. The default value for these render states is 0 (wrapping disabled in all directions).
- D3DRS_CLIPPING
- TRUE to enable primitive clipping by Microsoft® Direct3D®, or FALSE to disable it. The default value is TRUE.
- D3DRS_LIGHTING
- TRUE to enable Direct3D lighting, or FALSE to disable it. The default value is TRUE. Only vertices that include a vertex normal are properly lit; vertices that do not contain a normal employ a dot product of 0 in all lighting calculations.
- D3DRS_AMBIENT
- Ambient light color. The default value is 0.
- D3DRS_FOGVERTEXMODE
- Fog formula to be used for vertex fog. Set to one member of the CONST_D3DFOGMODE enumeration. The default value is D3DFOG_NONE. This render state is analogous to the legacy D3DLIGHTSTATE_FOGVERTEXMODE lighting state.
- D3DRS_COLORVERTEX
- TRUE to enable per-vertex color, or FALSE to disable it. The default value is TRUE. Enabling per-vertex color allows the system to include the color defined for individual vertices in its lighting calculations.
For more information, see the following render states.
- D3DRS_LOCALVIEWER
- TRUE to enable camera-relative specular highlights, or FALSE to use orthogonal specular highlights. The default value is TRUE. Applications that use orthogonal projection should specify FALSE.
- D3DRS_NORMALIZENORMALS
- TRUE to enable automatic normalization of vertex normals, or FALSE to disable it. The default value is FALSE. Enabling this feature causes the system to normalize the vertex normals for vertices after transforming them to camera space, which can be computationally expensive.
- D3DRS_DIFFUSEMATERIALSOURCE
- Diffuse color source for lighting calculations. Valid values are members of the CONST_D3DMATERIALCOLORSOURCE enumeration. The default value is D3DMCS_COLOR1. The value for this render state is used only if the D3DRS_COLORVERTEX render state is set to TRUE.
- D3DRS_SPECULARMATERIALSOURCE
- Specular color source for lighting calculations. Valid values are members of the CONST_D3DMATERIALCOLORSOURCE enumeration. The default value is D3DMCS_COLOR2.
- D3DRS_AMBIENTMATERIALSOURCE
- Ambient color source for lighting calculations. Valid values are members of the CONST_D3DMATERIALCOLORSOURCE enumeration. The default value is D3DMCS_COLOR2.
- D3DRS_EMISSIVEMATERIALSOURCE
- Emissive color source for lighting calculations. Valid values are members of the CONST_D3DMATERIALCOLORSOURCE enumeration. The default value is D3DMCS_MATERIAL.
- D3DRS_VERTEXBLEND
- Number of matrices to use to perform geometry blending, if any. Valid values are members of the CONST_D3DVERTEXBLENDFLAGS enumeration. The default value is D3DVBF_DISABLE.
- D3DRS_CLIPPLANEENABLE
- Enables or disables user-defined clipping planes. Valid values are combinations of values from the CONST_D3DCLIPPLANEFLAGS enumeration. If you include a value from the enumeration, the corresponding clipping plane is enabled; if a value is not included, the clipping plane is disabled. The default value is D3DCPF_DISABLEALL.
- D3DRS_SOFTWAREVERTEXPROCESSING
- Value that enables applications to query and select hardware or software vertex processing. For a D3DDEVTYPE_SW device type this value is fixed to TRUE. This value can be set by the application for a D3DDEVTYPE_REF device type. For a D3DDEVTYPE_HAL device type, this value can be set only by the application when D3DDEVCAPS_HWTRANSFORMANDLIGHT is set; otherwise this flag is fixed to TRUE. When variable, the default value is FALSE.
Changing the vertex processing render state in mixed vertex processing mode will reset the current stream, indices, and vertex shader to their default values of ByVal 0 or 0
- D3DRS_POINTSIZE
- Value that specifies the size to use for point size computation in cases where point size is not specified for each vertex. This value is not used when the vertex contains point size. This value is in screen space units if D3DRS_POINTSCALEENABLE is FALSE; otherwise this value is in world space units. The default value is 1.0. The range for this value is greater than or equal to 0.0.
- D3DRS_POINTSIZE_MIN
- Value that specifies the minimum size of point primitives. Point primitives are clamped to this size during rendering. Setting this to values smaller than 1.0 results in points dropping out when the point does not cover a pixel center and antialiasing is disabled or being rendered with reduced intensity when antialiasing is enabled. The default value is 1.0. The range for this value is greater than or equal to 0.0.
- D3DRS_POINTSPRITEENABLE
- When TRUE, texture coordinates of point primitives are set so that full textures are mapped on each point. When FALSE, the vertex texture coordinates are used for the entire point. The default value is FALSE. You can achieve DirectX 7 style single-pixel points by setting D3DRS_POINTSCALEENABLE to FALSE and D3DRS_POINTSIZE to 1.0, which are the default values.
- D3DRS_POINTSCALEENABLE
- Value that controls computation of size for point primitives. When TRUE, the point size is interpreted as a camera space value and is scaled by the distance function and the frustum to viewport Y axis scaling to compute the final screen space point size. When FALSE, the point size is interpreted as screen space and used directly. The default value is FALSE.
- D3DRS_POINTSCALE_A
- Value that controls for distance-based size attenuation for point primitives. Active only when D3DRS_POINTSCALEENABLE is TRUE. The default value is 1.0. The range for this value is greater than or equal to 0.0.
- D3DRS_POINTSCALE_B
- Value that controls for distance-based size attenuation for point primitives. Active only when D3DRS_POINTSCALEENABLE is TRUE. The default value is 0.0. The range for this value is greater than or equal to 0.0.
- D3DRS_POINTSCALE_C
- Value that controls for distance-based size attenuation for point primitives. Active only when D3DRS_POINTSCALEENABLE is TRUE. The default value is 0.0. The range for this value is greater than or equal to 0.0.
- D3DRS_MULTISAMPLEANTIALIAS
- Value that determines how individual samples are computed when using a multisample render target buffer. When set to TRUE, the multiple samples are computed so that full-scene antialiasing is performed by sampling at different sample positions for each multiple sample. When set to FALSE, the multiple samples are all written with the same sample value (sampled at the pixel center), which enables non-antialiased rendering to a multisample buffer. This render state has no effect when rendering to a single sample buffer. The default value is TRUE.
- D3DRS_MULTISAMPLEMASK
- Each bit in this mask, starting at the LSB, controls modification of one of the samples in a multisample render target. Thus, for an 8 sample render target, the low byte contains the 8 write enables for each of the 8 samples. This render state has no effect when rendering to a single sample buffer. The default value is &HFFFFFFFF.
This render state enables use of a multisample buffer as an accumulation buffer, doing multipass rendering of geometry where each pass updates a subset of samples.
- D3DRS_PATCHEDGESTYLE
- Sets whether patch edges will use float-style tessellation. Possible values are defined by the CONST_D3DPATCHEDGESTYLE enumerated type.
- D3DRS_PATCHSEGMENTS
- Number of segments per edge when drawing high-order primitives.
- D3DRS_DEBUGMONITORTOKEN
- Set only for debugging the monitor.
- D3DRS_POINTSIZE_MAX
- Value that specifies the maximum size to which point sprites will be clamped. The value must be less than or equal to the MaxPointSize member of D3DCAPS8 and greater than or equal to D3DRS_POINTSIZE_MIN.
- D3DRS_INDEXVERTEXBLENDENABLE
- When TRUE, enables indexed vertex blending. When FALSE, disables indexed vertex blending. If this render state is enabled, the user must pass matrix indices as a packed LONG with every vertex. When the render state is disabled and vertex blending is enabled through the D3DRS_VERTEXBLEND state, it is equivalent to having matrix indices 0, 1, 2, 3 in every vertex.
- D3DRS_COLORWRITEENABLE
- Value that enables a per-channel write for the render target color buffer. A set bit results in the color channel being updated during 3-D rendering. A clear bit results in the color channel being unaffected. This functionality is available if the D3DPMISCCAPS_COLORWRITEENABLE capabilities bit is set in the PrimitiveMiscCaps member of the D3DCAPS8 type for the device. This render state does not affect the clear operation. The default value is &H0000000F.
Valid values for this render state can be any combination of values defined by the CONST_D3DCOLORWRITEENABLEFLAGS enumeration.
- D3DRS_TWEENFACTOR
- Value that controls the tween factor.
- D3DRS_BLENDOP
- Value used to select the arithmetic operation applied when the alpha blending render state, D3DRS_ALPHABLENDENABLE, is set to TRUE. Valid values are defined by the CONST_D3DBLENDOP enumerated type. The default value is D3DBLENDOP_ADD.
If the D3DPMISCCAPS_BLENDOP device capability is not supported, then D3DBLENDOP_ADD is performed.