diff --git a/shader/main3d.frag.glsl b/shader/main3d.frag.glsl index d48b1de..45e4e74 100644 --- a/shader/main3d.frag.glsl +++ b/shader/main3d.frag.glsl @@ -28,7 +28,6 @@ vec4 sampleSampler(in const sampler2D tex, in const TileConf tileConf, in vec2 u // https://github.com/rt64/rt64/blob/61aa08f517cd16c1dbee4e097768b08e2a060307/src/shaders/TextureSampler.hlsli#L156-L276 const ivec2 texSize = textureSize(tex, 0); - uvCoord.y = texSize.y - uvCoord.y; // invert Y uvCoord *= tileConf.shift; #ifdef SIMULATE_LOW_PRECISION diff --git a/shader/utils.glsl b/shader/utils.glsl index 8a361d8..74a5c74 100644 --- a/shader/utils.glsl +++ b/shader/utils.glsl @@ -38,7 +38,7 @@ float noise(in vec2 uv) vec2 mirrorUV(const vec2 uvIn, const vec2 uvBound) { - vec2 uvMod2 = mod(uvIn, uvBound * 2.0); + vec2 uvMod2 = mod(uvIn, uvBound * 2.0 + 1.0); return mix(uvMod2, (uvBound * 2.0) - uvMod2, step(uvBound, uvMod2)); } @@ -57,7 +57,5 @@ vec4 wrappedMirrorSample(const sampler2D tex, vec2 uv, const vec2 mask, const ve // clamp again (mask S/T), this is also done to avoid OOB texture access uv = mod(uv, min(texSize, mask)); - uv.y = texSize.y - uv.y - 1; // invert Y back - return texelFetch(tex, ivec2(floor(uv)), 0); }