Game Development Reference
In-Depth Information
// Hook up the sampler object to sampler stage 0.
Sampler[0] = (ShadeSampler);
}
}
We note that the cartoon shader functions are defined inside the effect
file, and we specify the shader to use for a particular pass using the
syntax vertexShader = compile vs_1_1 Main() ; in the pass
block. Device states are set as usual in the effect file.
19.10 EffectEdit
Before we conclude this chapter, we want to mention the EffectEdit
program that ships with the DirectX SDK. It can be found in the
\DXSDK\Samples\C++\Direct3D\Bin folder. Figure 19.3 shows a
screen shot.
Figure 19.3: A screen shot
of the EffectEdit program
that ships with the DirectX
SDK
The EffectEdit program is useful for testing and writing effect files. We
recommend that you spend some time exploring this tool.
19.11 Summary
Effect files encapsulate a complete effect, including possible hard-
ware fallbacks for hardware with different capabilities and render-
ing passes. The effects framework is desirable because we can
change effect files without recompiling source code and because it
allows us to encapsulate an effect, making everything modular.
Effect files can be used without shaders; that is, it is perfectly accept-
able to make an effect file that uses the fixed function pipeline.
Search WWH ::




Custom Search