From 34c8bfb2f4a1815a8f5bab4e2bad58685a230d55 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 30 Sep 2020 20:04:04 -0400 Subject: [PATCH] gpu: use noperspective for hsl interpolation Prior to 8c00f6da8847f45b7dac4ba0537cf54a218762d2 the interpolation of fragment shader inputs appears to not have been accounting for perspective. This broke texturing due to the texture ids being interpolated for perspective which was fixed in 47e0ac8032ab165e60642583b8e2e20ff9056d1f. The hsl values similarly require not accounting for perspective, so the noperspective interpolation qualifier has been added. It is unclear to me why the geometry shader removal would affect the interpolation like this since it was emitting vertices with the correct z values. --- .../main/resources/net/runelite/client/plugins/gpu/frag.glsl | 2 +- .../main/resources/net/runelite/client/plugins/gpu/vert.glsl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 16818b98ef..54ddd3cfe6 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 @@ -31,7 +31,7 @@ uniform float smoothBanding; uniform vec4 fogColor; in vec4 Color; -centroid in float fHsl; +noperspective centroid in float fHsl; flat in int textureId; in vec2 fUv; in float fogAmount; 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 0f1a626259..613d95aa51 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 @@ -54,7 +54,7 @@ uniform int drawDistance; uniform mat4 projectionMatrix; out vec4 Color; -centroid out float fHsl; +noperspective centroid out float fHsl; flat out int textureId; out vec2 fUv; out float fogAmount;