Game Development Reference
In-Depth Information
The effect file is implemented as follows:
//
// File: light_tex.txt
//
// Desc: Effect file that handles device states for lighting
//
and texturing a 3D model.
//
//
// Globals
//
matrix WorldMatrix;
matrix ViewMatrix;
matrix ProjMatrix;
texture Tex;
//
// Sampler
//
// Associated the texture 'Tex' with the texture stage 'S0'
// corresponds with and also set the sampler states for the sampler
// stage 'S0' corresponds with.
sampler S0 = sampler_state
{
Texture = (Tex);
MinFilter = LINEAR;
MagFilter = LINEAR;
MipFilter = LINEAR;
};
//
// Effect
//
technique LightAndTexture
{
pass P0
{
//
// Set misc. render states.
pixelshader = null; // No pixel shader.
vertexshader = null; // No vertex shader.
fvf = XYZ | Normal | Tex1; // Flexible vertex format
Lighting
= true;
// Enable lighting.
NormalizeNormals = true;
// Renormalize normals.
SpecularEnable
= false; // Disable specular highlights.
//
// Set transformation states
WorldTransform[0]
= (WorldMatrix);
ViewTransform
= (ViewMatrix);
Search WWH ::




Custom Search