开发者

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开发者_JAVA技巧 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


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. :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜