XNA Creators Club Online
Page 1 of 1 (7 items)
Sort Posts: Previous Next

Sprites, shader model and ATi

Last post 1/9/2009 4:24 PM by Summon. 6 replies.
  • 1/9/2009 12:35 PM

    Sprites, shader model and ATi

    Hi,
    I work on two different systems. One with ATi card (3650) and one with Nvidia card (9800GTX+). Each one of the systems has the latest drivers for the graphics cards.
    When I apply a shader to a sprite and set the shader model to 3.0 the effect works perfect on the Nvidia card but not on the ATi. If i set the shader model to 2.0 then it works fine on both cards. Am I missing something? or it is a bug in ATi drivers. I tested this on Vista and XP Pro.
    Is there a workaround for this? I have to use shader model 3.0 because the shader is quite complex (and yes I have tested many ways of making it less complex :).
    Anyway I mention this in case someone else is having the same problem.
  • 1/9/2009 1:25 PM In reply to

    Re: Sprites, shader model and ATi

    Summon:
    When I apply a shader to a sprite and set the shader model to 3.0 the effect works perfect on the Nvidia card but not on the ATi.

    You might want to define the "[does not work] on the ATi" part, e.g. to give a hing on how it fails.

    We are boki. The rest is known.

    The not so known part of the rest: It is Björn or Bjoern, but never Bjorn.

    Twitter ~ Bnoerj ~ SharpSteer ~ SgtConker.com
  • 1/9/2009 1:48 PM In reply to

    Re: Sprites, shader model and ATi

    Bjoern Graf:

    Summon:
    When I apply a shader to a sprite and set the shader model to 3.0 the effect works perfect on the Nvidia card but not on the ATi.

    You might want to define the "[does not work] on the ATi" part, e.g. to give a hing on how it fails.



    I mean that there is nothing else in the viewport except blue color. And I think it is not the blue color that XNA has by default as the clearing color.
    There is a very simple way to reproduce the problem. (That's how I discovered the problem).
    1. Download this sample: http://creators.xna.com/assets/cms/docs/GameStudio3/SpritePixelShader_Sample.zip
    2. Execute it. You may receive an error message because the sample demands an XBOX connection but you can ignore it (select yes). You ll see the effect running ok.
    3. In the ripple.fx change the line PixelShader = compile ps_2_0 PixelShader(); to PixelShader = compile ps_3_0 PixelShader();
    4. Run again. Now you ll see a light blue screen.

    Bjoern thanks for replying.
  • 1/9/2009 3:41 PM In reply to

    Re: Sprites, shader model and ATi

    The DX Debug Runtime to the rescue: "Direct3D9: (ERROR) :ps_3_0 shader can only be used with vs_3_0+ shader (SWVP or HWVP), or transformed vertices." Makes you wonder why it works with a NVIDIA GPU but not an ATI one...
    We are boki. The rest is known.

    The not so known part of the rest: It is Björn or Bjoern, but never Bjorn.

    Twitter ~ Bnoerj ~ SharpSteer ~ SgtConker.com
  • 1/9/2009 3:47 PM In reply to

    Re: Sprites, shader model and ATi

    Bjoern Graf:
    The DX Debug Runtime to the rescue: "Direct3D9: (ERROR) :ps_3_0 shader can only be used with vs_3_0+ shader (SWVP or HWVP), or transformed vertices." Makes you wonder why it works with a NVIDIA GPU but not an ATI one...


    This happens all the time.  ATI and Nvidia will drivers will have varying levels of adherence to the D3D spec.  You can always bust out the reference rasterizer if you want to see who's right and who's wrong.
    Matt Pettineo | DirectX/XNA MVP


    Ride into The Danger Zone | PIX With XNA Tutorial
  • 1/9/2009 4:03 PM In reply to

    Re: Sprites, shader model and ATi

    MJP:
    This happens all the time.  ATI and Nvidia will drivers will have varying levels of adherence to the D3D spec.  You can always bust out the reference rasterizer if you want to see who's right and who's wrong.

    That is a bit tricky in this case: the reference driver accepts the PS3 shader just fine when using the Retail DX runtime. With the Debug DX runtime, the reference rasterizer fails, too. And as this seems to be a DX thing it looks like the NVIDIA driver (side note: I do not have any NVIDIA hardware around right now to test its behavior) does some internal voodoo to upgrade the VS to match the PS SM version...

    We are boki. The rest is known.

    The not so known part of the rest: It is Björn or Bjoern, but never Bjorn.

    Twitter ~ Bnoerj ~ SharpSteer ~ SgtConker.com
  • 1/9/2009 4:24 PM In reply to

    Re: Sprites, shader model and ATi

    Bjoern Graf:
    The DX Debug Runtime to the rescue: "Direct3D9: (ERROR) :ps_3_0 shader can only be used with vs_3_0+ shader (SWVP or HWVP), or transformed vertices." Makes you wonder why it works with a NVIDIA GPU but not an ATI one...


    Yes! I had forgotten this... You are absolutely right. I think in this case the point goes to ATi.
    Another thing to mention is that between shader model 2 and 3 there are ps_2_a and ps_2_b. So what I realized today is that all this time I did make of the very "powerful" ps_3_0 model or the very "weak" ps_2_0. Well the ps_2_b profile solves my initial problem because as it turned out my shader's complexity is above ps_2_0 but not above ps_2_b. :)
    Moreover I left out of the game the embedded XNA fxc compiler and I use the last fxc compiler that ships with the latest MS DirectX SDK to compile my fx files.

Page 1 of 1 (7 items) Previous Next