diff --git a/gradle.properties b/gradle.properties index 48039a3..7d7815a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ org.gradle.configuration-cache=false # Mod mod_id=video_player -mod_version=0.4.22 +mod_version=0.4.23 maven_group=com.ejclaw.videoplayer archives_base_name=video_player diff --git a/src/main/java/com/ejclaw/videoplayer/client/render/VideoAnchorRenderer.java b/src/main/java/com/ejclaw/videoplayer/client/render/VideoAnchorRenderer.java index e27b238..c2a6b83 100644 --- a/src/main/java/com/ejclaw/videoplayer/client/render/VideoAnchorRenderer.java +++ b/src/main/java/com/ejclaw/videoplayer/client/render/VideoAnchorRenderer.java @@ -31,8 +31,19 @@ import org.joml.Matrix4f; @Environment(EnvType.CLIENT) public class VideoAnchorRenderer implements BlockEntityRenderer { - /** Tiny outward offset so the quad doesn't z-fight with the wall. */ - private static final float SURFACE_EPSILON = 0.001F; + /** + * Outward offset so the quad doesn't z-fight with the wall it sits on. + * + *

Depth-buffer precision drops with the square of view distance: with near=0.05 and + * 24-bit depth, the smallest resolvable step at 30 blocks is ~1mm, and ~12mm at 100 + * blocks. The old 0.001 (1mm) offset was right at the precision boundary at ~30 blocks + * — which is exactly the distance users started seeing the wall texture flicker through + * the video panel once {@code render_distance_blocks} was raised past the default. + * + *

2cm gives ~20× margin at 30 blocks and is still visually unnoticeable up close + * (~3% of a block thickness). + */ + private static final float SURFACE_EPSILON = 0.02F; public VideoAnchorRenderer(BlockEntityRendererProvider.Context ctx) { // no-op @@ -75,7 +86,12 @@ public class VideoAnchorRenderer implements BlockEntityRenderer { // Single-sided: the back of the anchor is by design pressed against the wall the // player clicked, so a back face is pure GPU waste. Halves the fragment shader work