fix(client): cutaway cuts the camera-character sightline corridor, not a proximity dome (T-1088)

Live-session finding: the half-disc cut bit nearby side walls while leaving
the wall actually occluding the character at full height, with dome-contour
scallops across the two-row walls. Rewritten as a sightline corridor: walls
within CUT_CORRIDOR_HALF_W of the character's x, camera-side, out to a
pitch-derived reach (WALL_H / tan(pitch) — how far a wall can still occlude
in ortho; ~4.3 m at -30, breathes with the T-cycle tilt) drop to the stub.
FollowCamera3D exposes pitch_deg(); reach clamped 0.5-16 m.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-06 19:01:49 +02:00
co-authored by Claude Fable 5
parent b09a50efbf
commit 2db7dd25e1
7 changed files with 111 additions and 38 deletions
+8 -5
View File
@@ -188,7 +188,7 @@ func _ready() -> void:
# the shader defaults mirror them only for standalone/editor use.
_wall_material.set_shader_parameter("u_wall_h", SandboxConstants.WALL_H)
_wall_material.set_shader_parameter("u_cut_height", SandboxConstants.CUT_HEIGHT)
_wall_material.set_shader_parameter("u_cut_radius", SandboxConstants.CUT_RADIUS)
_wall_material.set_shader_parameter("u_corridor_half_w", SandboxConstants.CUT_CORRIDOR_HALF_W)
_wall_material.set_shader_parameter("u_cut_band", SandboxConstants.CUT_BAND)
_wall_mm = _make_layer("WallMM", wall_mesh, _wall_material)
@@ -217,11 +217,14 @@ func get_store_size() -> int:
## Per-frame cutaway anchor (design §8): pass the rig's INTERPOLATED
## world-space position (PlayerRig.global_position — it already carries the
## 45 deg WorldRoot rotation, matching the shader's world-space test) so the cut
## zone glides with the character and spatial smoothstep becomes temporal
## smoothness. One uniform write per frame — the entire CPU cost.
func set_cutaway_char_pos(world_pos: Vector3) -> void:
## 45 deg WorldRoot rotation, matching the shader's world-space test) plus the
## pitch-derived corridor reach (WALL_H / tan(camera pitch) — how far south a
## WALL_H wall can still occlude the character in ortho). The cut corridor
## glides with the character and breathes with the tilt; two uniform writes
## per frame — the entire CPU cost.
func set_cutaway_char_pos(world_pos: Vector3, reach_m: float) -> void:
_wall_material.set_shader_parameter("u_char_pos_xz", Vector2(world_pos.x, world_pos.z))
_wall_material.set_shader_parameter("u_cut_reach", reach_m)
func _make_layer(layer_name: String, mesh: Mesh, material: ShaderMaterial) -> MultiMeshInstance3D: