From f9a41ce231ce453cddf8a8cfaca72ff7786f7e4f Mon Sep 17 00:00:00 2001 From: Caleb Cornett Date: Wed, 7 Feb 2024 10:09:48 -0600 Subject: [PATCH] Texture3D: Apply a slight offset to the fragment uniform to account for rounding errors --- Texture3D/Texture3DGame.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Texture3D/Texture3DGame.cs b/Texture3D/Texture3DGame.cs index 9a5f2d4..bd57e92 100644 --- a/Texture3D/Texture3DGame.cs +++ b/Texture3D/Texture3DGame.cs @@ -120,7 +120,7 @@ namespace MoonWorks.Test protected override void Draw(double alpha) { - FragUniform fragUniform = new FragUniform((float) currentDepth / texture.Depth); + FragUniform fragUniform = new FragUniform((float)currentDepth / texture.Depth + 0.01f); CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer(); Texture? backbuffer = cmdbuf.AcquireSwapchainTexture(MainWindow);