Skybox 中的奇怪线条

发布于 2024-10-03 04:02:44 字数 781 浏览 2 评论 0原文

我遇到了天空盒边缘出现可见线条的问题。

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;
}

I have a problem with visible lines appearing at the edges of the Skybox.

http://project-vanquish.co.cc/index.php <-- Shows the problem

Has anyone got any ideas as to why they are appearing? The textures don't have the white edge.

Rendering code block:

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;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜味拾荒者 2024-10-10 04:02:44

存储您的 SamplerState:

SamplerState samplerState = device.SamplerStates[0];

然后,将其设置为 AnisotropicClamp (或您的首选项):

device.SamplerStates[0] = SamplerState.AnisotropicClamp;

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

device.SamplerStates[0] = samplerState;

Store your SamplerState:

SamplerState samplerState = device.SamplerStates[0];

Then, set it to AnisotropicClamp (or your preference):

device.SamplerStates[0] = SamplerState.AnisotropicClamp;

then after the render, reset your setting:

device.SamplerStates[0] = samplerState;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文