D3DRENDERSTATETYPE

The D3DRENDERSTATETYPE enumerated type describes the render state for the D3DOP_STATERENDER opcode. This enumerated type is part of the D3DSTATE structure. The values mentioned in the following descriptions are set in the second member of this structure.

Values 40 through 49 were introduced with DirectX 5.0.

typedef enum _D3DRENDERSTATETYPE { 
    D3DRENDERSTATE_TEXTUREHANDLE      = 1,    // texture handle 
    D3DRENDERSTATE_ANTIALIAS          = 2,    // antialiasing mode 
    D3DRENDERSTATE_TEXTUREADDRESS     = 3,    // texture address 
    D3DRENDERSTATE_TEXTUREPERSPECTIVE = 4,    // perspective correction 
    D3DRENDERSTATE_WRAPU              = 5,    // wrap in u direction 
    D3DRENDERSTATE_WRAPV              = 6,    // wrap in v direction 
    D3DRENDERSTATE_ZENABLE            = 7,    // enable z test 
    D3DRENDERSTATE_FILLMODE           = 8,    // fill mode 
    D3DRENDERSTATE_SHADEMODE          = 9,    // shade mode 
    D3DRENDERSTATE_LINEPATTERN        = 10,   // line pattern 
    D3DRENDERSTATE_MONOENABLE         = 11,   // enable mono rendering 
    D3DRENDERSTATE_ROP2               = 12,   // raster operation 
    D3DRENDERSTATE_PLANEMASK          = 13,   // physical plane mask 
    D3DRENDERSTATE_ZWRITEENABLE       = 14,   // enable z writes 
    D3DRENDERSTATE_ALPHATESTENABLE    = 15,   // enable alpha tests 
    D3DRENDERSTATE_LASTPIXEL          = 16,   // draw last pixel in a line 
    D3DRENDERSTATE_TEXTUREMAG         = 17,   // how textures are magnified 
    D3DRENDERSTATE_TEXTUREMIN         = 18,   // how textures are reduced 
    D3DRENDERSTATE_SRCBLEND           = 19,   // blend factor for source 
    D3DRENDERSTATE_DESTBLEND          = 20,   // blend factor for destination 
    D3DRENDERSTATE_TEXTUREMAPBLEND    = 21,   // blend mode for map 
    D3DRENDERSTATE_CULLMODE           = 22,   // back-face culling mode 
    D3DRENDERSTATE_ZFUNC              = 23,   // z-comparison function 
    D3DRENDERSTATE_ALPHAREF           = 24,   // reference alpha value 
    D3DRENDERSTATE_ALPHAFUNC          = 25,   // alpha-comparison function 
    D3DRENDERSTATE_DITHERENABLE       = 26,   // enable dithering 
    D3DRENDERSTATE_ALPHABLENDENABLE   = 27,   // enable alpha blending 
    D3DRENDERSTATE_FOGENABLE          = 28,   // enable fog 
    D3DRENDERSTATE_SPECULARENABLE     = 29,   // enable specular highlights 
    D3DRENDERSTATE_ZVISIBLE           = 30,   // enable z-checking 
    D3DRENDERSTATE_SUBPIXEL           = 31,   // enable subpixel correction 
    D3DRENDERSTATE_SUBPIXELX          = 32,   // enable x subpixel correction 
    D3DRENDERSTATE_STIPPLEDALPHA      = 33,   // enable stippled alpha 
    D3DRENDERSTATE_FOGCOLOR           = 34,   // fog color 
    D3DRENDERSTATE_FOGTABLEMODE       = 35,   // fog mode 
    D3DRENDERSTATE_FOGTABLESTART      = 36,   // fog table start 
    D3DRENDERSTATE_FOGTABLEEND        = 37,   // fog table end 
    D3DRENDERSTATE_FOGTABLEDENSITY    = 38,   // fog density 
    D3DRENDERSTATE_STIPPLEENABLE      = 39,   // enables stippling 
    D3DRENDERSTATE_EDGEANTIALIAS      = 40,   // antialias edges 
    D3DRENDERSTATE_COLORKEYENABLE     = 41,   // enable color-key transparency 
    D3DRENDERSTATE_BORDERCOLOR        = 43,   // border color 
    D3DRENDERSTATE_TEXTUREADDRESSU    = 44,   // u texture address mode 
    D3DRENDERSTATE_TEXTUREADDRESSV    = 45,   // v texture address mode 
    D3DRENDERSTATE_MIPMAPLODBIAS      = 46,   // mipmap LOD bias 
    D3DRENDERSTATE_ZBIAS              = 47,   // z-bias 
    D3DRENDERSTATE_RANGEFOGENABLE     = 48,   // enables range-based fog 
    D3DRENDERSTATE_ANISOTROPY         = 49,   // max. anisotropy 
    D3DRENDERSTATE_FLUSHBATCH         = 50,   // explicit flush for DP batching (DX5 Only) 
    D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT=51, // enable sort-independent transparency 
    D3DRENDERSTATE_STENCILENABLE      = 52,   // enable or disable stenciling 
    D3DRENDERSTATE_STENCILFAIL        = 53,   // stencil operation 
    D3DRENDERSTATE_STENCILZFAIL       = 54,   // stencil operation 
    D3DRENDERSTATE_STENCILPASS        = 55,   // stencil operation 
    D3DRENDERSTATE_STENCILFUNC        = 56,   // stencil comparison function 
    D3DRENDERSTATE_STENCILREF         = 57,   // reference value for stencil test 
    D3DRENDERSTATE_STENCILMASK        = 58,   // mask value used in stencil test 
    D3DRENDERSTATE_STENCILWRITEMASK   = 59,   // stencil buffer write mask 
    D3DRENDERSTATE_TEXTUREFACTOR      = 60,   // texture factor 
    D3DRENDERSTATE_STIPPLEPATTERN00   = 64,   // first line of stipple pattern 
       // Stipple patterns 01 through 30 omitted here. 
    D3DRENDERSTATE_STIPPLEPATTERN31   = 95,   // last line of stipple pattern 
    D3DRENDERSTATE_WRAP0              = 128,  // wrapping flags for first texture 
       // Wrap renderstates 1 through 6 omitted here.
    D3DRENDERSTATE_WRAP7              = 135,  // wrapping flags for last texture 
    D3DRENDERSTATE_FORCE_DWORD        = 0x7fffffff, 
} D3DRENDERSTATETYPE; 
 

Members

D3DRENDERSTATE_TEXTUREHANDLE
Texture handle for use when rendering with the IDirect3DDevice2 or earlier interfaces. The default value is NULL, which disables texture mapping and reverts to flat or Gouraud shading.

If the specified texture is in a system memory surface and the driver can only support texturing from display memory surfaces, the call will fail.

In retail builds the texture handle is not validated.

D3DRENDERSTATE_ANTIALIAS
One of the members of the D3DANTIALIASMODE enumerated type specifying the desired type of full-scene antialiasing. The default value is D3DANTIALIAS_NONE. For more information, see Full-scene Antialiasing and Antialiasing States.

You can only enable full-scene antialiasing on devices that expose the D3DPRASTERCAPS_ANTIALIASSORTINDEPENDENT or D3DPRASTERCAPS_ANTIALIASSORTDEPENDENT capabilities.

D3DRENDERSTATE_TEXTUREADDRESS
This render state is superseded by the D3DTSS_ADDRESS texture stage state value set through the IDirect3DDevice3::SetTextureStageState method, but can still be used to set the addressing mode of the first texture stage. Valid values are members of the D3DTEXTUREADDRESS enumerated type. The default value is D3DTADDRESS_WRAP. For more information, see Texture Addressing Modes.

Applications that need to specify separate texture-addressing modes for the u and v coordinates of a texture can use the D3DRENDERSTATE_TEXTUREADDRESSU and D3DRENDERSTATE_TEXTUREADDRESSV render states.

D3DRENDERSTATE_TEXTUREPERSPECTIVE
TRUE to enable for perspective correct texture mapping. (See perspective correction.) For the IDirect3DDevice3 interface, the default value is TRUE. For earlier interfaces, the default is FALSE. For more information, see Texture Perspective State.
D3DRENDERSTATE_WRAPU and
D3DRENDERSTATE_WRAPV
These render states are superseded by the D3DRENDERSTATE_WRAP0 through D3DRENDERSTATE_WRAP7 render states, but can be used to set wrapping for the first texture stage. Set to TRUE for wrapping in u direction. The default value is FALSE. For more information, see Texture Wrapping.
D3DRENDERSTATE_ZENABLE
The depth buffering state, as one of the members of the D3DZBUFFERTYPE enumerated type. 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 buffer is attached to the render-target surface, and D3DZB_FALSE otherwise.

D3DRENDERSTATE_FILLMODE
One or more members of the D3DFILLMODE enumerated type. The default value is D3DFILL_SOLID.
D3DRENDERSTATE_SHADEMODE
One or more members of the D3DSHADEMODE enumerated type. The default value is D3DSHADE_GOURAUD.
D3DRENDERSTATE_LINEPATTERN
The D3DLINEPATTERN structure. The default values are 0 for wRepeatPattern and 0 for wLinePattern.
D3DRENDERSTATE_MONOENABLE
TRUE to enable monochromatic rendering, using a gray scale based on the blue channel of the color rather than full RGB. The default value is FALSE. If the device does not support RGB rendering, the value will be TRUE. Applications can check whether the device supports RGB rendering by using the dcmColorModel member of the D3DDEVICEDESC structure.

In monochromatic rendering, only the intensity (gray scale) component of the color and specular components are interpolated across the triangle. This means that only one channel (gray) is interpolated across the triangle instead of 3 channels (R,G,B), which is a performance gain for some hardware. This gray-scale component is derived from the blue channel of the color and specular components of the triangle.

D3DRENDERSTATE_ROP2
One of the 16 standard Windows ROP2 binary raster operations specifying how the supplied pixels are combined with the pixels of the display surface. The default value is R2_COPYPEN. Applications can use the D3DPRASTERCAPS_ROP2 flag in the dwRasterCaps member of the D3DPRIMCAPS structure to determine whether additional raster operations are supported.
D3DRENDERSTATE_PLANEMASK
Physical plane mask whose type is ULONG. The default value is the bitwise negation of zero (~0). This physical plane mask can be used to turn off the red bit, the blue bit, and so on. This render state is not supported by the software rasterizers, and is often ignored by hardware drivers. To disable writes to the color buffer by using alpha blending, you can set D3DRENDERSTATE_SRCBLEND to D3DBLEND_ZERO and D3DRENDERSTATE_DESTBLEND to D3DBLEND_ONE.
D3DRENDERSTATE_ZWRITEENABLE
TRUE to enable writes 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 this state is FALSE, depth comparisons are still made according to the render state D3DRENDERSTATE_ZFUNC (assuming depth buffering is taking place), but depth values are not written to the buffer.
D3DRENDERSTATE_ALPHATESTENABLE
TRUE to enable alpha tests. The default value is FALSE. This member enables applications to turn off the tests that otherwise would 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 D3DRENDERSTATE_ALPHAFUNC render state. When this mode is enabled, alpha blending occurs only if the test succeeds.

D3DRENDERSTATE_LASTPIXEL
FALSE to enable drawing the last pixel in a line or triangle. The default value is TRUE.
D3DRENDERSTATE_TEXTUREMAG
This render state is superseded by the D3DTSS_MAGFILTER texture stage stage, set through the IDirect3DDevice3::SetTextureStageState method, but can still be used to set the magnification filter for the first texture stage. This render state can be one of the members of the D3DTEXTUREFILTER enumerated type, which describes how a texture should be filtered when it is being magnified (that is, when a texel must cover more than one pixel). The valid values are D3DFILTER_NEAREST (the default) and D3DFILTER_LINEAR.
D3DRENDERSTATE_TEXTUREMIN
This render state is superseded by the D3DTSS_MINFILTER texture stage stage, set through the IDirect3DDevice3::SetTextureStageState method, but can still be used to set the minification filter for the first texture stage. This render state can be one of the members of the D3DTEXTUREFILTER enumerated type, which describes how a texture should be filtered when it is being made smaller (that is, when a pixel contains more than one texel). Any of the members of the D3DTEXTUREFILTER enumerated type can be specified for this render state. The default value is D3DFILTER_NEAREST.
D3DRENDERSTATE_SRCBLEND
One of the members of the D3DBLEND enumerated type. The default value is D3DBLEND_ONE.
D3DRENDERSTATE_DESTBLEND
One of the members of the D3DBLEND enumerated type. The default value is D3DBLEND_ZERO.
D3DRENDERSTATE_TEXTUREMAPBLEND
This render state is used when rendering with the IDirect3DDevice2 interface. When rendering multiple textures with the IDirect3DDevice3 interface, you can set blending operations and arguments through the IDirect3DDevice3::SetTextureStageState method. For more information, see Multiple Texture Blending.

One of the members of the D3DTEXTUREBLEND enumerated type. The default value is D3DTBLEND_MODULATE.

D3DRENDERSTATE_CULLMODE
Specifies how back-facing triangles are to be culled, if at all. This can be set to one of the members of the D3DCULL enumerated type. The default value is D3DCULL_CCW.
D3DRENDERSTATE_ZFUNC
One of the members of the D3DCMPFUNC enumerated type. The default value is D3DCMP_LESSEQUAL. This member enables an application to accept or reject a pixel based on its distance from the camera.

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, since there is no need to filter and modulate the texture if the pixel is not going to be rendered.

D3DRENDERSTATE_ALPHAREF
Value specifying a reference alpha value against which pixels are tested when alpha-testing is enabled. This is an 8 bit value placed in the low 8 bits of the DWORD render state value. Values can range from 0x00000000 to 0x000000FF.
D3DRENDERSTATE_ALPHAFUNC
One of the members of the D3DCMPFUNC enumerated type. The default value is D3DCMP_ALWAYS. This member enables an application to accept or reject a pixel based on its alpha value.
D3DRENDERSTATE_DITHERENABLE
TRUE to enable dithering. The default value is FALSE.
D3DRENDERSTATE_ALPHABLENDENABLE
TRUE to enable alpha-blended transparency. The default value is FALSE. This member supersedes the legacy D3DRENDERSTATE_BLENDENABLE render state; see remarks for more information.

Prior to DirectX 5.0, the software rasterizers used this render state to toggle both color keying and alpha blending. Currently, you can use the D3DRENDERSTATE_COLORKEYENABLE render state to toggle color keying. (Hardware rasterizers have always used the D3DRENDERSTATE_BLENDENABLE render state only for toggling alpha blending.)

The type of alpha blending is determined by the D3DRENDERSTATE_SRCBLEND and D3DRENDERSTATE_DESTBLEND render states. D3DRENDERSTATE_ALPHABLENDENABLE, with D3DRENDERSTATE_COLORKEYENABLE, allows fine blending control.

D3DRENDERSTATE_ALPHABLENDENABLE does not affect the texture-blending modes specified by the D3DTEXTUREBLEND enumerated type. Texture blending is logically well before the D3DRENDERSTATE_ALPHABLENDENABLE part of the pixel pipeline. The only interaction between the two is that the alpha portions remaining in the polygon after the D3DTEXTUREBLEND phase may be used in the D3DRENDERSTATE_ALPHABLENDENABLE phase to govern interaction with the content in the frame buffer.

Applications should check the D3DDEVCAPS_DRAWPRIMTLVERTEX flag in the D3DDEVICEDESC structure to find out whether this render state is supported.

D3DRENDERSTATE_FOGENABLE
TRUE to enable fog blending. The default value is FALSE. For more information, see Fog Blending and Fog.
D3DRENDERSTATE_SPECULARENABLE
TRUE to enable specular highlights. For the IDirect3DDevice3 interface, the default value is FALSE. For earlier interfaces, the default is TRUE.

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.

D3DRENDERSTATE_ZVISIBLE
This render state is not supported.
D3DRENDERSTATE_SUBPIXEL
TRUE to enable subpixel correction. The default value is FALSE.

Subpixel correction is the ability to draw pixels in precisely their correct locations. In a system that implemented subpixel correction, if a pixel were at position 0.1356, its position would be interpolated from the actual coordinate rather than simply drawn at 0 (using the integer values). Hardware can be non-subpixel correct or subpixel correct in x or in both x and y. When interpolating across the x-direction the actual coordinate is used. All hardware should be subpixel correct. Some software rasterizers are not subpixel correct because of the performance loss.

Subpixel correction means that the hardware always pre-steps the interpolant values in the x-direction to the nearest pixel centers and then steps one pixel at a time in the y-direction. For each x span it also pre-steps in the x-direction to the nearest pixel center and then steps in the x-direction one pixel each time. This results in very accurate rendering and eliminates almost all jittering of pixels on triangle edges. Most hardware either doesn't support it (always off) or always supports it (always on).

D3DRENDERSTATE_SUBPIXELX
TRUE to enable subpixel correction in the x-direction only. The default value is FALSE.
D3DRENDERSTATE_STIPPLEDALPHA
TRUE to enable stippled alpha. The default value is FALSE.

Current software rasterizers ignore this render state. You can use the D3DPSHADECAPS_ALPHAFLATSTIPPLED flag in the D3DPRIMCAPS structure to discover whether the current hardware supports this render state.

D3DRENDERSTATE_FOGCOLOR
Value whose type is D3DCOLOR. The default value is 0. For more information, see Fog Color.
D3DRENDERSTATE_FOGTABLEMODE
The fog formula to be used for pixel fog. Set to one of the members of the D3DFOGMODE enumerated type. The default value is D3DFOG_NONE. For more information, see Pixel Fog.
D3DRENDERSTATE_FOGTABLESTART
D3DRENDERSTATE_FOGTABLEEND
Depth at which pixel fog effects begin and end for linear fog mode. Depth is specified in world-space for hardware devices (which use eye-relative fog) or in device-space for software devices. For more information, see Pixel Fog Parameters and Eye-Relative vs. Z-Based Depth.

These render states enable you to exclude fog effects for positions close to the camera. For example, you could set the starting depth to 0.3 to prevent fog effects for depths between 0.0 and 0.299, and the ending depth to 0.7 to prevent additional fog effects for depths between 0.701 and 1.0.

D3DRENDERSTATE_FOGTABLEDENSITY
Fog density for pixel fog to be used in the exponential fog modes (D3DFOG_EXP and D3DFOG_EXP2). Valid density values range from 0.0 to 1.0, inclusive. The default value is 1.0. For more information, see Pixel Fog Parameters.
D3DRENDERSTATE_STIPPLEENABLE
Enables stippling in the device driver. When stippled alpha is enabled, it overrides the current stipple pattern, as specified by the D3DRENDERSTATE_STIPPLEPATTERN00 through D3DRENDERSTATE_STIPPLEPATTERN31 render states. When stippled alpha is disabled, the stipple pattern must be returned.
D3DRENDERSTATE_EDGEANTIALIAS
TRUE to antialias lines forming the convex outline of objects. The default value is FALSE. For more information, see Edge Antialiasing and Antialiasing States. When set to TRUE, applications should only render 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 simply 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 only enable edge antialiasing on devices that expose the D3DPRASTERCAPS_ANTIALIASEDGES capability.

D3DRENDERSTATE_COLORKEYENABLE
TRUE to enable color-keyed transparency. The default value is FALSE. You can use this render state with D3DRENDERSTATE_ALPHABLENDENABLE to implement fine blending control.

Applications should check the D3DDEVCAPS_DRAWPRIMTLVERTEX flag in the D3DDEVICEDESC structure to find out whether this render state is supported.

When color-keyed transparency is enabled, only texture surfaces that were created with the DDSD_CKSRCBLT flag will be affected. Surfaces that were created without the DDSD_CKSRCBLT flag will exhibit color-keyed transparency effects.

D3DRENDERSTATE_BORDERCOLOR
A DWORD value specifying a border color. If the texture addressing mode is specified as D3DTADDRESS_BORDER (as set in the D3DTEXTUREADDRESS enumerated type), this render state specifies the border color the system uses when it encounters texture coordinates outside the range [0.0, 1.0].

The format of the physical-color information specified by the DWORD value depends on the format of the DirectDraw surface.

D3DRENDERSTATE_TEXTUREADDRESSU
This render state is superseded by the D3DTSS_ADDRESSU texture stage state value set through the IDirect3DDevice3::SetTextureStageState method, but can still be used to set the addressing mode of the first texture stage. Valid values are members of the D3DTEXTUREADDRESS enumerated type. The default value is D3DTADDRESS_WRAP. For more information, see Texture Addressing Modes.

This render state applies only to the u texture coordinate. This render state, along with D3DRENDERSTATE_TEXTUREADDRESSV, allows you to specify separate texture-addressing modes for the u and v coordinates of a texture. Because the D3DRENDERSTATE_TEXTUREADDRESS render state applies to both the u and v texture coordinates, it overrides any values set for the D3DRENDERSTATE_TEXTUREADDRESSU render state.

D3DRENDERSTATE_TEXTUREADDRESSV
This render state is superseded by the D3DTSS_ADDRESSV texture stage state value set through the IDirect3DDevice3::SetTextureStageState method, but can still be used to set the addressing mode of the first texture stage. Valid values are members of the D3DTEXTUREADDRESS enumerated type. The default value is D3DTADDRESS_WRAP. For more information, see Texture Addressing Modes.

This render state applies only to the v texture coordinate. This render state, along with D3DRENDERSTATE_TEXTUREADDRESSU, allows you to specify separate texture-addressing modes for the u and v coordinates of a texture. Because the D3DRENDERSTATE_TEXTUREADDRESS render state applies to both the u and v texture coordinates, it overrides any values set for the D3DRENDERSTATE_TEXTUREADDRESSV render state.

D3DRENDERSTATE_MIPMAPLODBIAS
Floating-point D3DVALUE value used to change the level of detail (LOD) bias. This value offsets the value of the mipmap level that is computed by trilinear texturing. It is usually in the range –1.0 to 1.0; the default value is 0.0.

Each unit bias (+/-1.0) biases the selection by exactly one mipmap level. A positive bias will cause the use of larger mipmap levels, resulting in a sharper but more aliased image. A negative bias will cause the use of smaller mipmap levels, resulting in a blurrier image. Applying a negative bias also results in the referencing of a smaller amount of texture data, which can boost performance on some systems.

D3DRENDERSTATE_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. For more information, see Using Depth Buffers.
D3DRENDERSTATE_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 eye is rotated — in this case, the depth changes while the range remains constant.

This render state works only with D3DVERTEX vertices. When you specify D3DLVERTEX or D3DTLVERTEX vertices, the F (fog) component of the RGBF fog value should already be corrected for range.

Since no hardware currently supports per-pixel range-based fog, range correction offered only for vertex fog. For more information, see Range-based Fog and Vertex Fog.

D3DRENDERSTATE_ANISOTROPY
This render state is superseded by the D3DTSS_MAXANISOTROPY texture stage state, set through the IDirect3DDevice3::SetTextureStageState method, but can still be used to set the degree of anisotropic filtering for the first texture stage.

This render state can be an integer value that enables a degree of anisotropic filtering, used for bilinear or trilinear filtering. The value determines the maximum aspect ratio of the sampling filter kernel. To determine the range of appropriate values, use the D3DPRASTERCAPS_ANISOTROPY flag in the D3DPRIMCAPS structure.

Anisotropy is the distortion visible in the texels of a 3-D object whose surface is oriented at an angle with respect to the plane of the screen. The anisotropy is measured as the elongation (length divided by width) of a screen pixel that is inverse-mapped into texture space.

D3DRENDERSTATE_FLUSHBATCH
Flush any pending DrawPrimitive batches. When rendering with texture handles (using the IDirect3DDevice2 interface) you must flush batched primitives after modifying the current texture surface. Batched primitives are implicitly flushed when rendering with the IDirect3DDevice3 interface, as well as when rendering with execute buffers.
D3DRENDERSTATE_TRANSLUCENTSORTINDEPENDENT
TRUE to enable sort-independent transparency, or FALSE to disable.
D3DRENDERSTATE_STENCILENABLE
TRUE to enable stenciling, or FALSE to disable stenciling. The default value is FALSE. For more information, see Stencil Buffers.
D3DRENDERSTATE_STENCILFAIL
Stencil operation to perform if the stencil test fails. This can be one of the members of the D3DSTENCILOP enumerated type. The default value is D3DSTENCILOP_KEEP. For more information, see Stencil Buffers.
D3DRENDERSTATE_STENCILZFAIL
Stencil operation to perform if the stencil test passes and depth test (z-test) fails. This can be one of the members of the D3DSTENCILOP enumerated type. The default value is D3DSTENCILOP_KEEP. For more information, see Stencil Buffers.
D3DRENDERSTATE_STENCILPASS
Stencil operation to perform if both the stencil and depth (z) tests pass. This can be one of the members of the D3DSTENCILOP enumerated type. The default value is D3DSTENCILOP_KEEP. For more information, see Stencil Buffers.
D3DRENDERSTATE_STENCILFUNC
Comparison function for the stencil test. This can be one of the members of the D3DCMPFUNC enumerated type. The default value is D3DCMP_ALWAYS.

The comparison function is used to compare the reference value to a stencil buffer entry. This comparison only applies to the bits in the reference value and stencil buffer entry that are set in the stencil mask (set by the D3DRENDERSTATE_STENCILMASK render state). If the comparison is true, the stencil test passes.

D3DRENDERSTATE_STENCILREF
Integer reference value for the stencil test. The default value is 0.
D3DRENDERSTATE_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 0xFFFFFFFF.
D3DRENDERSTATE_STENCILWRITEMASK
Write mask applied to values written into the stencil buffer. The default mask is 0xFFFFFFFF.
D3DRENDERSTATE_TEXTUREFACTOR
Color used for multiple texture blending with the D3DTA_TFACTOR texture-blending argument or D3DTOP_BLENDFACTORALPHA texture-blending operation. The associated value is a D3DCOLOR variable.
D3DRENDERSTATE_STIPPLEPATTERN00 through D3DRENDERSTATE_STIPPLEPATTERN31
Stipple pattern. Each render state applies to a separate line of the stipple pattern. Together, these render states specify a 32x32 stipple pattern.
D3DRENDERSTATE_WRAP0 through D3DRENDERSTATE_WRAP7
Texture wrapping behavior for multiple textures. Valid values for these render states are a combination of one or both of the D3DWRAP_U and D3DWRAP_V flags, which cause the system to wrap in the u and v directions for a given texture. The default value for these render states is 0 (wrapping disabled in both directions). For more information, see Texture Wrapping.
D3DRENDERSTATE_FORCE_DWORD
Forces this enumerated type to be 32 bits in size.

Remarks

The D3DRENDERSTATE_BLENDENABLE member was superseded by the D3DRENDERSTATE_ALPHABLENDENABLE member. Its name was changed to make its meaning more explicit. To maintain compatibility with legacy applications, the D3DRENDERSTATE_BLENDENABLE constant is declared as equivalent to D3DRENDERSTATE_ALPHABLENDENABLE:

#define D3DRENDERSTATE_BLENDENABLE  D3DRENDERSTATE_ALPHABLENDENABLE
 

Direct3D defines the D3DRENDERSTATE_WRAPBIAS constant as a convenience for applications to enable or disable texture wrapping based on the zero-based integer of a texture coordinate set (rather than explicitly using one of the D3DRENDERSTATE_WRAPn state values). Add the D3DRENDERSTATE_WRAPBIAS value to the zero-based index of a texture coordinate set to calculate the D3DRENDERSTATE_WRAPn value that corresponds to that index, as shown in the following example:

// Enable U/V wrapping for textures that use the texture 
// coordinate set at the index within the dwIndex variable.
HRESULT hr = lpD3DDevice->SetRenderState(
    dwIndex + D3DRENDERSTATE_WRAPBIAS,  
    D3DWRAP_U | D3DWRAPV);
 
// If dwIndex is 3, the value that results from 
// the addition equates to D3DRENDERSTATE_WRAP3 (131).
 

QuickInfo

  Windows NT/2000: Requires Windows NT 4.0 SP3 or later.
  Windows 95/98: Requires Windows 95 or later. Available as a redistributable for Windows 95.
  Header: Declared in d3dtypes.h.

See Also

D3DOPCODE, D3DSTATE