![]() |
![]() |
![]() |
A state block can be used to capture only pixel state (see State Blocks Save and Restore State). The following state is pixel state:
To capture pixel state with a state block, specify D3DSBT_PIXELSTATE when calling IDirect3DDevice9::CreateStateBlock.
Device render states affect the behavior of almost every part of the pipeline. Render states are set by calling IDirect3DDevice9::SetRenderState.
The following table includes all render states that set-up pixel state:
Sampler states control sampling related topics such as filtering, tiling, and texture coordinate address modes. Use IDirect3DDevice9::SetSamplerState to set up the sampler state (including the one used in the tessellator unit to sample displacement maps). The sampler states have been renamed with a "D3DSAMP_" prefix to enable compile time error detection when porting from Microsoft DirectX 8.x.
The following table includes all sampler states that set-up pixel state:
Sampler States | Default Value |
---|---|
D3DSAMP_ADDRESSU | D3DTADDRESS_WRAP |
D3DSAMP_ADDRESSV | D3DTADDRESS_WRAP |
D3DSAMP_ADDRESSW | D3DTADDRESS_WRAP |
D3DSAMP_BORDERCOLOR | 0x00000000 |
D3DSAMP_MAGFILTER | D3DTEXF_POINT |
D3DSAMP_MINFILTER | D3DTEXF_POINT |
D3DSAMP_MIPFILTER | D3DTEXF_NONE |
D3DSAMP_MIPMAPLODBIAS | 0 |
D3DSAMP_MAXMIPLEVEL | 0 |
D3DSAMP_MAXANISOTROPY | 1 |
D3DSAMP_SRGBTEXTURE | 0 |
D3DSAMP_ELEMENTINDEX | 0 |
Texture states control texture blending operations of the multi-texture blender. Use IDirect3DDevice9::SetTextureStageState to set-up texture stage states. Use IDirect3DDevice9::SetTexture to associate a texture with a sampler stage.
The following table includes all the texture states that set-up pixel state:
Texture States | Default Value |
---|---|
D3DTSS_COLOROP | D3DTOP_DISABLE |
D3DTSS_COLORARG1 | D3DTA_TEXTURE |
D3DTSS_COLORARG2 | D3DTA_CURRENT |
D3DTSS_ALPHAOP | D3DTOP_DISABLE |
D3DTSS_ALPHAARG1 | D3DTA_TEXTURE |
D3DTSS_ALPHAARG2 | D3DTA_CURRENT |
D3DTSS_BUMPENVMAT00 | 0 |
D3DTSS_BUMPENVMAT01 | 0 |
D3DTSS_BUMPENVMAT10 | 0 |
D3DTSS_BUMPENVMAT11 | 0 |
D3DTSS_TEXCOORDINDEX | 0 |
D3DTSS_BUMPENVLSCALE | 0 |
D3DTSS_BUMPENVLOFFSET | 0 |
D3DTSS_TEXTURETRANSFORMFLAGS | D3DTTFF_DISABLE |
D3DTSS_COLORARG0 | D3DTA_CURRENT |
D3DTSS_ALPHAARG0 | D3DTA_CURRENT |
D3DTSS_RESULTARG | D3DTA_CURRENT |