Microsoft DirectX 8.0 (C++) |
Using an effect in Microsoft® Direct3D® allows an application to define many different techniques for a single effect. Each effect contains one or more techniques that controls the rendering of the effect. Each technique can be validated to see if the current device can support it. If the current device does not support a technique, then a different technique can be used.
You can use different techniques to control the complexity of a rendered effect. For example, say you want a pond of water that has rippled waves that reflect light. One technique might render the entire scene with multiple textures and lighting in one pass, while other techniques might use multiple-pass rendering. This can be done so that video cards that don't support single-pass rendering can still render an effect.
You can also adjust effects based on the level of detail needed. An effect that appears in the distance might use a simpler technique to decrease the computational overhead that is incurred when rendering a complex technique.
Another advantage to using effects is that you can modify the effect file without recompiling the source application. This enables you to release a product that makes optimum use of modern video cards. It also enables you to update the effect file to take advantage of video cards of the future.