diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/frag.glsl b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/frag.glsl index 646d5dfd7d..16818b98ef 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/frag.glsl +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/frag.glsl @@ -32,7 +32,8 @@ uniform vec4 fogColor; in vec4 Color; centroid in float fHsl; -in vec4 fUv; +flat in int textureId; +in vec2 fUv; in float fogAmount; out vec4 FragColor; @@ -40,20 +41,17 @@ out vec4 FragColor; #include hsl_to_rgb.glsl void main() { - float n = fUv.x; - int hsl = int(fHsl); vec3 rgb = hslToRgb(hsl) * smoothBanding + Color.rgb * (1.f - smoothBanding); vec4 smoothColor = vec4(rgb, Color.a); - if (n > 0.0) { - n -= 1.0; - int textureIdx = int(n); + if (textureId > 0) { + int textureIdx = textureId - 1; - vec2 uv = fUv.yz; + vec2 uv = fUv; vec2 animatedUv = uv + textureOffsets[textureIdx]; - vec4 textureColor = texture(textures, vec3(animatedUv, n)); + vec4 textureColor = texture(textures, vec3(animatedUv, float(textureIdx))); vec4 textureColorBrightness = pow(textureColor, vec4(brightness, brightness, brightness, 1.0f)); smoothColor = textureColorBrightness * smoothColor; diff --git a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/vert.glsl b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/vert.glsl index ef2080d8d7..0f1a626259 100644 --- a/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/vert.glsl +++ b/runelite-client/src/main/resources/net/runelite/client/plugins/gpu/vert.glsl @@ -55,7 +55,8 @@ uniform mat4 projectionMatrix; out vec4 Color; centroid out float fHsl; -out vec4 fUv; +flat out int textureId; +out vec2 fUv; out float fogAmount; #include hsl_to_rgb.glsl @@ -76,7 +77,8 @@ void main() gl_Position = projectionMatrix * vec4(vertex, 1.f); Color = vec4(rgb, 1.f - a); fHsl = float(hsl); - fUv = uv; + textureId = int(uv.x); + fUv = uv.yz; int fogWest = max(FOG_SCENE_EDGE_MIN, cameraX - drawDistance); int fogEast = min(FOG_SCENE_EDGE_MAX, cameraX + drawDistance - TILE_SIZE);