v0.4.12: single-sided anchor quad (drop back face)
Some checks failed
build / build (push) Has been cancelled
Some checks failed
build / build (push) Has been cancelled
The anchor sits flush against a wall by design, so the back face never gets a viewer. Drawing it cost an extra 4 vertices and doubled the fragment shader work for the video texture per anchor for no visible benefit. Removing it also fixes the mirrored-texture artifact a player would see if they clipped behind the wall (e.g. spectator mode). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -76,16 +76,14 @@ public class VideoAnchorRenderer implements BlockEntityRenderer<VideoAnchorBlock
|
||||
final Matrix4f mat = new Matrix4f(pose.last().pose());
|
||||
RenderType rt = RenderTypes.entityCutout(tex);
|
||||
collector.submitCustomGeometry(pose, rt, (poseUnused, vc) -> {
|
||||
// Front face (visible from outside, looking back at the wall)
|
||||
// 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
|
||||
// per anchor and removes the mirrored-texture artifact a player would see if they
|
||||
// somehow clipped behind the wall.
|
||||
emit(vc, mat, 0F, 0F, 0F, 0F, 1F, light);
|
||||
emit(vc, mat, w, 0F, 0F, 1F, 1F, light);
|
||||
emit(vc, mat, w, h, 0F, 1F, 0F, light);
|
||||
emit(vc, mat, 0F, h, 0F, 0F, 0F, light);
|
||||
// Back face (in case the player ends up on the other side, e.g. clipping into the wall)
|
||||
emit(vc, mat, 0F, h, 0F, 0F, 0F, light);
|
||||
emit(vc, mat, w, h, 0F, 1F, 0F, light);
|
||||
emit(vc, mat, w, 0F, 0F, 1F, 1F, light);
|
||||
emit(vc, mat, 0F, 0F, 0F, 0F, 1F, light);
|
||||
});
|
||||
|
||||
pose.popPose();
|
||||
|
||||
Reference in New Issue
Block a user