I'm a shader newbie, and i were trying to program a simple vertex shader just for test. The shader works, but after the level loads and the camera is loaded, all the objects using that material get a beautiful flat grey... and i'm sure that the shader's parameters aren't modified by starters or other functions...
Here's the code:
Code:
material mat_test
{
effect = "
matrix matWorldViewProj;
matrix matWorld;
texture entSkin1; //
texture entSkin2; //
dword mtlSkill1;
vector vecLight;
vector vecViewDir;
// default technique
technique test
{
pass P0
{
VertexShaderConstant[0]=<matWorldViewProj>;
VertexShaderConstant[4]=<matWorld>;
VertexShaderConstant[10]= <vecLight>;
VertexShaderConstant[15]= <vecViewDir>;
Texture[0] = <entSkin1>;
Texture[1] = <entSkin2>;
VertexShader = asm
vs.1.1
dcl_position v0
dcl_normal v3
dcl_texcoord0 v7
def c16, 0, 175, 175, 100
def c20, 175, 0.011,0,0
m4x4 oPos, v0,c0
sub r0, v3, -c15
mul r0, r0, c16
mul oD0, r0, c20.yyyy
};
}
}
technique fallback
{
pass P0
{
// set texture stage states
Texture[0] = <entSkin1>;
ColorArg1[0] = Texture; // stage 0 = skin texture
ColorOp[0] = Modulate2x;
ColorArg2[0] = Diffuse; // modulate by lighting
}
}
"; // end of the effect string
}
There are some useless things, and the shader itself it's useless, but someone has an idea of because it becomes flat grey after camera loading?
Thanks, Tommo