Hi ,
I am using managed DirectX and C#.net , when i Run program , the program throws an error : " Error in Application..." and highlights below line :
effect = Effect.FromFile(dev, @"..\..\simple.fx", null, ShaderFlags.None, null);
and here is simple.fx :
// Shader output, position and diffuse color
struct VS_OUTPUT
{
float4 pos : POSITION;
float4 diff : COLOR0;
};
// The world view and projection matrices
float4x4 WorldViewProj : WORLDVIEWPROJECTION;
float Time = 1.0f;
// Transform our coordinates into world space
VS_OUTPUT Transform(
float4 Pos : POSITION)
{
// Declare our return variable
VS_OUTPUT Out = (VS_OUTPUT)0;
// Transform our position
Out.pos = mul(Pos, WorldViewProj);
// Set our color
Out.diff.r = 1 - Time;
Out.diff.b = Time * WorldViewProj[2].yz;
Out.diff.ga = Time * WorldViewProj[0].xy;
// Return
return Out;
}
technique TransformDiffuse
{
pass P0
{
CullMode = None;
// shaders
VertexShader = compile vs_1_1 Transform();
PixelShader = NULL;
}
}