I need your help to explain something to me:
I am using XNA studio and C#.
I have a very simple shader that does very simple diffuse lighting (per pixel).
It works perfectly when I have multi-sampling disabled.
The problem is that if enable multi-sampling I get sparkling atrifacts (at Polygon edges I suspect).
Here is a screenshot of the problem with a zoomed in view using Pix.
If in Pix I accept to disable multi sampling to debug the pixels, the artifacts disappear as well.
And even if I tell Pix to keep multi-sampling and click on a white sparkle pixel to debug it, it shows as black and value of it's color in pixel shader is 0.
The Shader source is extremely simple:
I have a cube and a sphere as well, they exhibit no sparkling at all ...
The models come from Blender.
I can't really understand how this has to do with enabling/disabling multi-sampling...
Can you help explain it?
Thank you...
I am using XNA studio and C#.
I have a very simple shader that does very simple diffuse lighting (per pixel).
It works perfectly when I have multi-sampling disabled.
Code:
graphics = new GraphicsDeviceManager(this);
graphics.PreferMultiSampling = false;
The problem is that if enable multi-sampling I get sparkling atrifacts (at Polygon edges I suspect).
Here is a screenshot of the problem with a zoomed in view using Pix.
If in Pix I accept to disable multi sampling to debug the pixels, the artifacts disappear as well.
And even if I tell Pix to keep multi-sampling and click on a white sparkle pixel to debug it, it shows as black and value of it's color in pixel shader is 0.
The Shader source is extremely simple:
Code:
VSO_Diffuse VS_Diffuse(VSI_Diffuse input)
{
VSO_Diffuse output;
output.position = mul(input.position, WvpXf);
float4 worldPos = mul(input.position, WXf);
output.N = mul(input.normal, WXf);
output.L = normalize(LightPos.xyz - worldPos.xyz);
return output;
}
PSO_Diffuse PS_Diffuse(VSO_Diffuse input)
{
PSO_Diffuse output;
float kd = saturate(dot(input.N, input.L));
output.color = /*Ambient +*/ float4(kd * Diffuse.xyz, 1);
return output;
}
I have a cube and a sphere as well, they exhibit no sparkling at all ...
The models come from Blender.
I can't really understand how this has to do with enabling/disabling multi-sampling...
Can you help explain it?
Thank you...