Game Development Reference
In-Depth Information
Shaders
As you can see above, shaders are a fairly integral part of 3D graphics programming.
So what exactly is a shader? A shader is a small program that we write for one of the
programmable stages of the Direct3D graphics pipeline. Two of the stages we pre-
viously looked at are programmable: the vertex shader stage and the pixel shader
stage. These are not the only programmable stages in the graphics pipeline though.
Shaders have what is known as a shader signature . The signature of a shader is just
a list of the input and/or output parameters of that shader.
In this chapter we will create two demos. Each will have its own shader file, named
Effects.fx . This is just a text file containing the code for our shaders. Shaders
are written in HLSL ( High Level Shader Language ). The downloadable code for this
chapter includes the Effects.fx files for both demo projects (they are NOT the
same).
For more information on shaders and HLSL, check out the HLSL programming guide
on Microsoft's website at http://msdn.microsoft.com/en-us/library/windows/desktop/
bb509635(v=vs.85).aspx .
Search WWH ::




Custom Search