Amir Rezaei
Amir Rezaei

Reputation: 5086

Different version of PixelShader and VertexShader for SpriteBatch

I have tried to compile some pixel shader examples. But all of them give the same error message.

"Cannot mix shader model 3.0 with earlier shader models. If either the vertex shader or pixel shader is compiled as 3.0, they must both be."

The problem seems to be that the pixel shader uses ps_3_0 and sprite batch has earlier version.

technique MyTechnique
{
    pass
    {
        PixelShader = compile ps_3_0 Mandelbrot_PixelShader();
    }
}

Link Link

Upvotes: 2

Views: 1441

Answers (1)

Athari
Athari

Reputation: 34275

You must recompile vertex shader with the version 3.0. You can get default shaders of XNA from http://create.msdn.com/en-US/education/catalog/sample/stock_effects Copy code from there, but set version of vertex shader to vs_3_0.

Most GPUs convert versions silently, so you're a bit unlucky. :)

Upvotes: 3

Related Questions