Skip to content

Commit 7750781

Browse files
committed
fix parallax 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
1 parent be89425 commit 7750781

5 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/engine/renderer/glsl_source/forwardLighting_fp.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ void main()
965965
Vts = normalize(Vts);
966966

967967
// size and start position of search in texture space
968-
vec2 S = Vts.xy * -u_DepthScale / Vts.z;
968+
vec2 S = Vts.xy * u_DepthScale / Vts.z;
969969

970970
float depth = RayIntersectDisplaceMap(texNormal, S, u_NormalMap);
971971

src/engine/renderer/glsl_source/lightMapping_fp.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ void main()
6363
V = normalize(V);
6464

6565
// size and start position of search in texture space
66-
vec2 S = V.xy * -u_DepthScale / V.z;
66+
vec2 S = V.xy * u_DepthScale / V.z;
6767

6868
#if 0
6969
vec2 texOffset = vec2(0.0);

src/engine/renderer/glsl_source/liquid_fp.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ void main()
155155
// ray intersect in view direction
156156

157157
// size and start position of search in texture space
158-
//vec2 S = V.xy * -u_DepthScale / V.z;
159-
vec2 S = V.xy * -0.03 / V.z;
158+
//vec2 S = V.xy * u_DepthScale / V.z;
159+
vec2 S = V.xy * 0.03 / V.z;
160160

161161
float depth = RayIntersectDisplaceMap(texNormal, S);
162162

src/engine/renderer/glsl_source/vertexLighting_DBS_entity_fp.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void main()
100100
Vts = normalize(Vts);
101101

102102
// size and start position of search in texture space
103-
vec2 S = Vts.xy * -u_DepthScale / Vts.z;
103+
vec2 S = Vts.xy * u_DepthScale / Vts.z;
104104

105105
#if 0
106106
vec2 texOffset = vec2(0.0);

src/engine/renderer/glsl_source/vertexLighting_DBS_world_fp.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void main()
9494
Vts = normalize(Vts);
9595

9696
// size and start position of search in texture space
97-
vec2 S = Vts.xy * -u_DepthScale / Vts.z;
97+
vec2 S = Vts.xy * u_DepthScale / Vts.z;
9898

9999
#if 0
100100
vec2 texOffset = vec2(0.0);

0 commit comments

Comments
 (0)