Graphics Reference
In-Depth Information
Once the output primitives have been rasterized to their appropriate render targets,
the pixel shader is invoked for each fragment. In this case, we simply sample the object's
texture using the passed-through texture coordinates. This allows the object being rendered
to appear properly across each primitive being rasterized. The pixel shader is shown in
Listing 13.3.
float4 PSMAIN( in PS_INPUT IN ) : SVJTarget
{
float4 OUT;
clip( IN.z_value + 0.05f );
// Sample the texture to find the appropriate color value
OUT = ColorTexture.Sample( LinearSampler, IN.tex );
return OUT;
}
Listing 1 3.3. The pixel shader for rendering a textured object into a paraboloid map.
A sample pair of front and back paraboloid maps for a sample scene is provided
in Figure 13.8. The warped view produced by the paraboloid projection can clearly be
Figure 13.8. Sample paraboloid maps for a test scene, demonstrating the view from the front and back
Model courtesy of Radioactive Software, LLC, www.radioactive-software.com . Created by Tomas
Drinovsky, Danny Green.
Search WWH ::




Custom Search