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

Issue with SkySphere sample - visual glitch

Last post 04-21-2008 2:35 PM by Byron Nelson. 7 replies.
  • 04-09-2008 12:34 PM

    Issue with SkySphere sample - visual glitch

    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?

  • 04-09-2008 10:47 PM In reply to

    Re: Issue with SkySphere sample - visual glitch

    Well I guess it totally has to do with clipping planes.  I fixed it by subtracting a small value from z. 

        SkyPos = mul(float4(rotatedPosition, 1), ProjectionMatrix).xyww;  
    SkyPos.z -= 0.0001;
    SkyCoord = pos;
    Flakey graphics cards!
  • 04-10-2008 4:45 AM In reply to

    Re: Issue with SkySphere sample - visual glitch

    Interesting.  I've been getting the same problem lately.  It started occurring when I got a new monitor to plug into my laptop.  I had just assumed it was a monitor issue as I'd never seen it before.  Perhaps running my Nvidia card at a higher resolution exposed the same flake as you are observing.  I'm happy you posted your solution.

    Best,

    Byron

    ..shaders make you feel... powerful, or very very stupid.
    http://drjbn.spaces.live.com/
  • 04-10-2008 12:41 PM In reply to

    Re: Issue with SkySphere sample - visual glitch

    That's really strange.

    What happens if you change this line in the Generated Geometry sample sky.fx shader:

        output.Position.z = output.Position.w;

    to:

        output.Position.xy /= output.Position.w;
        output.Position.zw = 1;

    ?
    XNA Framework Developer - blog - homepage
  • 04-10-2008 10:26 PM In reply to

    Re: Issue with SkySphere sample - visual glitch

    Shawn Hargreaves:
    That's really strange.

    What happens if you change this line in the Generated Geometry sample sky.fx shader:

        output.Position.z = output.Position.w;

    to:

        output.Position.xy /= output.Position.w;
        output.Position.zw = 1;

    ?

    Not so good.  Looks like

    In the Generated Geometry sample (w/o changes), the glitch shows up as occasional vertical black lines of varying thickness.

     

  • 04-20-2008 12:15 AM In reply to

    Re: Issue with SkySphere sample - visual glitch

    I just wanted to chime in and mention that I am experiencing this issue as well.  Currently I'm running an 8800GT, latest drivers etc.
  • 04-21-2008 1:34 PM In reply to

    Re: Issue with SkySphere sample - visual glitch

    Thanks for the report - I've filed a bug for us to take a look at what's going on here.
    XNA Framework Developer - blog - homepage
  • 04-21-2008 2:35 PM In reply to

    Re: Issue with SkySphere sample - visual glitch

    Just for informatin, the glitches I was getting were almost identical in shape/form and size (relative to overall screen size) to the initial picture phil posted
    ..shaders make you feel... powerful, or very very stupid.
    http://drjbn.spaces.live.com/
Page 1 of 1 (8 items) Previous Next