tags:

views:

37

answers:

1

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(); } }

http://blogs.msdn.com/b/shawnhar/archive/2006/12/11/sixty-fractals-per-second.aspx http://blogs.msdn.com/b/shawnhar/archive/2010/04/05/spritebatch-and-custom-shaders-in-xna-game-studio-4-0.aspx

+1  A: 

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

Athari
Thanks, I'll give it a try. You are right about GPU. I know that this problem is ATI specific.
Amir Rezaei