Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion shader/main3d.frag.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions shader/utils.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

Expand All @@ -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);
}