Image here
Since upgrading to a new computer, sky boxes are having visual glitches. This is happening both with the XNA samples (SkySphere, GeneratedGeometry) and another sky box sample I got from somewhere.
Basically the pixels aren't being drawn in "random" places, and the background shows through (I changed the backgroudn color to yellow in the SkySphere sample before taking the above screenshot). The spots aren't totally random though, they are predictable - if I come back around to the same orientation, I see the same spots in the same area.
This didn't happen on my old computer, nor does it happen on xbox. My drivers are up to date (GeForce 8500).
I tried setting the w and z output position in the vertex shader to constants and the problem goes away. This is the original shader:
void SkyboxVertexShader( float3 pos : POSITION0,
out float4 SkyPos : POSITION0,
out float3 SkyCoord : TEXCOORD0 )
{
// Calculate rotation. Using a float3 result, so translation is ignored
float3 rotatedPosition = mul(pos, ViewMatrix);
// Calculate projection, moving all vertices to the far clip plane
// (w and z both 1.0)
SkyPos = mul(float4(rotatedPosition, 1), ProjectionMatrix).xyww;
SkyCoord = pos;
};
Any idea what could be wrong? Might it have something to do with clipping planes?