Quote:

how i apply the shader to a model?




Paste this code into a script and follow the directions.

***********************************************************


//Copy the shader code into notepad and save the file as NM.fx in the root directory of your project
string fxNM3Light = "NM.fx";

//Assign this action to a mesh (box or sphere). Set the mesh to "cast" in properties and make sure the light is close to your model
action DynamicLight
{
my.red = 187;
my.green = 148;
my.blue = 11;
my.lightrange =600;
my.light = ON;
}


//Assign this material to the model you want normal map/specular effect by adding the material in the properties dialogue
//Make sure your model has a diffuse texture in skin1 and a normal map texture in skin 2.
//If you want more control of the specular, add a specular map to the alpha channel of the normalmap
material mat_nm3lights
{
flags = tangent;
effect = fxNM3Light;
}


starter LoadFX_startup()
{
effect_load(mat_nm3lights, fxNM3Light);
}

**********************************************************

Last edited by DWilki; 03/31/07 16:09.