2
\$\begingroup\$

need some help, just trying to load compiled .fx (.xnb) file by monogame (version 3.4.0.456) in Windows Phone 8.1 enviroment by this code

MainEffect = Game.Content.Load<Effect>("chessboard");

there is a some delay, about 3-4 seconds, and then i get

SharpDX.SharpDXException "Additional information: HRESULT: [0x80070057], Module: [General], ApiCode: [E_INVALIDARG/Invalid Arguments], Message: The parameter is incorrect."

Tried different files, but seems no matter how complex the are, behaviour is the same. Even this simple effect gives an error:

float4x4 World;

struct VertexShaderInput
{
    float4 Position : SV_POSITION0;
    float4 Color : COLOR0;
};

struct VertexShaderOutput
{
    float4 Position : SV_POSITION0;
    float4 Color : COLOR0;
};

VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
{
    VertexShaderOutput output;
    output.Position = mul(input.Position, World);
    output.Color = input.Color;
    return output;
}

float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
    return input.Color;
}

technique Specular
{
    pass Pass1
    {
        VertexShader = compile  vs_4_0 VertexShaderFunction();
        PixelShader = compile ps_4_0 PixelShaderFunction();
    }
}

But for Windows 7/8/10 its works well. Any ideas ?

\$\endgroup\$
1
\$\begingroup\$

Well changed versions of vs/ps to 4_0_level_9_3 and it worked :)

    VertexShader = compile vs_4_0_level_9_3 VertexShaderFunction();
    PixelShader = compile ps_4_0_level_9_3 PixelShaderFunction();
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.