diff --git a/shaders/lib/atmospherics/volumetricLight.glsl b/shaders/lib/atmospherics/volumetricLight.glsl index dad4885b..ca497e33 100644 --- a/shaders/lib/atmospherics/volumetricLight.glsl +++ b/shaders/lib/atmospherics/volumetricLight.glsl @@ -21,6 +21,7 @@ vec4 DistortShadow(vec4 shadowpos, float distortFactor) { vec4 GetVolumetricLight(inout float vlFactor, vec3 translucentMult, float lViewPos, vec3 nViewPos, float VdotL, float VdotU, vec2 texCoord, float z0, float z1, float dither) { if (max(blindness, darknessFactor) > 0.1) return vec4(0.0); vec4 volumetricLight = vec4(0.0); + vec3 vlColorReducer = vec3(1.0); #ifdef OVERWORLD vec3 vlColor = lightColor; @@ -33,10 +34,10 @@ vec4 GetVolumetricLight(inout float vlFactor, vec3 translucentMult, float lViewP vlMult = 0.6 + 0.4 * max0(far - lViewPos) / far; vlColor = normalize(pow(vlColor, vec3(1.0 - max0(1.0 - 1.5 * nightFactor)))); vlColor *= 0.0766 + 0.0766 * vsBrightness; + } else { + vlColorReducer = 1.0 / sqrt(vlColor); } - vec3 vlColorReducer = 1.0 / sqrt(vlColor); - float VdotLM = max((VdotL + 1.0) / 2.0, 0.0); float VdotUM = mix(pow2(1.0 - max(VdotU, 0.0)), 1.0, 0.5 * vlSceneIntensity); VdotUM = smoothstep1(VdotUM); diff --git a/shaders/lib/materials/materialHandling/terrainMaterials.glsl b/shaders/lib/materials/materialHandling/terrainMaterials.glsl index dff5077d..70a7070e 100644 --- a/shaders/lib/materials/materialHandling/terrainMaterials.glsl +++ b/shaders/lib/materials/materialHandling/terrainMaterials.glsl @@ -1436,23 +1436,24 @@ if (mat < 10512) { noSmoothLighting = true; lmCoordM.x = 0.77; - if (color.r < color.b) { // Lantern:Metal Part - #include "/lib/materials/specificMaterials/terrain/lanternMetal.glsl" - } else { // Lantern:Emissive Part - emission = pow2(color.g) * 5.0 + 1.0; + #include "/lib/materials/specificMaterials/terrain/lanternMetal.glsl" - color.gb *= vec2(0.8, 0.7); - } + emission = 3.0 * max0(color.r - color.b); + emission += min(pow2(pow2(0.75 * dot(color.rgb, color.rgb))), 5.0); + color.gb *= pow(vec2(0.8, 0.7), vec2(sqrt(emission) * 0.5)); + + #ifdef SNOWY_WORLD + snowFactor = 0.0; + #endif } else /*if (mat == 10564)*/ { // Soul Lantern noSmoothLighting = true; lmCoordM.x = min(lmCoordM.x, 0.77); // consistency748523 - if (min1(color.r * 3.0) >= color.g + 0.25) { // Soul Lantern:Metal Part - #include "/lib/materials/specificMaterials/terrain/lanternMetal.glsl" - } else { // Soul Lantern:Emissive Part - emission = color.r * 3.0 + 0.5; - } + #include "/lib/materials/specificMaterials/terrain/lanternMetal.glsl" + + emission = 0.9 * max0(color.g - color.r * 2.0); + emission += min(pow2(pow2(0.55 * dot(color.rgb, color.rgb))), 3.5); #ifdef SNOWY_WORLD snowFactor = 0.0; diff --git a/shaders/lib/materials/specificMaterials/terrain/lava.glsl b/shaders/lib/materials/specificMaterials/terrain/lava.glsl index cc0de183..1921a6a6 100644 --- a/shaders/lib/materials/specificMaterials/terrain/lava.glsl +++ b/shaders/lib/materials/specificMaterials/terrain/lava.glsl @@ -1,5 +1,12 @@ -// Tweak to revent the animation of lava causing brightness pulsing -color.rgb /= (max(GetLuminance(texture2DLod(texture, texCoord, 100.0).rgb) * 2.5, 0.001)); +// Tweak to prevent the animation of lava causing brightness pulsing +vec3 avgColor = vec3(0.0); +ivec2 itexCoordC = ivec2(midCoord * atlasSize + 0.0001); +for (int x = -8; x < 8; x += 2) { + for (int y = -8; y < 8; y += 2) { + avgColor += texelFetch(texture, itexCoordC + ivec2(x, y), 0).rgb; + } +} +color.rgb /= (max(GetLuminance(avgColor) * 0.0390625, 0.001)); #ifdef NETHER vec3 worldPos = playerPos + cameraPosition; diff --git a/shaders/lib/materials/specificMaterials/translucents/water.glsl b/shaders/lib/materials/specificMaterials/translucents/water.glsl index 0542d969..3289c05d 100644 --- a/shaders/lib/materials/specificMaterials/translucents/water.glsl +++ b/shaders/lib/materials/specificMaterials/translucents/water.glsl @@ -17,7 +17,7 @@ glColorM = sqrt1(glColorM) * vec3(1.0, 0.85, 0.8); #endif #define PHYSICS_OCEAN_INJECTION -#if defined GENERATED_NORMALS && WATER_STYLE >= 3 || defined PHYSICS_OCEAN +#if defined GENERATED_NORMALS && (WATER_STYLE >= 3 || defined PHYSICS_OCEAN) noGeneratedNormals = true; #endif diff --git a/shaders/program/gbuffers_terrain.glsl b/shaders/program/gbuffers_terrain.glsl index 0c4eefbd..aebdf913 100644 --- a/shaders/program/gbuffers_terrain.glsl +++ b/shaders/program/gbuffers_terrain.glsl @@ -14,6 +14,7 @@ in vec2 texCoord; in vec2 lmCoord; in vec2 signMidCoordPos; flat in vec2 absMidCoordPos; +flat in vec2 midCoord; flat in vec3 upVec, sunVec, northVec, eastVec; in vec3 normal; @@ -342,6 +343,7 @@ out vec2 texCoord; out vec2 lmCoord; out vec2 signMidCoordPos; flat out vec2 absMidCoordPos; +flat out vec2 midCoord; flat out vec3 upVec, sunVec, northVec, eastVec; out vec3 normal; @@ -400,7 +402,7 @@ void main() { northVec = normalize(gbufferModelView[2].xyz); sunVec = GetSunVector(); - vec2 midCoord = (gl_TextureMatrix[0] * mc_midTexCoord).st; + midCoord = (gl_TextureMatrix[0] * mc_midTexCoord).st; vec2 texMinMidCoord = texCoord - midCoord; signMidCoordPos = sign(texMinMidCoord); absMidCoordPos = abs(texMinMidCoord);