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

Graphical problems on Ati cards

Last post 7/2/2008 9:18 AM by kuzanth. 5 replies.
  • 6/3/2008 10:33 AM

    Graphical problems on Ati cards

    Hi!

    Since i have been using XNA, i've always encountered graphical problems when i try to run my code on Ati cards.
    Pls take a look at this picture i upload (dont comment the models, pls...im just a single programmer :D):
    NVidia vs Ati

    It shows the difference between my 8800gts and Ati Xpress 1150, when im running a normalmapping program. I've tried this with 6600GT, Radeon 9800Pro, Radeon X600 too, but Ati has always this kind of graphical artifact, and nvidia works fine.

    What am i doing wrong? Is there some effect code that Ati cant compile, or compile wrong? I've tried many DX versoins in the last two years with many catalyst version, but Ati failed in every cases. I've also tried to google this problem (like im also doing it while im writing this post), but i couldnt find any solution.

    Many thx in advance!

  • 6/3/2008 1:17 PM In reply to

    Re: Graphical problems on Ati cards

    How are you rendering? Custom Shader or Basic Effect.
    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 6/3/2008 1:41 PM In reply to

    Re: Graphical problems on Ati cards

    I dont use basiceffect (only at my new lens flare section, but that is a new feature in my engine, so it will change in the near future), only custom shaders, because im using shadows as well combined with normalmapping. In the meanwhile i downloaded another normalmapping program from here, and the result is the same glitch. I havent made any changes in that .fx yet!
  • 6/3/2008 1:44 PM In reply to

    Re: Graphical problems on Ati cards

    It could well be that your shader is assuming some behaviour, render state or something that is undefined... atis do one thing Nvidias do the other

    The only way to debug this is to use PIX. Take a frame grab using Pix and then use debug this pixel to work out why those pixels are going white on the ati machine.

    Of course you should always make sure your driver is up to date.

    Play Kissy Poo - a game for 4 year olds on Xbox and windows
    The ZBuffer
    News and information for XNA
      Follow The Zman on twitter, Email me
        Please read the forum FAQs - Bug/Feature reporting
          Don't forget to mark good answers and good playtest feedback when you see it!!!
  • 6/13/2008 1:30 PM In reply to

    Re: Graphical problems on Ati cards

    I couldnt try PIX yet, but i created a small test application, with 1 model from SkinningSample and i use the normalmapping effect from NormalMappingEffectSample. I havent made any changes in the .fx file, only 1-2 variables' name and :

    VertexShader = compile vs_2_0 VertexShader();
    PixelShader = compile ps_2_0 PixelShader();

    and i use the textures for the model that was added in the SkinningSample project. When i build the NormalMappingEffectSample, the lizard model looks that it should be (so this PC is fuly compatible with xna), and with my home PC (with nvidia 8800gts) also works fine. But in my test (or any other selfmade) application, the graphical result on Ati cards is far from the suspected. The Draw function is the following (as simple as it can be for a test application) :

           protected override void Draw(GameTime gameTime) 
            { 
                WorldMatrix *= Matrix.CreateRotationY(0.01f); 
     
                graphics.GraphicsDevice.Clear( 
                        ClearOptions.Target | ClearOptions.DepthBuffer, 
                        Color.Black, 1.0f, 0); 
                graphics.GraphicsDevice.RenderState.CullMode = 
                        CullMode.CullCounterClockwiseFace; 
     
                int i = 0; 
                foreach (ModelMesh modmesh in myModel.Meshes) 
                { 
                    foreach (Effect currenteffect in modmesh.Effects) 
                    {                     
                        currenteffect.Parameters["World"].SetValue(WorldMatrix); 
                        currenteffect.Parameters["View"].SetValue(View); 
                        currenteffect.Parameters["Projection"].SetValue(Projection); 
                        currenteffect.Parameters["LightPosition"].SetValue(new Vector4(10.0f, 20.0f, 0.0f, 1.0f)); 
                        currenteffect.Parameters["LightColor"].SetValue(new Vector4(0.6f, 0.6f, 0.6f, 1.0f)); 
                        currenteffect.Parameters["AmbientLightColor"].SetValue(new Vector4(0.1f, 0.1f, 0.1f, 1.0f)); 
                        currenteffect.Parameters["Shininess"].SetValue(2.5f); 
                        currenteffect.Parameters["SpecularPower"].SetValue(4.0f); 
     
                        currenteffect.Parameters["meshtexturediff"].SetValue(texList[i]); 
                        i++; 
                        currenteffect.Parameters["meshtexture1nm"].SetValue(texList[i]); 
                        i++; 
     
                        currenteffect.CurrentTechnique = currenteffect.Techniques["NormalMapping2"]; 
                        currenteffect.CommitChanges();
                    }

                    modmesh.Draw();
                }

                base.Draw(gameTime); 
            } 

     

     Maybe the initialization code is wrong?

            protected override void Initialize() 
            {             
                graphics.PreferredBackBufferFormat = SurfaceFormat.Color; 
     
                graphics.PreferredBackBufferWidth = 1024; 
                graphics.PreferredBackBufferHeight = 768; 
                graphics.MinimumPixelShaderProfile = ShaderProfile.PS_2_0; 
                graphics.MinimumVertexShaderProfile = ShaderProfile.VS_2_0; 
     
                graphics.ApplyChanges(); 
                 
                base.Initialize();             
            } 

    Or may i missed to set something? Im completely lost... :(

  • 7/2/2008 9:18 AM In reply to

    Re: Graphical problems on Ati cards

    In the meantime i have asked around about this problem, and one of my friend asked if i initialize/set every variables well (after taking a look on my effect code). He suggested to take care of this :

     

    struct VS_INPUT 
       float4 position : POSITION0; 
       float2 texCoord : TEXCOORD0; 
       float3 normal : NORMAL0; 
       float3 binormal : BINORMAL0; 
       float3 tangent : TANGENT0; 
    }; 

    He thinks that NVidia cards initialize variables in other way than Ati cards. He said maybe they use default values and Ati doesnt.

    So my question is how can i be sure if 'normal', 'binormal' and 'tangent' are set, and if they are not set, how can i set them (are these informations in .fbx or shall i compute them in the code)?

Page 1 of 1 (6 items) Previous Next