diff --git a/gameforui.go b/gameforui.go index 10e390b2a..4137e803f 100644 --- a/gameforui.go +++ b/gameforui.go @@ -29,10 +29,9 @@ const screenShaderSrc = `//kage:unit pixels package main func Fragment(position vec4, texCoord vec2, color vec4) vec4 { - // Shift 1/512 [pixel] to avoid the tie-breaking issue. pos := texCoord - p0 := pos - 1/2.0 + 1/512.0 - p1 := pos + 1/2.0 + 1/512.0 + p0 := pos - 1/2.0 + p1 := pos + 1/2.0 // Texels must be in the source rect, so it is not necessary to check. c0 := imageSrc0UnsafeAt(p0) diff --git a/internal/builtinshader/shader.go b/internal/builtinshader/shader.go index 781b6242a..497089bfb 100644 --- a/internal/builtinshader/shader.go +++ b/internal/builtinshader/shader.go @@ -77,9 +77,8 @@ func Fragment(position vec4, texCoord vec2, color vec4) vec4 { clr := imageSrc0At(adjustTexelForAddressRepeat(texCoord)) {{end}} {{else if eq .Filter .FilterLinear}} - // Shift 1/512 [pixel] to avoid the tie-breaking issue (#1212). - p0 := texCoord - 1/2.0 + 1/512.0 - p1 := texCoord + 1/2.0 + 1/512.0 + p0 := texCoord - 1/2.0 + p1 := texCoord + 1/2.0 {{if eq .Address .AddressRepeat}} p0 = adjustTexelForAddressRepeat(p0)