December 2004
Beginner
432 pages
10h 17m
English
Once again, this screen is better, but it's still not perfect. What about the texture you have loaded? To use the textures, you have to write a pixel shader. Pixel shaders are just as easy to use as a simple vertex shader. Replace your KartRacers.fx file with the code in Listing 20.5.
//----------------------------------------------------------------------------- // Global variables //----------------------------------------------------------------------------- // World matrix for object float4x4 worldMatrix : WORLD; // World * View * Projection matrix float4x4 worldViewProjection : WORLDVIEWPROJECTION; float4 lightDirection; // Direction of the light texture SceneTexture; sampler ... |
Read now
Unlock full access