![]() |
![]() |
![]() |
A state block can be used to capture only vertex state (see State Blocks Save and Restore State). The following state is vertex state:
To capture vertex state with a state block, specify D3DSBT_VERTEXSTATE 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 vertex 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 vertex state:
Sampler States | Default Value |
---|---|
D3DSAMP_DMAPOFFSET | 256 |
Texture states control texture blending operations of the multi-texture blender. Use IDirect3DDevice9::SetTextureStageState to set-up texture states. Use IDirect3DDevice9::SetTexture to associate a texture with a sampler stage.
The following table includes all the texture states that set-up vertex state:
Texture States | Default Value |
---|---|
D3DTSS_TEXCOORDINDEX | 0 |
D3DTSS_TEXTURETRANSFORMFLAGS | D3DTTFF_DISABLE |
D3DTSS_TEXCOORDINDEX is a fixed function vertex processing state. If a programmable vertex shader is used, this state is ignored.