Direct3D uses the concept of states to alter the way things are rendered. The device is in effect a state computer. We can set states for lighting, rendering and transformation modules.
Note: it is important to realise that when a state is set it remains set until changed to something else.
The three types of Direct3D state
There are three areas that we can play with (click on the required link to go to a page with more detail on each):
- Render States - controls the rasterization module (where geometry is converted into the pixels)
- Sampler States - controls sampling states like filtering, tiling etc.
- Texture Stage States - controls the way textures are rendered.
State Blocks allow you to define a whole set of states and save them as a block allowing you to set and clear these states at run time more easily. I will add more notes about these in the near future but meanwhile you can take a look in the DirectX help for how to use them, they are not difficult.