Set device state on fixed-function, shader pipelines
This section provides the key differences between setting device state with the fixed-function and programmable shader pipeline.
Here are the device states that you can set for just a fixed-function pipeline:
- Fixed-function transform and lighting: IDirect3DDevice9::SetRenderState with D3DRS_SHADEMODE, D3DRS_SPECULARENABLE, D3DRS_LIGHTING, D3DRS_AMBIENT, D3DRS_COLORVERTEX, D3DRS_LOCALVIEWER, D3DRS_NORMALIZENORMALS, D3DRS_DIFFUSEMATERIALSOURCE, D3DRS_SPECULARMATERIALSOURCE, D3DRS_AMBIENTMATERIALSOURCE, D3DRS_EMISSIVEMATERIALSOURCE, D3DRS_VERTEXBLEND, D3DRS_INDEXEDVERTEXBLENDENABLE, D3DRS_TWEENFACTOR, IDirect3DDevice9::LightEnable, IDirect3DDevice9::MultiplyTransform, IDirect3DDevice9::SetFVF, IDirect3DDevice9::SetLight, IDirect3DDevice9::SetMaterial, IDirect3DDevice9::SetTransform
- Fixed-function pixel shader: IDirect3DDevice9::SetRenderState with D3DRS_TEXTUREFACTOR, IDirect3DDevice9::SetTextureStageState
- Fog: IDirect3DDevice9::SetRenderState with D3DRS_FOGENABLE, D3DRS_FOGCOLOR, D3DRS_FOGTABLEMODE, D3DRS_FOGSTART, D3DRS_FOGEND, D3DRS_FOGDENSITY, D3DRS_RANGEFOGENABLE, D3DRS_FOGVERTEXMODE
Here are the device render states that you can set with IDirect3DDevice9::SetRenderState for both fixed-function and programmable shader pipelines:
- Render Target state: D3DRS_COLORWRITEENABLE, D3DRS_COLORWRITEENABLE1, D3DRS_COLORWRITEENABLE2, D3DRS_COLORWRITEENABLE3, D3DRS_SRGBWRITEENABLE
- Depth state: D3DRS_ZENABLE, D3DRS_ZWRITEENABLE, D3DRS_ZFUNC, D3DRS_SLOPESCALEDEPTHBIAS, D3DRS_DEPTHBIAS
- Stencil state: D3DRS_STENCILENABLE, D3DRS_STENCILFAIL, D3DRS_STENCILZFAIL, D3DRS_STENCILPASS, D3DRS_STENCILFUNC, D3DRS_STENCILREF, D3DRS_STENCILMASK, D3DRS_STENCILWRITEMASK, D3DRS_TWOSIDEDSTENCILMODE, D3DRS_CCW_STENCILFAIL, D3DRS_CCW_STENCILZFAIL, D3DRS_CCW_STENCILPASS, D3DRS_CCW_STENCILFUNC
- Alpha Blending: D3DRS_SRCBLEND, D3DRS_DESTBLEND, D3DRS_BLENDOP, D3DRS_BLENDFACTOR, D3DRS_SEPARATEALPHABLENDENABLE, D3DRS_SRCBLENDALPHA, D3DRS_DESTBLENDALPHA, D3DRS_BLENDOPALPHA
- Alpha Test: D3DRS_ALPHATESTENABLE, D3DRS_ALPHAREF, D3DRS_ALPHAFUNC
- Rasterizer state: D3DRS_FILLMODE, D3DRS_LASTPIXEL, D3DRS_DITHERENABLE (16-bit surfaces)
- Culling: D3DRS_CULLMODE
- Clipping: D3DRS_CLIPPING, D3DRS_CLIPPLANEENABLE
- Scissors: D3DRS_SCISSORTESTENABLE
- Texture samplers: D3DRS_WRAP0, D3DRS_WRAP1, D3DRS_WRAP2, D3DRS_WRAP3, D3DRS_WRAP4, D3DRS_WRAP5, D3DRS_WRAP6, D3DRS_WRAP7, D3DRS_WRAP8, D3DRS_WRAP9, D3DRS_WRAP10, D3DRS_WRAP11, D3DRS_WRAP12, D3DRS_WRAP13, D3DRS_WRAP14, D3DRS_WRAP15
- Anti-aliasing: D3DRS_MULTISAMPLEANTIALIAS, D3DRS_MULTISAMPLEMASK, D3DRS_ANTIALIASEDLINEENABLE
- Point sprites : D3DRS_POINTSIZE, D3DRS_POINTSIZE_MIN, D3DRS_POINTSPRITEENABLE, D3DRS_POINTSIZE_MAXD3DRS_POINTSCALEENABLE, D3DRS_POINTSCALE_A, D3DRS_POINTSCALE_B, D3DRS_POINTSCALE_C
- N-patches: D3DRS_PATCHEDGESTYLE, D3DRS_POSITIONDEGREE, D3DRS_NORMALDEGREE, D3DRS_MINTESSELLATIONLEVEL, D3DRS_MAXTESSELLATIONLEVEL, D3DRS_ADAPTIVETESS_X, D3DRS_ADAPTIVETESS_Y, D3DRS_ADAPTIVETESS_Z, D3DRS_ADAPTIVETESS_W, D3DRS_ENABLEADAPTIVETESSELLATION
Related topics