From 2b2648e7a58e46a88fde3e6a2a9ff803f4896345 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 17 Feb 2019 08:01:37 +0100 Subject: [PATCH] glsl: fix heightmap orientation, black is low and white is high there is only one heightmap standard: black is low and white is high xreal was doing white is low and black is high for heightmap in alpha channel of normal map but was doing black is low and white is high for heightmap in loose file which does not make sense in any way daemon seems to have been forked before the addition of shader keywords to support heightmap loose file so only heightmap in alpha channel is supported at this point --- src/engine/renderer/glsl_source/forwardLighting_fp.glsl | 2 +- src/engine/renderer/glsl_source/lightMapping_fp.glsl | 2 +- src/engine/renderer/glsl_source/liquid_fp.glsl | 4 ++-- .../renderer/glsl_source/vertexLighting_DBS_entity_fp.glsl | 2 +- .../renderer/glsl_source/vertexLighting_DBS_world_fp.glsl | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/renderer/glsl_source/forwardLighting_fp.glsl b/src/engine/renderer/glsl_source/forwardLighting_fp.glsl index 975efee42c..82b33b47fb 100644 --- a/src/engine/renderer/glsl_source/forwardLighting_fp.glsl +++ b/src/engine/renderer/glsl_source/forwardLighting_fp.glsl @@ -965,7 +965,7 @@ void main() Vts = normalize(Vts); // size and start position of search in texture space - vec2 S = Vts.xy * -u_DepthScale / Vts.z; + vec2 S = Vts.xy * u_DepthScale / Vts.z; float depth = RayIntersectDisplaceMap(texNormal, S, u_NormalMap); diff --git a/src/engine/renderer/glsl_source/lightMapping_fp.glsl b/src/engine/renderer/glsl_source/lightMapping_fp.glsl index 34543ea22f..62677f0c8e 100644 --- a/src/engine/renderer/glsl_source/lightMapping_fp.glsl +++ b/src/engine/renderer/glsl_source/lightMapping_fp.glsl @@ -63,7 +63,7 @@ void main() V = normalize(V); // size and start position of search in texture space - vec2 S = V.xy * -u_DepthScale / V.z; + vec2 S = V.xy * u_DepthScale / V.z; #if 0 vec2 texOffset = vec2(0.0); diff --git a/src/engine/renderer/glsl_source/liquid_fp.glsl b/src/engine/renderer/glsl_source/liquid_fp.glsl index 5453c0ecb3..485a5af842 100644 --- a/src/engine/renderer/glsl_source/liquid_fp.glsl +++ b/src/engine/renderer/glsl_source/liquid_fp.glsl @@ -155,8 +155,8 @@ void main() // ray intersect in view direction // size and start position of search in texture space - //vec2 S = V.xy * -u_DepthScale / V.z; - vec2 S = V.xy * -0.03 / V.z; + //vec2 S = V.xy * u_DepthScale / V.z; + vec2 S = V.xy * 0.03 / V.z; float depth = RayIntersectDisplaceMap(texNormal, S); diff --git a/src/engine/renderer/glsl_source/vertexLighting_DBS_entity_fp.glsl b/src/engine/renderer/glsl_source/vertexLighting_DBS_entity_fp.glsl index 51924a78eb..2ecd66b4db 100644 --- a/src/engine/renderer/glsl_source/vertexLighting_DBS_entity_fp.glsl +++ b/src/engine/renderer/glsl_source/vertexLighting_DBS_entity_fp.glsl @@ -100,7 +100,7 @@ void main() Vts = normalize(Vts); // size and start position of search in texture space - vec2 S = Vts.xy * -u_DepthScale / Vts.z; + vec2 S = Vts.xy * u_DepthScale / Vts.z; #if 0 vec2 texOffset = vec2(0.0); diff --git a/src/engine/renderer/glsl_source/vertexLighting_DBS_world_fp.glsl b/src/engine/renderer/glsl_source/vertexLighting_DBS_world_fp.glsl index 5fbd71f6cf..a3a8942b95 100644 --- a/src/engine/renderer/glsl_source/vertexLighting_DBS_world_fp.glsl +++ b/src/engine/renderer/glsl_source/vertexLighting_DBS_world_fp.glsl @@ -94,7 +94,7 @@ void main() Vts = normalize(Vts); // size and start position of search in texture space - vec2 S = Vts.xy * -u_DepthScale / Vts.z; + vec2 S = Vts.xy * u_DepthScale / Vts.z; #if 0 vec2 texOffset = vec2(0.0);