Well, you don't need to wait for the templates, normalmapping is simple:
Code:
MATERIAL mtl_bump
{
//Normal Map must be on Skin2
effect=
"
#include <transform>
#include <fog>
#include <pos>
#include <normal>
#include <tangent>
float4 vecSunDir;
float4 vecColor;
texture entSkin1; // texture
texture entSkin2; // normal map
sampler sBaseTex = sampler_state { Texture = <entSkin1>; };
sampler sBump = sampler_state { Texture = <entSkin2>; };
struct out_bump
{
float4 Pos: POSITION;
float Fog: FOG;
float4 Color: COLOR;
float2 Tex: TEXCOORD0;
float2 Bump: TEXCOORD1;
float3 Normal: TEXCOORD2;
float3 Light: TEXCOORD3;
};
out_bump vs_bump(
in float4 inPos: POSITION,
in float3 inNormal: NORMAL,
in float2 inTex: TEXCOORD0,
in float3 inTangent: TEXCOORD2)
{
out_bump Out;
Out.Pos = DoTransform(inPos);
Out.Tex = inTex;
Out.Bump = inTex; // different coordinates required for ps_1_1
Out.Color = float4(1.0,1.0,1.0,1.0);
Out.Fog = DoFog(inPos);
CreateTangents(inNormal,inTangent);
float3 N = matTangent[2];
// transform the output values into the 0..1 range
Out.Light = DoTangent(-vecSunDir) * 0.5 + 0.5;
Out.Normal = DoTangent(N) * 0.5 + 0.5;
return Out;
}
float4 ps_bump(out_bump In): COLOR
{
float4 base = tex2D(sBaseTex,In.Tex);
float3 bumpNormal = tex2D(sBump,In.Bump);
float diffuse = saturate(dot(In.Light*2 - 1,bumpNormal*2 - 1));
#ifdef SHADOW
diffuse *= saturate(4 * dot(In.Light*2 - 1,In.Normal*2 - 1));
#endif
return base * diffuse;
}
technique bump
{
pass One
{
VertexShader = compile vs_1_1 vs_bump();
PixelShader = compile ps_1_1 ps_bump();
}
}
";
}
You need 6.50, the template6 file "default.fx" must be in the path, and the model must have a normal map on its second skin. You can also save the effect to an .fx file and assign it to the model directly in MED.