From a4c27c714f1aec185689382bc59ac3590be974cd Mon Sep 17 00:00:00 2001 From: Merlin1809 <88194861+Merlin1809@users.noreply.github.com> Date: Tue, 10 Feb 2026 19:31:34 +0100 Subject: [PATCH] Tweak Photonics GI --- shaders/dimensions/composite1.fsh | 23 ++++++++++++++--------- shaders/lang/en_us.lang | 2 +- shaders/lang/zh_cn.lang | 2 +- shaders/lib/diffuse_lighting.glsl | 13 +++++++------ 4 files changed, 23 insertions(+), 17 deletions(-) diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index 900d993..f0c8f50 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -1260,6 +1260,7 @@ void main() { // idk why this do // this seems to be compensating view bobbing, but why not do this when calculating feetPlayerPos? hmmm feetPlayerPos += gbufferModelViewInverse[3].xyz; + float viewDist = length(feetPlayerPos); worldPos = feetPlayerPos + cameraPosition; //////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////// FILTER STUFF ////////////////////////////////// @@ -1292,11 +1293,11 @@ void main() { //////////////////////////////// SHADOWMAP //////////////////////////////// // setup shadow projection - float shadowMapFalloff = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / (shadowDistance+32.0),0.0)*5.0,1.0)); + float shadowMapFalloff = smoothstep(0.0, 1.0, min(max(1.0 - viewDist / (shadowDistance+32.0),0.0)*5.0,1.0)); #if defined DISTANT_HORIZONS || defined VOXY - float shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / min(shadowDistance, max(far-32.0,32.0)),0.0)*5.0,1.0)); + float shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - viewDist / min(shadowDistance, max(far-32.0,32.0)),0.0)*5.0,1.0)); #else - float shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / shadowDistance,0.0)*5.0,1.0)); + float shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - viewDist / shadowDistance,0.0)*5.0,1.0)); #endif if(eyeInWater){ @@ -1476,6 +1477,16 @@ void main() { Indirect_lighting += doIndirectLighting(AmbientLightColor * skylight, MinimumLightColor, lightmap.y); + #ifdef PHOTONICS_ENABLED + #if defined DISTANT_HORIZONS || defined VOXY + float photonicsFalloff = smoothstep(min(far, 128.0), min(0.9*far, 118.0), viewDist); + #else + float photonicsFalloff = smoothstep(256.0, 230.0, viewDist); + #endif + + vec3 gi_color = texture(colortex15, texcoord).xyz; + Indirect_lighting = mix(Indirect_lighting, gi_color*2.5*PHOTONICS_INDIRECT_BRIGHTNESS, photonicsFalloff); + #endif #endif #ifdef NETHER_SHADER @@ -1537,12 +1548,6 @@ void main() { ///////////////////////////// EFFECTS FOR INDIRECT ///////////////////////////// ///////////////////////////////////////////////////////////////////////////////////// - #ifdef PHOTONICS_ENABLED - vec3 gi_color = texture(colortex15, texcoord).xyz; - - Indirect_lighting += gi_color*2.5*PHOTONICS_INDIRECT_BRIGHTNESS; - #endif - float SkySSS = SSAO_SSS.y; vec3 AO = vec3(1.0); diff --git a/shaders/lang/en_us.lang b/shaders/lang/en_us.lang index 32652a6..d804274 100644 --- a/shaders/lang/en_us.lang +++ b/shaders/lang/en_us.lang @@ -1,6 +1,6 @@ option.SHADER_VERSION_LABEL = §d§lECLIPSE§r - A Bliss Edit prefix.SHADER_VERSION_LABEL = V - value.SHADER_VERSION_LABEL.482 = 6.3.1 + value.SHADER_VERSION_LABEL.482 = 6.3.2 # if you're here to translate, this is not a joke, these do what they say profile.POTATO=§4Potato diff --git a/shaders/lang/zh_cn.lang b/shaders/lang/zh_cn.lang index 8ed7fd6..c2a2e77 100644 --- a/shaders/lang/zh_cn.lang +++ b/shaders/lang/zh_cn.lang @@ -1,6 +1,6 @@ option.SHADER_VERSION_LABEL = §d§lECLIPSE§r - Bliss 编辑版 prefix.SHADER_VERSION_LABEL = 版本 - value.SHADER_VERSION_LABEL.482 = 6.3.1 + value.SHADER_VERSION_LABEL.482 = 6.3.2 # 如果你是来翻译的,这不是玩笑,这些选项的功能正如其名 profile.POTATO=§4土豆 (极低配置) diff --git a/shaders/lib/diffuse_lighting.glsl b/shaders/lib/diffuse_lighting.glsl index 3f88a97..dba0b4a 100644 --- a/shaders/lib/diffuse_lighting.glsl +++ b/shaders/lib/diffuse_lighting.glsl @@ -183,13 +183,14 @@ vec3 doBlockLightLighting( photonicsLight += (ph_direct_soft.xyz / max(ph_direct_soft.w, 1.0f)); photonicsLight += lightColor * 2.5 * min(max(lightmap-0.999,0.0)/(1.0-0.999),1.0); - #if defined DISTANT_HORIZONS || defined VOXY - float photonicsFalloff = smoothstep(min(1.0*far, 256.0), min(0.9*far, 230.0), length(playerPos)); - blockLight = mix(blockLight, photonicsLight, photonicsFalloff); - #else - blockLight = photonicsLight; - #endif + float photonicsFalloff = smoothstep(min(far, 256.0), min(0.9*far, 230.0), length(playerPos)); + #else + float photonicsFalloff = smoothstep(256.0, 230.0, length(playerPos)); + #endif + + + blockLight = mix(blockLight, photonicsLight, photonicsFalloff); } #endif