I'm trying to run this simple shader code:
float4x4 matWorldViewProj;
struct VS_OUTPUT
{
float4 Pos: POSITION;
};
VS_OUTPUT VS( float4 Pos: POSITION )
{
VS_OUTPUT Out = (VS_OUTPUT) 0;
Out.Pos = mul(Pos, matWorldViewProj);
return Out;
}
float4 PS() : COLOR
{
float Aintensity = 0.8f;
float4 Acolor = float4(1.0f, 0.075f, 0.075f, 1.0f);
return Aintensity * Acolor;
}
technique TShader
{
pass P0
{
// compiler directives
VertexShader = compile vs_1_1 VS();
PixelShader = compile ps_1_1 PS();
}
}
It runs great with DX9 and I tried to port it over to Dark SDK C++. I am using the dbSetEffectOn() function. If you do not load an object then it's supposed to create an object and apply the shader. I've tried this but it fails. I then learned that you need to add another Semantic to the global variables. So I added the:
float4x4 matWorldViewProj : WorldViewProjection;
and I still get a crash. I also tried loading an object to test if that was the issue. Why are DG's shaders different? Is it just because of the damn internal math representation of matricies/vectors?
Thanks for any and all help,
David