From bd93c29c5b2924f9c776dd4cd0783badbc26d345 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Wed, 17 Jun 2026 13:21:51 +0200 Subject: [PATCH] Fix Global Surface Atlas sampling sub-texel error --- Source/Shaders/GI/GlobalSurfaceAtlas.hlsl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Shaders/GI/GlobalSurfaceAtlas.hlsl b/Source/Shaders/GI/GlobalSurfaceAtlas.hlsl index 86cf114ae..26eeb875e 100644 --- a/Source/Shaders/GI/GlobalSurfaceAtlas.hlsl +++ b/Source/Shaders/GI/GlobalSurfaceAtlas.hlsl @@ -145,7 +145,8 @@ float4 SampleGlobalSurfaceAtlasTile(const GlobalSurfaceAtlasData data, GlobalSur float2 atlasUV = tileUV * tile.AtlasRectUV.zw + tile.AtlasRectUV.xy; // Calculate bilinear weights - float2 bilinearWeightsUV = frac(atlasUV * data.Resolution + 0.5f); + float texelPrecisionOffset = 1.0f / 512.0f; // https://www.reedbeta.com/blog/texture-gathers-and-coordinate-precision/ + float2 bilinearWeightsUV = frac(atlasUV * data.Resolution + 0.5f + texelPrecisionOffset); float4 bilinearWeights; bilinearWeights.x = (1 - bilinearWeightsUV.x) * (bilinearWeightsUV.y); bilinearWeights.y = (bilinearWeightsUV.x) * (bilinearWeightsUV.y);