Skybox中的奇怪线条

时间:2010-11-17 16:52:38

标签: xna xna-4.0

我遇到Skybox边缘出现可见线条的问题。

http://project-vanquish.co.cc/index.php< - 显示问题

有没有人对他们出现的原因有任何想法?纹理没有白边。

渲染代码块:

public override void Render(GraphicsDevice device)
{
    device.DepthStencilState = DepthStencilState.None;
    for (int i = 0; i < 6; i++)
    {
        this.sides[i].Position = CameraManager.ActiveCamera.Position + this.offsets[i];
        EffectManager.ActiveShader.SetParameters(this.sides[i]);

        foreach (EffectPass pass in EffectManager.ActiveShader.Effect.CurrentTechnique.Passes)
        {
            pass.Apply();
            this.sides[i].Render(device);
        }
    }

    device.DepthStencilState = DepthStencilState.Default;
}

1 个答案:

答案 0 :(得分:4)

存储您的SamplerState:

SamplerState samplerState = device.SamplerStates[0];

然后,将其设置为AnisotropicClamp(或您的偏好):

device.SamplerStates[0] = SamplerState.AnisotropicClamp;

然后在渲染后重置您的设置:

device.SamplerStates[0] = samplerState;