Jump to content
  • Advertisement
Sign in to follow this  

C#.net Effect Class and Fx Files Error

This topic is 3161 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

    // 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;

Share this post

Link to post
Share on other sites
okay , I have solve it myself ; and the error cause by this reason
that we should create are effect in our render function .
<in Timer.> or <form_paint>

Share this post

Link to post
Share on other sites
I still have the same problem and i don't see solution... can anybody help me? I use "Managed DirectX 9: graphics and game programming" by Tom Miller.
Btw, i would be very grateful if someone can give msn or skype contact to me. It will not be so much wasting of time, just to show me where the problem is when i stop at some point and i can't continue..

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!