I'm trying to do mimick DirectX EMBM to learn Cg, I think I've understood the theory but my program doesn't do what I'm expecting. Here is the code :
The result of it is that I'm only seeing the base texture :?
Any help is welcome
Code:
struct VertexOut
{
float4 color : COLOR0;
float4 texCoord0 : TEXCOORD0;
float4 texCoord1 : TEXCOORD1;
float4 texCoord2 : TEXCOORD2;
};
float4 main (VertexOut IN, uniform sampler2D baseMap,
uniform sampler2D bumpMap, uniform sampler2D lightMap) : COLOR
{
float4 baseColor = tex2D (baseMap, IN.texCoord0.xy);
float4 bumpOffset = tex2D (bumpMap, IN.texCoord1.xy);
float4 identity = float4 (1, 0, 0, 1);
float4 lightColor = offsettex2D (lightMap, IN.texCoord2.xy, bumpOffset, identity);
return baseColor + lightColor;
}
The result of it is that I'm only seeing the base texture :?
Any help is welcome