From 8f7f385060a560244607ff12fb808b56a6e21fdf Mon Sep 17 00:00:00 2001 From: YoGoUrT <91050199+YoGoUrT20@users.noreply.github.com> Date: Thu, 12 Mar 2026 23:53:44 +0100 Subject: [PATCH 01/10] add: color mixing --- shaders/dimensions/shadowcomp.csh | 48 ++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/shaders/dimensions/shadowcomp.csh b/shaders/dimensions/shadowcomp.csh index b7960c29..fbbbedad 100644 --- a/shaders/dimensions/shadowcomp.csh +++ b/shaders/dimensions/shadowcomp.csh @@ -147,9 +147,55 @@ void main() { } // Mix neighbor voxel light values + + // Apply glass tint color mixing via RYB hue blending (order-independent, no dimming) if (any(greaterThan(tintColor, vec3(0.0)))) { vec4 lightMixed = mixNeighbours(ivec3(gl_LocalInvocationID), mixMask); - lightMixed.rgb *= tintColor; + + float maxTint = max(max(tintColor.r, tintColor.g), tintColor.b); + float minTint = min(min(tintColor.r, tintColor.g), tintColor.b); + // Only apply hue mixing for chromatic (non-gray) glass + if (maxTint - minTint > 0.01) { + vec3 normalizedTint = tintColor / maxTint; + float peakBefore = max(max(lightMixed.r, lightMixed.g), lightMixed.b); + + if (peakBefore > 1e-6) { + vec3 lightHsv = RgbToHsv(lightMixed.rgb); + vec3 tintHsv = RgbToHsv(normalizedTint); + + // Remap RGB hue → RYB hue for intuitive subtractive mixing (e.g. blue+yellow=green) + // Piecewise linear: stretches red-yellow, compresses green-blue + float lightRybH = lightHsv.x < (1.0/6.0) ? lightHsv.x * 2.0 : + lightHsv.x < (1.0/3.0) ? (1.0/3.0) + (lightHsv.x - (1.0/6.0)) : + lightHsv.x < (2.0/3.0) ? 0.5 + (lightHsv.x - (1.0/3.0)) * 0.5 : + lightHsv.x; + float tintRybH = tintHsv.x < (1.0/6.0) ? tintHsv.x * 2.0 : + tintHsv.x < (1.0/3.0) ? (1.0/3.0) + (tintHsv.x - (1.0/6.0)) : + tintHsv.x < (2.0/3.0) ? 0.5 + (tintHsv.x - (1.0/3.0)) * 0.5 : + tintHsv.x; + + // Circular weighted mean in RYB hue space for order-independent blending + // Light weight ramps from 0→1 via smoothstep so torch light (low sat) defers to glass, + // while already-tinted light (high sat) gets equal weight for symmetric midpoint mixing + float lw = smoothstep(0.0, 0.5, lightHsv.y); + float tw = 1.0; + float cx = lw * cos(lightRybH * 6.2831853) + tw * cos(tintRybH * 6.2831853); + float cy = lw * sin(lightRybH * 6.2831853) + tw * sin(tintRybH * 6.2831853); + float newRybH = (abs(cx) + abs(cy) > 1e-6) ? fract(atan(cy, cx) / 6.2831853) : tintRybH; + + // Inverse map: RYB hue → RGB hue + lightHsv.x = newRybH < (1.0/3.0) ? newRybH * 0.5 : + newRybH < 0.5 ? (1.0/6.0) + (newRybH - (1.0/3.0)) : + newRybH < (2.0/3.0) ? (1.0/3.0) + (newRybH - 0.5) * 2.0 : + newRybH; + + // Keep whichever saturation is higher so colors stay vibrant through multiple panes + lightHsv.y = max(lightHsv.y, tintHsv.y); + + lightMixed.rgb = HsvToRgb(lightHsv); + } + } + lightValue += lightMixed; } From 2bec2c1f0e6b82e77bf38f9f3a26f4b38be21995 Mon Sep 17 00:00:00 2001 From: YoGoUrT <91050199+YoGoUrT20@users.noreply.github.com> Date: Fri, 13 Mar 2026 00:23:29 +0100 Subject: [PATCH 02/10] Add: dimmer light on more glass & add tint --- shaders/dimensions/shadowcomp.csh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/shaders/dimensions/shadowcomp.csh b/shaders/dimensions/shadowcomp.csh index fbbbedad..f6a997cf 100644 --- a/shaders/dimensions/shadowcomp.csh +++ b/shaders/dimensions/shadowcomp.csh @@ -147,23 +147,26 @@ void main() { } // Mix neighbor voxel light values - - // Apply glass tint color mixing via RYB hue blending (order-independent, no dimming) + // Apply glass tint color mixing via RYB hue blending if (any(greaterThan(tintColor, vec3(0.0)))) { vec4 lightMixed = mixNeighbours(ivec3(gl_LocalInvocationID), mixMask); float maxTint = max(max(tintColor.r, tintColor.g), tintColor.b); float minTint = min(min(tintColor.r, tintColor.g), tintColor.b); + // Only apply hue mixing for chromatic (non-gray) glass if (maxTint - minTint > 0.01) { vec3 normalizedTint = tintColor / maxTint; float peakBefore = max(max(lightMixed.r, lightMixed.g), lightMixed.b); if (peakBefore > 1e-6) { + vec3 normLight = lightMixed.rgb / peakBefore; + float transmittance = dot(normLight, normalizedTint) / dot(normLight, vec3(1.0)); + vec3 lightHsv = RgbToHsv(lightMixed.rgb); vec3 tintHsv = RgbToHsv(normalizedTint); - // Remap RGB hue → RYB hue for intuitive subtractive mixing (e.g. blue+yellow=green) + // Remap RGB hue → RYB hue for color mixing (e.g. blue+yellow=green) // Piecewise linear: stretches red-yellow, compresses green-blue float lightRybH = lightHsv.x < (1.0/6.0) ? lightHsv.x * 2.0 : lightHsv.x < (1.0/3.0) ? (1.0/3.0) + (lightHsv.x - (1.0/6.0)) : @@ -174,7 +177,6 @@ void main() { tintHsv.x < (2.0/3.0) ? 0.5 + (tintHsv.x - (1.0/3.0)) * 0.5 : tintHsv.x; - // Circular weighted mean in RYB hue space for order-independent blending // Light weight ramps from 0→1 via smoothstep so torch light (low sat) defers to glass, // while already-tinted light (high sat) gets equal weight for symmetric midpoint mixing float lw = smoothstep(0.0, 0.5, lightHsv.y); @@ -189,13 +191,14 @@ void main() { newRybH < (2.0/3.0) ? (1.0/3.0) + (newRybH - 0.5) * 2.0 : newRybH; - // Keep whichever saturation is higher so colors stay vibrant through multiple panes lightHsv.y = max(lightHsv.y, tintHsv.y); + lightHsv.z *= transmittance; lightMixed.rgb = HsvToRgb(lightHsv); } } + lightMixed *= sqrt(maxTint); lightValue += lightMixed; } From 61331825499ea87f98a91725a5169128f12fc3ea Mon Sep 17 00:00:00 2001 From: YoGoUrT <91050199+YoGoUrT20@users.noreply.github.com> Date: Fri, 13 Mar 2026 00:36:55 +0100 Subject: [PATCH 03/10] fix: wrong light through multiple glass calculation --- shaders/dimensions/shadowcomp.csh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shaders/dimensions/shadowcomp.csh b/shaders/dimensions/shadowcomp.csh index f6a997cf..12219b69 100644 --- a/shaders/dimensions/shadowcomp.csh +++ b/shaders/dimensions/shadowcomp.csh @@ -192,7 +192,7 @@ void main() { newRybH; lightHsv.y = max(lightHsv.y, tintHsv.y); - lightHsv.z *= transmittance; + lightHsv.z *= sqrt(transmittance); lightMixed.rgb = HsvToRgb(lightHsv); } From e417be387c298928bc5ef910c02547fd225a4ba1 Mon Sep 17 00:00:00 2001 From: YoGoUrT <91050199+YoGoUrT20@users.noreply.github.com> Date: Fri, 13 Mar 2026 17:15:42 +0100 Subject: [PATCH 04/10] fix: correct light color display when looking though the planes --- shaders/dimensions/DH_translucent.fsh | 12 ++++++++++-- shaders/dimensions/all_particles.fsh | 2 +- shaders/dimensions/all_translucent.fsh | 15 +++++++++++---- shaders/dimensions/composite2.fsh | 4 ++-- shaders/dimensions/composite3.fsh | 16 +++++++++++++++- shaders/dimensions/composite5.fsh | 5 +++-- shaders/dimensions/voxy_translucent.glsl | 11 ++++++++++- shaders/lib/specular.glsl | 4 ++-- shaders/shaders.properties | 7 +++++++ 9 files changed, 61 insertions(+), 15 deletions(-) diff --git a/shaders/dimensions/DH_translucent.fsh b/shaders/dimensions/DH_translucent.fsh index d4ae1181..8ce6d8b9 100644 --- a/shaders/dimensions/DH_translucent.fsh +++ b/shaders/dimensions/DH_translucent.fsh @@ -281,7 +281,7 @@ vec3 applyBump(mat3 tbnMatrix, vec3 bump, float puddle_values){ #ifdef FORWARD_ROUGH_REFLECTION #endif -/* RENDERTARGETS:2,7,11,14 */ +/* RENDERTARGETS:2,7,11,12,14 */ void main() { if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) { @@ -504,7 +504,15 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) gl_FragData[2] = vec4(0.0, encodeVec2(GLASS_TINT_COLORS.rg), encodeVec2(GLASS_TINT_COLORS.ba), 0.5); } - gl_FragData[3] = vec4(1, 1, encodeVec2(lightmapCoords.x, lightmapCoords.y), 1); + vec3 normalizedGlassTint = vec3(1.0); + float maxGlassTint = max(max(GLASS_TINT_COLORS.r, GLASS_TINT_COLORS.g), GLASS_TINT_COLORS.b); + float minGlassTint = min(min(GLASS_TINT_COLORS.r, GLASS_TINT_COLORS.g), GLASS_TINT_COLORS.b); + if (maxGlassTint > 1e-6 && (maxGlassTint - minGlassTint) > 0.01 && !iswater) { + normalizedGlassTint = GLASS_TINT_COLORS.rgb / maxGlassTint; + } + gl_FragData[3] = vec4(normalizedGlassTint, 1.0); + + gl_FragData[4] = vec4(1, 1, encodeVec2(lightmapCoords.x, lightmapCoords.y), 1); } diff --git a/shaders/dimensions/all_particles.fsh b/shaders/dimensions/all_particles.fsh index 4a102dfd..499a8315 100644 --- a/shaders/dimensions/all_particles.fsh +++ b/shaders/dimensions/all_particles.fsh @@ -222,7 +222,7 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis // normalize the color to remove luminance, and keep the hue. remove all opaque color. // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. - translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; + translucentShadow.rgb = max((translucentShadow.rgb + 0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index 0f5a715c..9d920240 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -455,7 +455,7 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis // normalize the color to remove luminance, and keep the hue. remove all opaque color. // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. - translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; + translucentShadow.rgb = max((translucentShadow.rgb + 0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); @@ -469,7 +469,6 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis #endif #ifdef TRANSLUCENT_COLORED_SHADOWS - // tint the lightsource color with the translucent shadow color directLightColor *= mix(vec3(1.0), translucentTint.rgb / samples, maxDistFade); #endif @@ -581,7 +580,7 @@ float SSRT_FlashLight_Shadows(vec3 viewPos, bool depthCheck, vec3 lightDir, floa //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// -/* RENDERTARGETS:2,7,11,14 */ +/* RENDERTARGETS:2,7,11,12,14 */ void main() { @@ -1159,6 +1158,14 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) gl_FragData[1] = vec4(Albedo, MATERIALS); + vec3 normalizedGlassTint = vec3(1.0); + float maxGlassTint = max(max(GLASS_TINT_COLORS.r, GLASS_TINT_COLORS.g), GLASS_TINT_COLORS.b); + float minGlassTint = min(min(GLASS_TINT_COLORS.r, GLASS_TINT_COLORS.g), GLASS_TINT_COLORS.b); + if (maxGlassTint > 1e-6 && (maxGlassTint - minGlassTint) > 0.01 && !isWater) { + normalizedGlassTint = GLASS_TINT_COLORS.rgb / maxGlassTint; + } + gl_FragData[3] = vec4(normalizedGlassTint, 1.0); + #if DEBUG_VIEW == debug_DH_WATER_BLENDING if(gl_FragCoord.x*texelSize.x < 0.47) gl_FragData[0] = vec4(0.0); #endif @@ -1173,7 +1180,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) gl_FragData[0].rgb = Direct_lighting * 0.1; #endif - gl_FragData[3] = vec4(1, 1, encodeVec2(lightmap.x, lightmap.y), 1); + gl_FragData[4] = vec4(1, 1, encodeVec2(lightmap.x, lightmap.y), 1); #if defined ENTITIES && defined IS_IRIS && !defined COLORWHEEL if(NAMETAG > 0) { diff --git a/shaders/dimensions/composite2.fsh b/shaders/dimensions/composite2.fsh index 1a69d849..427973e6 100644 --- a/shaders/dimensions/composite2.fsh +++ b/shaders/dimensions/composite2.fsh @@ -401,7 +401,7 @@ vec4 waterVolumetrics(vec3 rayStart, vec3 rayEnd, float rayLength, vec2 dither, if(texture(shadowtex1, pos).x > pos.z && sh.x < 1.0){ vec4 translucentShadow = texture(shadowcolor0, pos.xy); - if(translucentShadow.a < 0.9) sh = normalize(translucentShadow.rgb+0.0001); + if(translucentShadow.a < 0.9) sh = (translucentShadow.rgb+0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001); } #else sh = vec3(texture(shadow, pos).x); @@ -639,7 +639,7 @@ vec4 waterVolumetrics_alt( vec3 rayStart, vec3 rayEnd, float estEndDepth, float if(texture(shadowtex1, pos).x > pos.z && sh2.x < 1.0){ vec4 translucentShadow = texture(shadowcolor0, pos.xy); - if(translucentShadow.a < 0.9) sh2 = normalize(translucentShadow.rgb+0.0001); + if(translucentShadow.a < 0.9) sh2 = (translucentShadow.rgb+0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001); } #else sh2 *= vec3(texture(shadow, pos).x); diff --git a/shaders/dimensions/composite3.fsh b/shaders/dimensions/composite3.fsh index 4f8ea8ad..0757ff59 100644 --- a/shaders/dimensions/composite3.fsh +++ b/shaders/dimensions/composite3.fsh @@ -848,7 +848,21 @@ void main() { // apply multiplicative color blend for glass n stuff #ifdef Glass_Tint - if(!isWater && translucentCheck && !isBlockBreaking) color *= mix(normalize(albedo.rgb+1e-7), vec3(1.0), max(borderFog.a, min(max(0.1-albedo.a,0.0) * 10.0,1.0))) ; + if(!isWater && translucentCheck && !isBlockBreaking) { + float mixFactor = max(borderFog.a, min(max(0.1-albedo.a,0.0) * 10.0,1.0)); + + vec3 accumulatedTint = texelFetch(colortex12, ivec2(gl_FragCoord.xy), 0).rgb; + float maxAccum = max(max(accumulatedTint.r, accumulatedTint.g), accumulatedTint.b); + + vec3 normalizedTint; + if (maxAccum > 1e-6) { + normalizedTint = accumulatedTint / maxAccum; + } else { + normalizedTint = (albedo.rgb + 1e-7) / (max(max(albedo.r, albedo.g), albedo.b) + 1e-7); + } + + color *= mix(normalizedTint, vec3(1.0), mixFactor); + } #endif // blend forward rendered programs onto the color. diff --git a/shaders/dimensions/composite5.fsh b/shaders/dimensions/composite5.fsh index edf5d16d..2d4a8d56 100644 --- a/shaders/dimensions/composite5.fsh +++ b/shaders/dimensions/composite5.fsh @@ -17,7 +17,7 @@ const int colortex9Format = RGBA16; // rain (encoded rg: gbuffers_weather -> const int colortex10Format = RGBA16F; // cloud history const int colortex11Format = RGBA16; // unchanged translucents albedo, alpha and tangent normals -const int colortex12Format = RGBA16F; // empty +const int colortex12Format = RGBA16F; // accumulated glass tint (multiplicative) const int colortex13Format = RGBA16F; // low res VL (composite5->composite15) const int colortex14Format = RGBA16; // rg = SSAO and SS-SSS. a = skylightmap for translucents. @@ -41,7 +41,8 @@ const bool colortex8Clear = false; const bool colortex9Clear = true; const bool colortex10Clear = false; const bool colortex11Clear = true; -const bool colortex12Clear = false; +const bool colortex12Clear = true; +const vec4 colortex12ClearColor = vec4(1.0, 1.0, 1.0, 1.0); const bool colortex13Clear = false; const bool colortex14Clear = true; const bool colortex15Clear = true; diff --git a/shaders/dimensions/voxy_translucent.glsl b/shaders/dimensions/voxy_translucent.glsl index 848d256e..7ec7a254 100644 --- a/shaders/dimensions/voxy_translucent.glsl +++ b/shaders/dimensions/voxy_translucent.glsl @@ -4,6 +4,7 @@ layout (location = 0) out vec4 gbuffer_data_0; layout (location = 1) out vec4 gbuffer_data_1; layout (location = 2) out vec4 gbuffer_data_2; layout (location = 3) out vec4 gbuffer_data_3; +layout (location = 4) out vec4 gbuffer_data_4; #include "/lib/settings.glsl" #include "/lib/blocks.glsl" @@ -354,7 +355,15 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) gbuffer_data_2 = vec4(0.0, encodeVec2(GLASS_TINT_COLORS.rg), encodeVec2(GLASS_TINT_COLORS.ba), 0.5); - gbuffer_data_3 = vec4(1, 1, encodeVec2(parameters.lightMap), 1); + vec3 normalizedGlassTint = vec3(1.0); + float maxGlassTint = max(max(GLASS_TINT_COLORS.r, GLASS_TINT_COLORS.g), GLASS_TINT_COLORS.b); + float minGlassTint = min(min(GLASS_TINT_COLORS.r, GLASS_TINT_COLORS.g), GLASS_TINT_COLORS.b); + if (maxGlassTint > 1e-6 && (maxGlassTint - minGlassTint) > 0.01 && !isWater) { + normalizedGlassTint = GLASS_TINT_COLORS.rgb / maxGlassTint; + } + gbuffer_data_3 = vec4(normalizedGlassTint, 1.0); + + gbuffer_data_4 = vec4(1, 1, encodeVec2(parameters.lightMap), 1); } } \ No newline at end of file diff --git a/shaders/lib/specular.glsl b/shaders/lib/specular.glsl index 4600aa6d..54565130 100644 --- a/shaders/lib/specular.glsl +++ b/shaders/lib/specular.glsl @@ -405,7 +405,7 @@ float ComputeVoxelShadowMap(inout vec3 directLightColor, vec3 playerPos, float m // normalize the color to remove luminance, and keep the hue. remove all opaque color. // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. - translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; + translucentShadow.rgb = max((translucentShadow.rgb + 0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); @@ -1176,7 +1176,7 @@ float ComputePhotonicsShadowMap(inout vec3 directLightColor, vec3 playerPos, flo // normalize the color to remove luminance, and keep the hue. remove all opaque color. // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. - translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; + translucentShadow.rgb = max((translucentShadow.rgb + 0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); diff --git a/shaders/shaders.properties b/shaders/shaders.properties index b5dff25a..78fbd8b6 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -27,6 +27,7 @@ separateAo = true rain.depth = false beacon.beam.depth = true sky = false +blockface.culling=false iris.features.required = SSBO COMPUTE_SHADERS @@ -167,6 +168,7 @@ program.world1/gbuffers_block_translucent.enabled = TRANSLUCENT_ENTITIES && IS_I blend.dh_terrain = off blend.dh_water = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE blend.dh_water.colortex11 = off + blend.dh_water.colortex12 = DST_COLOR ZERO ONE ZERO #else dhShadow.enabled = false program.world0/dh_terrain.enabled = false @@ -222,6 +224,11 @@ blend.gbuffers_basic.colortex11 = off blend.gbuffers_lightning.colortex11 = off blend.gbuffers_entities_translucent.colortex11 = off +blend.gbuffers_water.colortex12 = DST_COLOR ZERO ONE ZERO +blend.gbuffers_hand_water.colortex12 = DST_COLOR ZERO ONE ZERO +blend.gbuffers_block_translucent.colortex12 = DST_COLOR ZERO ONE ZERO +blend.gbuffers_entities_translucent.colortex12 = DST_COLOR ZERO ONE ZERO + # blend.colortex4 = off blend.composite.colortex5 = off blend.deferred1.colortex9 = off From d0b2b9ee7afdb4d428b4602c5a964ef426eb84ef Mon Sep 17 00:00:00 2001 From: YoGoUrT <91050199+YoGoUrT20@users.noreply.github.com> Date: Tue, 17 Mar 2026 19:52:11 +0100 Subject: [PATCH 05/10] fix light saturation --- shaders/dimensions/shadowcomp.csh | 1 + 1 file changed, 1 insertion(+) diff --git a/shaders/dimensions/shadowcomp.csh b/shaders/dimensions/shadowcomp.csh index 12219b69..3f20d9b3 100644 --- a/shaders/dimensions/shadowcomp.csh +++ b/shaders/dimensions/shadowcomp.csh @@ -192,6 +192,7 @@ void main() { newRybH; lightHsv.y = max(lightHsv.y, tintHsv.y); + lightHsv.y *= LPV_SATURATION / 100.0; lightHsv.z *= sqrt(transmittance); lightMixed.rgb = HsvToRgb(lightHsv); From f8a3e8ffd43a99badfcd69c29562011bd681b659 Mon Sep 17 00:00:00 2001 From: YoGoUrT <91050199+YoGoUrT20@users.noreply.github.com> Date: Tue, 17 Mar 2026 22:06:32 +0100 Subject: [PATCH 06/10] Add: propogation style setting --- shaders/dimensions/all_particles.fsh | 4 ++++ shaders/dimensions/all_translucent.fsh | 4 ++++ shaders/dimensions/composite2.fsh | 8 ++++++++ shaders/dimensions/composite3.fsh | 4 ++++ shaders/dimensions/shadowcomp.csh | 4 ++++ shaders/lang/en_us.lang | 4 ++++ shaders/lib/settings.glsl | 1 + shaders/lib/specular.glsl | 5 ++++- shaders/shaders.properties | 2 +- 9 files changed, 34 insertions(+), 2 deletions(-) diff --git a/shaders/dimensions/all_particles.fsh b/shaders/dimensions/all_particles.fsh index 499a8315..38c3e7b4 100644 --- a/shaders/dimensions/all_particles.fsh +++ b/shaders/dimensions/all_particles.fsh @@ -222,7 +222,11 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis // normalize the color to remove luminance, and keep the hue. remove all opaque color. // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. + #if LPV_COLOR_STYLE == 1 translucentShadow.rgb = max((translucentShadow.rgb + 0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; + #else + translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; + #endif // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index 9d920240..5333b90f 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -455,7 +455,11 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis // normalize the color to remove luminance, and keep the hue. remove all opaque color. // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. + #if LPV_COLOR_STYLE == 1 translucentShadow.rgb = max((translucentShadow.rgb + 0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; + #else + translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; + #endif // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); diff --git a/shaders/dimensions/composite2.fsh b/shaders/dimensions/composite2.fsh index 427973e6..012a6b72 100644 --- a/shaders/dimensions/composite2.fsh +++ b/shaders/dimensions/composite2.fsh @@ -401,7 +401,11 @@ vec4 waterVolumetrics(vec3 rayStart, vec3 rayEnd, float rayLength, vec2 dither, if(texture(shadowtex1, pos).x > pos.z && sh.x < 1.0){ vec4 translucentShadow = texture(shadowcolor0, pos.xy); + #if LPV_COLOR_STYLE == 1 if(translucentShadow.a < 0.9) sh = (translucentShadow.rgb+0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001); + #else + if(translucentShadow.a < 0.9) sh = normalize(translucentShadow.rgb+0.0001); + #endif } #else sh = vec3(texture(shadow, pos).x); @@ -639,7 +643,11 @@ vec4 waterVolumetrics_alt( vec3 rayStart, vec3 rayEnd, float estEndDepth, float if(texture(shadowtex1, pos).x > pos.z && sh2.x < 1.0){ vec4 translucentShadow = texture(shadowcolor0, pos.xy); + #if LPV_COLOR_STYLE == 1 if(translucentShadow.a < 0.9) sh2 = (translucentShadow.rgb+0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001); + #else + if(translucentShadow.a < 0.9) sh2 = normalize(translucentShadow.rgb+0.0001); + #endif } #else sh2 *= vec3(texture(shadow, pos).x); diff --git a/shaders/dimensions/composite3.fsh b/shaders/dimensions/composite3.fsh index 0757ff59..c4616d1b 100644 --- a/shaders/dimensions/composite3.fsh +++ b/shaders/dimensions/composite3.fsh @@ -848,6 +848,7 @@ void main() { // apply multiplicative color blend for glass n stuff #ifdef Glass_Tint + #if LPV_COLOR_STYLE == 1 if(!isWater && translucentCheck && !isBlockBreaking) { float mixFactor = max(borderFog.a, min(max(0.1-albedo.a,0.0) * 10.0,1.0)); @@ -863,6 +864,9 @@ void main() { color *= mix(normalizedTint, vec3(1.0), mixFactor); } + #else + if(!isWater && translucentCheck && !isBlockBreaking) color *= mix(normalize(albedo.rgb+1e-7), vec3(1.0), max(borderFog.a, min(max(0.1-albedo.a,0.0) * 10.0,1.0))) ; + #endif #endif // blend forward rendered programs onto the color. diff --git a/shaders/dimensions/shadowcomp.csh b/shaders/dimensions/shadowcomp.csh index 3f20d9b3..79c98600 100644 --- a/shaders/dimensions/shadowcomp.csh +++ b/shaders/dimensions/shadowcomp.csh @@ -151,6 +151,7 @@ void main() { if (any(greaterThan(tintColor, vec3(0.0)))) { vec4 lightMixed = mixNeighbours(ivec3(gl_LocalInvocationID), mixMask); +#if LPV_COLOR_STYLE == 1 float maxTint = max(max(tintColor.r, tintColor.g), tintColor.b); float minTint = min(min(tintColor.r, tintColor.g), tintColor.b); @@ -200,6 +201,9 @@ void main() { } lightMixed *= sqrt(maxTint); +#else + lightMixed.rgb *= tintColor; +#endif lightValue += lightMixed; } diff --git a/shaders/lang/en_us.lang b/shaders/lang/en_us.lang index fd75ee7f..bc4e2e8c 100644 --- a/shaders/lang/en_us.lang +++ b/shaders/lang/en_us.lang @@ -225,6 +225,9 @@ screen.Direct_Light = Direct Light screen.LPV = FloodFill (Colored Lights) option.LPV_ENABLED = Enabled + option.LPV_COLOR_STYLE = Propagation Style + value.LPV_COLOR_STYLE.1 = Colourful + value.LPV_COLOR_STYLE.2 = Default option.LPV_SIZE = Size value.LPV_SIZE.6 = Small [64] value.LPV_SIZE.7 = Medium [128] @@ -1040,6 +1043,7 @@ screen.Ambient_light.comment = Configure settings related to the lighting in sha screen.Ambient_Colors.comment = Configure the color of light in shaded areas. screen.Torch_Colors.comment = Configure the color of light from torches or other placed lightsources. + option.LPV_COLOR_STYLE.comment = Configures the color mixing logic during floodfill light propagation. Colourful uses a more vibrant RYB blending method. It is highly recommended to use a Light Saturation of 100% or more when Colourful is selected. option.LPV_SIZE.comment = Configures the size (in blocks) of the volume for colored lighting. option.LPV_SATURATION.comment = Configures the intensity of colored lighting. option.LPV_TINT_SATURATION.comment = Configures the intensity of tinting by translucent blocks on colored lighting. diff --git a/shaders/lib/settings.glsl b/shaders/lib/settings.glsl index 69353559..695435f7 100644 --- a/shaders/lib/settings.glsl +++ b/shaders/lib/settings.glsl @@ -1109,6 +1109,7 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631) /////////////////////////////////////////// #define LPV_ENABLED +#define LPV_COLOR_STYLE 2 // [1 2] #define LPV_SIZE 7 // [6 7 8] #define LPV_SATURATION 50 // [0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200] #define LPV_TINT_SATURATION 100 // [0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200] diff --git a/shaders/lib/specular.glsl b/shaders/lib/specular.glsl index 54565130..5a2f81a1 100644 --- a/shaders/lib/specular.glsl +++ b/shaders/lib/specular.glsl @@ -1175,8 +1175,11 @@ float ComputePhotonicsShadowMap(inout vec3 directLightColor, vec3 playerPos, flo float shadowAlpha = pow(1.0 - pow(translucentShadow.a,5.0),0.2); // normalize the color to remove luminance, and keep the hue. remove all opaque color. - // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. + #if LPV_COLOR_STYLE == 1 translucentShadow.rgb = max((translucentShadow.rgb + 0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; + #else + translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; + #endif // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); diff --git a/shaders/shaders.properties b/shaders/shaders.properties index 78fbd8b6..05111da7 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -350,7 +350,7 @@ SHADER_VERSION_LABEL \ LPV_SATURATION LPV_COLORED_CANDLES \ LPV_TINT_SATURATION LPV_REDSTONE_LIGHTS \ LPV_NORMAL_STRENGTH LPV_ENTITY_LIGHTS \ - LPV_NOSHADOW_HACK \ + LPV_NOSHADOW_HACK LPV_COLOR_STYLE \ LPV_VL_FOG_ILLUMINATION LPV_VL_FOG_ILLUMINATION_BRIGHTNESS \ LPV_VL_FOG_ILLUMINATION_HANDHELD_WATER \ VANILLA_LIGHTMAP_MASK \ From 33e900b4979db59b4e58e20380c9870628e42993 Mon Sep 17 00:00:00 2001 From: YoGoUrT <91050199+YoGoUrT20@users.noreply.github.com> Date: Tue, 17 Mar 2026 22:15:52 +0100 Subject: [PATCH 07/10] Add: russian support --- shaders/lang/ru_RU.lang | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shaders/lang/ru_RU.lang b/shaders/lang/ru_RU.lang index e398b4a6..8b98064a 100644 --- a/shaders/lang/ru_RU.lang +++ b/shaders/lang/ru_RU.lang @@ -741,4 +741,10 @@ value.DH_KNOWN_ISSUES.1 = §a GTAO, RTAO, и SSGI прерываются на LO option.DISTANT_HORIZONS_SHADOWMAP = §c(НЕ ИСПОЛЬЗУЙТЕ, ЕСЛИ ВЫ НЕ ЗНАЕТЕ, ЧТО ЭТО ТАКОЕ)§r Поддержка карты теней DH option.DISTANT_HORIZONS_SHADOWMAP.comment = §cЭТОТ ПАРАМЕТР СНИЗИТ ПРОИЗВОДИТЕЛЬНОСТЬ, ИЗ-ЗА ЧЕГО ТЕНИ БУДУТ ВЫГЛЯДЕТЬ БЛОЧНЫМИ, МЕРЦАЮЩИМИ И С НИЗКОЙ ДЕТАЛИЗАЦИЕЙ§r. установите дистанцию теней равную 32 фрагментам (или больше). установите разрешение теней равную 4096 (или больше) option.TOGGLE_VL_FOG = Объемный туман -option.TOGGLE_VL_FOG.comment = одна большая кнопка, чтобы просто отключить весь туман \ No newline at end of file +option.TOGGLE_VL_FOG.comment = одна большая кнопка, чтобы просто отключить весь туман + +screen.LPV = FloodFill (Цветное освещение) +option.LPV_COLOR_STYLE = Стиль распространения +value.LPV_COLOR_STYLE.1 = Красочный +value.LPV_COLOR_STYLE.2 = Стандартный +option.LPV_COLOR_STYLE.comment = Настраивает логику смешивания цветов при распространении света Floodfill. «Красочный» использует более насыщенный метод смешивания RYB. При выборе «Красочный» настоятельно рекомендуется установить насыщенность света на 100% или больше. \ No newline at end of file From d4f546b1e3e60188f4af4aff1ef40a44389d984b Mon Sep 17 00:00:00 2001 From: YoGoUrT <91050199+YoGoUrT20@users.noreply.github.com> Date: Tue, 17 Mar 2026 22:34:13 +0100 Subject: [PATCH 08/10] fixing stuff --- shaders/dimensions/all_translucent.fsh | 1 + shaders/lib/specular.glsl | 1 + 2 files changed, 2 insertions(+) diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index 5333b90f..30f2b2f0 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -473,6 +473,7 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis #endif #ifdef TRANSLUCENT_COLORED_SHADOWS + // tint the lightsource color with the translucent shadow color directLightColor *= mix(vec3(1.0), translucentTint.rgb / samples, maxDistFade); #endif diff --git a/shaders/lib/specular.glsl b/shaders/lib/specular.glsl index 5a2f81a1..c9fcd1aa 100644 --- a/shaders/lib/specular.glsl +++ b/shaders/lib/specular.glsl @@ -1175,6 +1175,7 @@ float ComputePhotonicsShadowMap(inout vec3 directLightColor, vec3 playerPos, flo float shadowAlpha = pow(1.0 - pow(translucentShadow.a,5.0),0.2); // normalize the color to remove luminance, and keep the hue. remove all opaque color. + // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. #if LPV_COLOR_STYLE == 1 translucentShadow.rgb = max((translucentShadow.rgb + 0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; #else From 948c85aa174fdb1f3c2916dec5900445eb2db5ac Mon Sep 17 00:00:00 2001 From: YoGoUrT <91050199+YoGoUrT20@users.noreply.github.com> Date: Wed, 18 Mar 2026 23:06:54 +0100 Subject: [PATCH 09/10] rollback requested changes --- shaders/dimensions/DH_translucent.fsh | 12 ++---------- shaders/dimensions/all_particles.fsh | 4 ---- shaders/dimensions/all_translucent.fsh | 16 ++-------------- shaders/dimensions/composite2.fsh | 8 -------- shaders/dimensions/composite3.fsh | 18 ------------------ shaders/dimensions/composite5.fsh | 5 ++--- shaders/dimensions/voxy_translucent.glsl | 11 +---------- shaders/lib/specular.glsl | 6 +----- shaders/shaders.properties | 9 +-------- 9 files changed, 9 insertions(+), 80 deletions(-) diff --git a/shaders/dimensions/DH_translucent.fsh b/shaders/dimensions/DH_translucent.fsh index 8ce6d8b9..d4ae1181 100644 --- a/shaders/dimensions/DH_translucent.fsh +++ b/shaders/dimensions/DH_translucent.fsh @@ -281,7 +281,7 @@ vec3 applyBump(mat3 tbnMatrix, vec3 bump, float puddle_values){ #ifdef FORWARD_ROUGH_REFLECTION #endif -/* RENDERTARGETS:2,7,11,12,14 */ +/* RENDERTARGETS:2,7,11,14 */ void main() { if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) { @@ -504,15 +504,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) gl_FragData[2] = vec4(0.0, encodeVec2(GLASS_TINT_COLORS.rg), encodeVec2(GLASS_TINT_COLORS.ba), 0.5); } - vec3 normalizedGlassTint = vec3(1.0); - float maxGlassTint = max(max(GLASS_TINT_COLORS.r, GLASS_TINT_COLORS.g), GLASS_TINT_COLORS.b); - float minGlassTint = min(min(GLASS_TINT_COLORS.r, GLASS_TINT_COLORS.g), GLASS_TINT_COLORS.b); - if (maxGlassTint > 1e-6 && (maxGlassTint - minGlassTint) > 0.01 && !iswater) { - normalizedGlassTint = GLASS_TINT_COLORS.rgb / maxGlassTint; - } - gl_FragData[3] = vec4(normalizedGlassTint, 1.0); - - gl_FragData[4] = vec4(1, 1, encodeVec2(lightmapCoords.x, lightmapCoords.y), 1); + gl_FragData[3] = vec4(1, 1, encodeVec2(lightmapCoords.x, lightmapCoords.y), 1); } diff --git a/shaders/dimensions/all_particles.fsh b/shaders/dimensions/all_particles.fsh index 05e8df11..7259fbbe 100644 --- a/shaders/dimensions/all_particles.fsh +++ b/shaders/dimensions/all_particles.fsh @@ -222,11 +222,7 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis // normalize the color to remove luminance, and keep the hue. remove all opaque color. // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. - #if LPV_COLOR_STYLE == 1 - translucentShadow.rgb = max((translucentShadow.rgb + 0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; - #else translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; - #endif // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index 30f2b2f0..0f5a715c 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -455,11 +455,7 @@ float ComputeShadowMap(inout vec3 directLightColor, vec3 playerPos, float maxDis // normalize the color to remove luminance, and keep the hue. remove all opaque color. // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. - #if LPV_COLOR_STYLE == 1 - translucentShadow.rgb = max((translucentShadow.rgb + 0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; - #else translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; - #endif // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); @@ -585,7 +581,7 @@ float SSRT_FlashLight_Shadows(vec3 viewPos, bool depthCheck, vec3 lightDir, floa //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// -/* RENDERTARGETS:2,7,11,12,14 */ +/* RENDERTARGETS:2,7,11,14 */ void main() { @@ -1163,14 +1159,6 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) gl_FragData[1] = vec4(Albedo, MATERIALS); - vec3 normalizedGlassTint = vec3(1.0); - float maxGlassTint = max(max(GLASS_TINT_COLORS.r, GLASS_TINT_COLORS.g), GLASS_TINT_COLORS.b); - float minGlassTint = min(min(GLASS_TINT_COLORS.r, GLASS_TINT_COLORS.g), GLASS_TINT_COLORS.b); - if (maxGlassTint > 1e-6 && (maxGlassTint - minGlassTint) > 0.01 && !isWater) { - normalizedGlassTint = GLASS_TINT_COLORS.rgb / maxGlassTint; - } - gl_FragData[3] = vec4(normalizedGlassTint, 1.0); - #if DEBUG_VIEW == debug_DH_WATER_BLENDING if(gl_FragCoord.x*texelSize.x < 0.47) gl_FragData[0] = vec4(0.0); #endif @@ -1185,7 +1173,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) gl_FragData[0].rgb = Direct_lighting * 0.1; #endif - gl_FragData[4] = vec4(1, 1, encodeVec2(lightmap.x, lightmap.y), 1); + gl_FragData[3] = vec4(1, 1, encodeVec2(lightmap.x, lightmap.y), 1); #if defined ENTITIES && defined IS_IRIS && !defined COLORWHEEL if(NAMETAG > 0) { diff --git a/shaders/dimensions/composite2.fsh b/shaders/dimensions/composite2.fsh index 012a6b72..1a69d849 100644 --- a/shaders/dimensions/composite2.fsh +++ b/shaders/dimensions/composite2.fsh @@ -401,11 +401,7 @@ vec4 waterVolumetrics(vec3 rayStart, vec3 rayEnd, float rayLength, vec2 dither, if(texture(shadowtex1, pos).x > pos.z && sh.x < 1.0){ vec4 translucentShadow = texture(shadowcolor0, pos.xy); - #if LPV_COLOR_STYLE == 1 - if(translucentShadow.a < 0.9) sh = (translucentShadow.rgb+0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001); - #else if(translucentShadow.a < 0.9) sh = normalize(translucentShadow.rgb+0.0001); - #endif } #else sh = vec3(texture(shadow, pos).x); @@ -643,11 +639,7 @@ vec4 waterVolumetrics_alt( vec3 rayStart, vec3 rayEnd, float estEndDepth, float if(texture(shadowtex1, pos).x > pos.z && sh2.x < 1.0){ vec4 translucentShadow = texture(shadowcolor0, pos.xy); - #if LPV_COLOR_STYLE == 1 - if(translucentShadow.a < 0.9) sh2 = (translucentShadow.rgb+0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001); - #else if(translucentShadow.a < 0.9) sh2 = normalize(translucentShadow.rgb+0.0001); - #endif } #else sh2 *= vec3(texture(shadow, pos).x); diff --git a/shaders/dimensions/composite3.fsh b/shaders/dimensions/composite3.fsh index c4616d1b..4f8ea8ad 100644 --- a/shaders/dimensions/composite3.fsh +++ b/shaders/dimensions/composite3.fsh @@ -848,25 +848,7 @@ void main() { // apply multiplicative color blend for glass n stuff #ifdef Glass_Tint - #if LPV_COLOR_STYLE == 1 - if(!isWater && translucentCheck && !isBlockBreaking) { - float mixFactor = max(borderFog.a, min(max(0.1-albedo.a,0.0) * 10.0,1.0)); - - vec3 accumulatedTint = texelFetch(colortex12, ivec2(gl_FragCoord.xy), 0).rgb; - float maxAccum = max(max(accumulatedTint.r, accumulatedTint.g), accumulatedTint.b); - - vec3 normalizedTint; - if (maxAccum > 1e-6) { - normalizedTint = accumulatedTint / maxAccum; - } else { - normalizedTint = (albedo.rgb + 1e-7) / (max(max(albedo.r, albedo.g), albedo.b) + 1e-7); - } - - color *= mix(normalizedTint, vec3(1.0), mixFactor); - } - #else if(!isWater && translucentCheck && !isBlockBreaking) color *= mix(normalize(albedo.rgb+1e-7), vec3(1.0), max(borderFog.a, min(max(0.1-albedo.a,0.0) * 10.0,1.0))) ; - #endif #endif // blend forward rendered programs onto the color. diff --git a/shaders/dimensions/composite5.fsh b/shaders/dimensions/composite5.fsh index 2d4a8d56..edf5d16d 100644 --- a/shaders/dimensions/composite5.fsh +++ b/shaders/dimensions/composite5.fsh @@ -17,7 +17,7 @@ const int colortex9Format = RGBA16; // rain (encoded rg: gbuffers_weather -> const int colortex10Format = RGBA16F; // cloud history const int colortex11Format = RGBA16; // unchanged translucents albedo, alpha and tangent normals -const int colortex12Format = RGBA16F; // accumulated glass tint (multiplicative) +const int colortex12Format = RGBA16F; // empty const int colortex13Format = RGBA16F; // low res VL (composite5->composite15) const int colortex14Format = RGBA16; // rg = SSAO and SS-SSS. a = skylightmap for translucents. @@ -41,8 +41,7 @@ const bool colortex8Clear = false; const bool colortex9Clear = true; const bool colortex10Clear = false; const bool colortex11Clear = true; -const bool colortex12Clear = true; -const vec4 colortex12ClearColor = vec4(1.0, 1.0, 1.0, 1.0); +const bool colortex12Clear = false; const bool colortex13Clear = false; const bool colortex14Clear = true; const bool colortex15Clear = true; diff --git a/shaders/dimensions/voxy_translucent.glsl b/shaders/dimensions/voxy_translucent.glsl index 7ec7a254..848d256e 100644 --- a/shaders/dimensions/voxy_translucent.glsl +++ b/shaders/dimensions/voxy_translucent.glsl @@ -4,7 +4,6 @@ layout (location = 0) out vec4 gbuffer_data_0; layout (location = 1) out vec4 gbuffer_data_1; layout (location = 2) out vec4 gbuffer_data_2; layout (location = 3) out vec4 gbuffer_data_3; -layout (location = 4) out vec4 gbuffer_data_4; #include "/lib/settings.glsl" #include "/lib/blocks.glsl" @@ -355,15 +354,7 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) gbuffer_data_2 = vec4(0.0, encodeVec2(GLASS_TINT_COLORS.rg), encodeVec2(GLASS_TINT_COLORS.ba), 0.5); - vec3 normalizedGlassTint = vec3(1.0); - float maxGlassTint = max(max(GLASS_TINT_COLORS.r, GLASS_TINT_COLORS.g), GLASS_TINT_COLORS.b); - float minGlassTint = min(min(GLASS_TINT_COLORS.r, GLASS_TINT_COLORS.g), GLASS_TINT_COLORS.b); - if (maxGlassTint > 1e-6 && (maxGlassTint - minGlassTint) > 0.01 && !isWater) { - normalizedGlassTint = GLASS_TINT_COLORS.rgb / maxGlassTint; - } - gbuffer_data_3 = vec4(normalizedGlassTint, 1.0); - - gbuffer_data_4 = vec4(1, 1, encodeVec2(parameters.lightMap), 1); + gbuffer_data_3 = vec4(1, 1, encodeVec2(parameters.lightMap), 1); } } \ No newline at end of file diff --git a/shaders/lib/specular.glsl b/shaders/lib/specular.glsl index c9fcd1aa..4600aa6d 100644 --- a/shaders/lib/specular.glsl +++ b/shaders/lib/specular.glsl @@ -405,7 +405,7 @@ float ComputeVoxelShadowMap(inout vec3 directLightColor, vec3 playerPos, float m // normalize the color to remove luminance, and keep the hue. remove all opaque color. // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. - translucentShadow.rgb = max((translucentShadow.rgb + 0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; + translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); @@ -1176,11 +1176,7 @@ float ComputePhotonicsShadowMap(inout vec3 directLightColor, vec3 playerPos, flo // normalize the color to remove luminance, and keep the hue. remove all opaque color. // mulitply shadow alpha to shadow color, but only on surfaces facing the lightsource. this is a tradeoff to protect subsurface scattering's colored shadow tint from shadow bias on the back of the caster. - #if LPV_COLOR_STYLE == 1 - translucentShadow.rgb = max((translucentShadow.rgb + 0.0001) / (max(max(translucentShadow.r, translucentShadow.g), translucentShadow.b) + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; - #else translucentShadow.rgb = max(normalize(translucentShadow.rgb + 0.0001), max(opaqueShadow, 1.0-shadowAlpha)) * shadowAlpha; - #endif // make it such that full alpha areas that arent in a shadow have a value of 1.0 instead of 0.0 translucentTint += mix(translucentShadow.rgb, vec3(1.0), opaqueShadow*shadowDepthDiff); diff --git a/shaders/shaders.properties b/shaders/shaders.properties index 0757c575..6db0cba1 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -27,7 +27,6 @@ separateAo = true rain.depth = false beacon.beam.depth = true sky = false -blockface.culling=false iris.features.required = SSBO COMPUTE_SHADERS @@ -177,7 +176,6 @@ program.world1/gbuffers_block_translucent.enabled = TRANSLUCENT_ENTITIES && IS_I blend.dh_terrain = off blend.dh_water = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE blend.dh_water.colortex11 = off - blend.dh_water.colortex12 = DST_COLOR ZERO ONE ZERO #else dhShadow.enabled = false program.world0/dh_terrain.enabled = false @@ -233,11 +231,6 @@ blend.gbuffers_basic.colortex11 = off blend.gbuffers_lightning.colortex11 = off blend.gbuffers_entities_translucent.colortex11 = off -blend.gbuffers_water.colortex12 = DST_COLOR ZERO ONE ZERO -blend.gbuffers_hand_water.colortex12 = DST_COLOR ZERO ONE ZERO -blend.gbuffers_block_translucent.colortex12 = DST_COLOR ZERO ONE ZERO -blend.gbuffers_entities_translucent.colortex12 = DST_COLOR ZERO ONE ZERO - # blend.colortex4 = off blend.composite.colortex5 = off blend.deferred1.colortex9 = off @@ -359,7 +352,7 @@ SHADER_VERSION_LABEL \ LPV_SATURATION LPV_COLORED_CANDLES \ LPV_TINT_SATURATION LPV_REDSTONE_LIGHTS \ LPV_NORMAL_STRENGTH LPV_ENTITY_LIGHTS \ - LPV_NOSHADOW_HACK LPV_COLOR_STYLE \ + LPV_NOSHADOW_HACK \ LPV_VL_FOG_ILLUMINATION LPV_VL_FOG_ILLUMINATION_BRIGHTNESS \ LPV_VL_FOG_ILLUMINATION_HANDHELD_WATER \ VANILLA_LIGHTMAP_MASK \ From 89cd00e569659c182f2ac8f70c6b8486b5cc86fd Mon Sep 17 00:00:00 2001 From: YoGoUrT <91050199+YoGoUrT20@users.noreply.github.com> Date: Wed, 18 Mar 2026 23:22:03 +0100 Subject: [PATCH 10/10] add: setting --- shaders/shaders.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/shaders/shaders.properties b/shaders/shaders.properties index 6db0cba1..a8c18774 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -349,6 +349,7 @@ SHADER_VERSION_LABEL \ ### FloodFill screen.LPV.columns = 2 screen.LPV = LPV_ENABLED LPV_SIZE \ + LPV_COLOR_STYLE \ LPV_SATURATION LPV_COLORED_CANDLES \ LPV_TINT_SATURATION LPV_REDSTONE_LIGHTS \ LPV_NORMAL_STRENGTH LPV_ENTITY_LIGHTS \