From 12eff7e9fbf6aefa4692745fd2706e980a2ff6e1 Mon Sep 17 00:00:00 2001 From: Merlin1809 <88194861+Merlin1809@users.noreply.github.com> Date: Sun, 16 Nov 2025 19:21:42 +0100 Subject: [PATCH] fix compile error --- shaders/dimensions/composite1.fsh | 19 ++++++++++--------- shaders/lib/volumetricClouds.glsl | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index 0cc51e5..74df124 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -1094,6 +1094,8 @@ void main() { vec3 feetPlayerPos = mat3(gbufferModelViewInverse) * viewPos; vec3 feetPlayerPos_normalized = normalize(feetPlayerPos); + vec3 worldPos = feetPlayerPos + cameraPosition; + #ifdef POM #ifdef Horrible_slope_normals vec3 ApproximatedFlatNormal = normalize(cross(dFdx(feetPlayerPos), dFdy(feetPlayerPos))); // it uses depth that has POM written to it. @@ -1102,7 +1104,7 @@ void main() { #endif #if defined END_SHADER && defined END_ISLAND_LIGHT - vec3 WsunVec = normalize(END_LIGHT_POS-(feetPlayerPos+cameraPosition)); + vec3 WsunVec = normalize(END_LIGHT_POS-worldPos); #endif ////// --------------- COLORS --------------- ////// @@ -1208,7 +1210,7 @@ void main() { estimatedDepth = 1.0; // viewerWaterDepth = max(0.9-lightmap.y,0.0)*3.0; - float distanceFromWaterSurface = -(feetPlayerPos.y + (cameraPosition.y - waterEnteredAltitude));//max(-(feetPlayerPos.y + (cameraPosition.y - waterEnteredAltitude)),0.0) ; + float distanceFromWaterSurface = -(worldPos.y - waterEnteredAltitude);//max(-(feetPlayerPos.y + (cameraPosition.y - waterEnteredAltitude)),0.0) ; percievedWaterDepth = distanceFromWaterSurface; @@ -1227,7 +1229,6 @@ void main() { if( nightVision > 0.0 ) Absorbtion += exp(-totEpsilon * 25.0) * nightVision; - vec3 pos = feetPlayerPos + cameraPosition; // vec2 causticPos = pos.xz; // causticPos = mix(causticPos, pos.xz, max(FlatNormals.y,0)); // causticPos = mix(causticPos, pos.xy, max(-FlatNormals.y,0)); @@ -1237,7 +1238,7 @@ void main() { // causticPos = mix(causticPos, pos.xy, max(-FlatNormals.x,0)); // apply caustics to the lighting, and make sure they dont look weird - DirectLightColor *= pow(mix(1.0, waterCaustics(pos, WsunVec, percievedWaterDepth)*WATER_CAUSTICS_BRIGHTNESS, clamp(estimatedDepth,0,1)), WATER_CAUSTICS_POWER); + DirectLightColor *= pow(mix(1.0, waterCaustics(worldPos, WsunVec, percievedWaterDepth)*WATER_CAUSTICS_BRIGHTNESS, clamp(estimatedDepth,0,1)), WATER_CAUSTICS_POWER); } @@ -1391,7 +1392,7 @@ void main() { #endif #ifndef END_SHADER - float cloudShadows = GetCloudShadow(feetPlayerPos.xyz + cameraPosition, WsunVec); + float cloudShadows = GetCloudShadow(worldPos, WsunVec); shadowColor *= cloudShadows; SSSColor *= cloudShadow*cloudShadows; #endif @@ -1400,12 +1401,12 @@ void main() { #ifdef END_SHADER #ifdef END_LIGHTNING - float vortexBounds = clamp(vortexBoundRange - length(feetPlayerPos+cameraPosition), 0.0,1.0); + float vortexBounds = clamp(vortexBoundRange - length(worldPos), 0.0,1.0); #else float vortexBounds = 1.0; #endif - vec3 lightPos = LightSourcePosition(feetPlayerPos+cameraPosition, cameraPosition,vortexBounds); + vec3 lightPos = LightSourcePosition(worldPos, cameraPosition,vortexBounds); float lightningflash = texelFetch2D(colortex4,ivec2(1,1),0).x/150.0; vec3 lightColors = pow(lightmap.y,8) * LightSourceColors(vortexBounds, lightningflash); @@ -1413,7 +1414,7 @@ void main() { float end_NdotL = clamp(dot(slopednormal, normalize(-lightPos))*0.5+0.5,0.0,1.0); end_NdotL *= end_NdotL; - float fogShadow = GetEndFogShadow(feetPlayerPos+cameraPosition, lightPos); + float fogShadow = GetEndFogShadow(worldPos, lightPos); float endPhase = endFogPhase(lightPos); Direct_lighting += lightColors * endPhase * end_NdotL * fogShadow; @@ -1594,7 +1595,7 @@ void main() { #endif #if defined OVERWORLD_SHADER && defined DEFERRED_SPECULAR && (PUDDLE_MODE > 0 || ShaderSnow > 0) - if(!hand && !entities && (wetnessAmount > 0.01 || snowAmount > 0.01)) applyPuddles(feetPlayerPos + cameraPosition, FlatNormals, lightmap.y, isWater, eyeInWater, albedo, normal, SpecularTex.r, SpecularTex.g, isShaderGrass); + if(!hand && !entities) applyPuddles(worldPos, FlatNormals, lightmap.y, isWater, eyeInWater, albedo, normal, SpecularTex.r, SpecularTex.g, isShaderGrass); #endif vec3 FINAL_COLOR = (Indirect_lighting + Direct_lighting) * albedo; diff --git a/shaders/lib/volumetricClouds.glsl b/shaders/lib/volumetricClouds.glsl index d48ad3a..8b39bd3 100644 --- a/shaders/lib/volumetricClouds.glsl +++ b/shaders/lib/volumetricClouds.glsl @@ -50,9 +50,9 @@ float lightningFlash = mix(0.1, 2.5, randomSeed); #endif #if defined DISTANT_HORIZONS || defined VOXY - const float distanceFogScale = -min((1.66/dhVoxyRenderDistance), 0.0006); + float distanceFogScale = -min((1.66/dhVoxyRenderDistance), 0.0006); #else - const float distanceFogScale = -min((1.66/far), 0.0006); + float distanceFogScale = -min((1.66/far), 0.0006); #endif float rand(float co){