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