refactor: remove the legacy full view_proj (CPU cull now relative-to-eye)

The GPU draws exclusively via the rotation-only `view_rot` + eye double-
single; the full view-projection survived only to project AABBs in the
CPU frustum-cull / scissor / LOD passes. Migrate those to the same
relative-to-eye math (project `point - eye` through `view_rot`) — pixel-
equivalent but precise at UTM scale — then drop the dead uniform:

- pipeline cull/scissor/LOD helpers take (view_rot, eye) instead of the
  full view_proj; render.rs reconstructs eye from the uniform's
  eye_high/eye_low and passes the cropped view_rot.
- Remove the `view_proj` field from the shared Uniforms struct and all six
  shader structs that only declared it for layout (none read it), and
  delete Camera::view_proj(). The struct shrinks by one mat4 on both
  sides, keeping the Rust / WGSL layouts in lock-step.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan SevenandClaude Opus 4.8 committed 2026-06-24 20:14:41 +03:00
1 parent 5a8ec35f4f
commit 04c93df2c4
10 files changed
+57 -80

No files matched your search

-1
View File
@@ -5,7 +5,6 @@
// color [f32; 4] offset 12 16 B
struct Uniforms {
view_proj: mat4x4<f32>,
viewport_size: vec2<f32>,
world_per_pixel: f32,
lwdisplay_enable: f32,
-1
View File
@@ -13,7 +13,6 @@
// ── Group 0: frame uniforms (shared) ──────────────────────────────────────
struct Uniforms {
view_proj: mat4x4<f32>,
viewport_size: vec2<f32>,
world_per_pixel: f32,
lwdisplay_enable: f32,
-1
View File
@@ -18,7 +18,6 @@
// ── Group 0: shared frame uniforms (matches hatch.wgsl) ──────────────────
struct Uniforms {
view_proj: mat4x4<f32>,
viewport_size: vec2<f32>,
world_per_pixel: f32,
lwdisplay_enable: f32,
-1
View File
@@ -4,7 +4,6 @@
// ── Bind group 0: shared projection uniforms ─────────────────────────────────
// Must match the shared `Uniforms` struct (scene::pipeline::uniforms, 112 B).
struct Uniforms {
view_proj: mat4x4<f32>,
viewport_size: vec2<f32>,
world_per_pixel: f32,
lwdisplay_enable: f32,
-1
View File
@@ -10,7 +10,6 @@
// flat shade (FlatShaded).
struct Uniforms {
view_proj: mat4x4<f32>,
viewport_size: vec2<f32>,
world_per_pixel: f32,
lwdisplay_enable: f32,
-1
View File
@@ -14,7 +14,6 @@
// • pat0/pat1 encode up to 8 elements: positive=dash, negative=gap.
struct Uniforms {
view_proj: mat4x4<f32>,
viewport_size: vec2<f32>,
world_per_pixel: f32,
// LWDISPLAY toggle: 0.0 = force 1 px (half_width 0.5), 1.0 = use the