From 90505ccae5337f550608dfe7f9105848a22fd6a4 Mon Sep 17 00:00:00 2001 From: Merlin1809 <88194861+Merlin1809@users.noreply.github.com> Date: Thu, 6 Aug 2026 16:28:54 +0200 Subject: [PATCH] improve hand reflection detection, merge some of xonks specular fixes --- shaders/dimensions/all_translucent.fsh | 11 +++++++---- shaders/dimensions/all_translucent.vsh | 6 ++++-- shaders/lang/en_us.lang | 2 +- shaders/lang/zh_cn.lang | 2 +- shaders/lib/specular.glsl | 2 ++ 5 files changed, 15 insertions(+), 8 deletions(-) diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index b20bb44..62e63af 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -625,9 +625,6 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) // 0.4 = translucent particles // 0.3 = hand mask - #ifdef HAND - MATERIALS = 0.3; - #endif // bool isHand = abs(MATERIALS - 0.1) < 0.01; bool isWater = MATERIALS > 0.99; @@ -636,6 +633,10 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) bool isEntity = abs(MATERIALS - 0.4) < 0.01 || isReflectiveEntity; // bool isNetherPortal = abs(MATERIALS - 0.6) < 0.01; + #ifdef HAND + MATERIALS = 0.3; + #endif + //////////////////////////////////////////////////////////////////////////////// /////////////////////////////////// ALBEDO ///////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// @@ -1120,13 +1121,15 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) #ifdef HAND isHand = true; - f0 = max(specularValues.g, harcodedF0); + // f0 = max(specularValues.g, harcodedF0); #endif float roughness = specularValues.r; if(UnchangedAlpha <= 0.0 && !isReflective) f0 = 0.0; + if(SpecularTex.g == 0.0 && SpecularTex.r > 0.0) f0 = harcodedF0; + if (f0 > 0.0){ if(isReflective) f0 = max(f0, harcodedF0); diff --git a/shaders/dimensions/all_translucent.vsh b/shaders/dimensions/all_translucent.vsh index 7a7a3cf..7b16084 100644 --- a/shaders/dimensions/all_translucent.vsh +++ b/shaders/dimensions/all_translucent.vsh @@ -132,6 +132,8 @@ vec3 getWaveNormal(vec3 posxz, float range){ uniform float caveDetection; #endif +uniform int currentRenderedItemId; + //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// @@ -247,11 +249,11 @@ void main() { #endif // translucent blocks - if (mc_Entity.x >= 301 && mc_Entity.x <= 338) mat = 0.1; + if (mc_Entity.x >= 301 && mc_Entity.x <= 338 || currentRenderedItemId >= 301 && currentRenderedItemId <= 338) mat = 0.1; // if (mc_Entity.x == BLOCK_NETHER_PORTAL) mat = 0.6; - if (mc_Entity.x == WISPJELLY) lmtexcoord.z = 0.0; + if (mc_Entity.x == WISPJELLY || currentRenderedItemId== WISPJELLY) lmtexcoord.z = 0.0; #if defined ENTITIES && defined IS_IRIS NAMETAG = 0; diff --git a/shaders/lang/en_us.lang b/shaders/lang/en_us.lang index 2140dd9..9df605b 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 = 8.3.0 + value.SHADER_VERSION_LABEL.482 = 8.3.1 iris_extension.keybind.key0.name=Flashlight diff --git a/shaders/lang/zh_cn.lang b/shaders/lang/zh_cn.lang index 7082ed7..f584d65 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 = 8.3.0 + value.SHADER_VERSION_LABEL.482 = 8.3.1 # 如果你是来翻译的,这不是玩笑,这些选项的功能正如其名 profile.POTATO=§4土豆 (极低配置) diff --git a/shaders/lib/specular.glsl b/shaders/lib/specular.glsl index 1c78ec4..acf112a 100644 --- a/shaders/lib/specular.glsl +++ b/shaders/lib/specular.glsl @@ -2337,6 +2337,8 @@ vec3 specularReflections( mat3 basis = CoordBase(normal); vec3 viewDir = -NplayerPos*basis; + viewDir.z = abs(viewDir.z); + #if defined FORWARD_ROUGH_REFLECTION || defined DEFERRED_ROUGH_REFLECTION vec3 samplePoints = SampleVNDFGGX(viewDir, roughness, noise.xy); vec3 reflectedVector_L = basis * reflect(-normalize(viewDir), samplePoints);