From 0e03cac3685af239e6491784a5ee3ca9a4390fb8 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Wed, 28 Oct 2026 06:10:38 +0100 Subject: [PATCH 1/2] Draw faint entity shadows instead of cutting them out Shadows used the entity fragment shader, which discards alpha under 0.1, so they vanished at block light 7 and below and faded out a few blocks away. rendertype_entity_shadow.fsh has no cutout. --- crates/horizon-client/src/entity.wgsl | 10 ++++++++++ crates/horizon-client/src/gfx.rs | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/entity.wgsl b/crates/horizon-client/src/entity.wgsl index 919c5edbb..b674b0941 100644 --- a/crates/horizon-client/src/entity.wgsl +++ b/crates/horizon-client/src/entity.wgsl @@ -263,6 +263,16 @@ fn crumbling_uv(uv: vec2, packed_origin: vec2, sprite_size: vec2, // rendertype_outline.fsh: the vertex colour (the team colour; outline vertices carry no // normal, so no cardinal light) wherever the texture is not fully clear. +// rendertype_entity_shadow.fsh: the shadow texture times the vertex colour, +// then fog, with no alpha cutout, so a faint shadow in dim light still draws. +@fragment fn fs_entity_shadow(in: Out) -> @location(0) vec4 { + var color = textureSample(atlas, atlas_sampler, in.uv) * in.color; + color *= in.light_color; + let f = max(linear_fog(in.spherical, globals.fog.x, globals.fog.y), + linear_fog(in.cylindrical, globals.fog.z, globals.fog.w)); + return vec4(mix(color.rgb, globals.fog_color.rgb, f * globals.fog_color.a), color.a); +} + @fragment fn fs_outline(in: Out) -> @location(0) vec4 { if textureSample(atlas, atlas_sampler, in.uv).a == 0.0 { discard; } return vec4(in.color.rgb, 1.0); diff --git a/crates/horizon-client/src/gfx.rs b/crates/horizon-client/src/gfx.rs index beb8b9060..367172eec 100644 --- a/crates/horizon-client/src/gfx.rs +++ b/crates/horizon-client/src/gfx.rs @@ -1966,7 +1966,7 @@ impl Renderer { // ulps covers that spread at any resolution while staying far below // the 0.001 a model's feet sit higher, so shadows never bleed onto // the feet. - let shadow_blob_pipeline = entity_pipeline( + let shadow_blob_pipeline = entity_pipeline_with( "Entity shadows", None, false, @@ -1978,6 +1978,8 @@ impl Renderer { }, alpha_blend, false, + "fs_entity_shadow", + wgpu::ColorWrites::ALL, ); // RenderPipelines.ITEM_TRANSLUCENT: blended, depth tested. Drawn before // translucent terrain, it cannot write depth: the water behind a From 012a3cf9081f901dd6aa46142baafe4053ef3752 Mon Sep 17 00:00:00 2001 From: Kacpherek Date: Wed, 28 Oct 2026 06:10:38 +0100 Subject: [PATCH 2/2] Use the End's ambient light for entity shadows DimensionType.ambientLight is 0.25 in the End; shadows used 0, so they were weaker there. --- crates/horizon-client/src/game.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index c97af3a47..990dac12b 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -8005,7 +8005,12 @@ impl Game<'_> { .then(|| self.gui.atlas.sprites.get("misc/shadow").copied()) .flatten(); if let Some(sprite) = shadow_sprite { - let ambient = if self.dim == Dim::Nether { 0.1 } else { 0.0 }; + // DimensionType.ambientLight: the_nether 0.1, the_end 0.25. + let ambient = match self.dim { + Dim::Nether => 0.1, + Dim::End => 0.25, + Dim::Overworld => 0.0, + }; let darken = self.sky_darken(); let a = alpha; let lerp = |p: Vec3, q: Vec3| {