Files
jyviko f2051e5a3a Viewport: zebra direction and width, a values map, two-sided lighting (#15935)
* Viewport: zebra bars along a direction with a white share, a map coloured by vertex values, and two-sided PBR materials

- Zebra { stripes, direction, width }: the reflected bars run along `direction` (the stripe follows
  the reflected ray across them) and each is white for `width` of its period (0.05..0.95). The
  engine passes +Z and 0.5, so SolidCraft's picture does not change; the straight-ahead white of
  #2153 stays.
- Values { low, high }: a mesh coloured by a value at each vertex on the curvature colours' ramp
  (low flat, high tight); SceneMesh::values carries them. A triangle vertex record grows one word
  (TRI_SIZE 32): the value's bits after the palette index (TRI_COLOR_AT 24, TRI_VALUE_AT 28),
  NO_VALUE for none; BlockBuilder::triangle_values and GpuScene::{tri,open_tri,glass_tri}_value
  write them. Built triangles read it in vs_tri; display-plan vertices have their own entry,
  vs_tri_planned, with none. A face without values in Values is coloured as the curvature map at
  1 mm.
- Material::two_sided: fs_pbr lights a face's back as its front where the eye sees the back (an
  open sheet's other side). Off by default, so solid bodies render as before.

Tests: the zebra's bars along X turn the stripes a quarter turn on a sphere against upright bars,
and a white share of 0.8 shows more white than 0.2 (gpu capture); a quad with values -1..1 ramps
flat, middle, tight; a PBR back face black one-sided and lit two-sided; a triangle's values after
its colour and NO_VALUE without. Tests that read a vertex's colour read it at 24..28.
Not built or run locally (CI is the check).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Viewport analysis: rustfmt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Viewport analysis tests: the 32-byte vertex where tests counted 28, and the analysis pictures read where the camera draws

- The tests that counted triangle bytes by 28 (the cut preview's x-ray tool, the origin planes'
  x-ray, the render preview's geometry size message) count by TRI_SIZE: the vertex record is 32
  bytes since the value word (192 MiB for 2^21 triangles, 3 x 6 vertices a plane).
- The analysis shader's literal list loses the +Z bar direction, which now comes from the uniform.
- The analysis captures found the quad and the sphere by an assumed framing (40 mm on 200 px);
  the front camera at distance 62.5 shows more, so the values test read background at its
  sample points and the white-share test counted the light background as white. They now place
  their samples with the camera's own projection (Camera::to_screen) and count on the sphere only.
Not built or run locally (CI is the check).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 09:03:45 +00:00
..