Skip to content

R-14: look pack — AO, bevel, palette v2, --bare, capacity#441

Open
mrtlvmbt wants to merge 2 commits into
render-r12-terragen-previewfrom
r14-look-pack
Open

R-14: look pack — AO, bevel, palette v2, --bare, capacity#441
mrtlvmbt wants to merge 2 commits into
render-r12-terragen-previewfrom
r14-look-pack

Conversation

@mrtlvmbt

Copy link
Copy Markdown
Owner

Summary

R-14 visual centerpiece: toy-diorama hex terrain with soft AO, subtle bevel, palette v2 two-factor coloring, and per-kind capacity management.

What landed

  • Palette v2: two-factor color = material HUE × height VALUE + per-column jitter

    • Covers ALL material bytes 0–10 (added SoilDry/SoilWet)
    • Deterministic per-column ±4% variation via integer hash
  • Per-vertex AO: baked into vertex colors at mesh build

    • Darkens top-face corners by count/height of strictly-higher neighbors
    • No shader changes; works identically on both render paths
  • Top bevel: chamfer ring on hex prisms (~12 tris/cell)

    • Shrink top hexagon by BEVEL_FRAC (0.12), emit 6 chamfer quads
    • Slightly tilted normals for light catch
  • Bare mode (--bare): water renders as dry-bed sand

  • Capacity management: per-kind VERTS_PER_CELL_MAX + hard asserts

    • Hex: ~54 verts/cell → ~1111 cells per chunk at 60k soft budget
    • Hard asserts at build: chunk_verts < 60_000 && chunk_indices < 120_000

Acceptance status

  • ✓ Compile: PASS (scripts/compile-check.sh from v2/crates/render)
  • ✓ Both render paths updated (macroquad + retained GPU buffers)
  • ⏳ Screenshot verification: PENDING (local cargo run blocked by no-local-sim guard)
  • ⏳ HEIGHT_SCALE variants: 0.2/0.3/0.4 screenshots for user to pick

Code changes

biome_palette.rs

  • Added materials 9, 10 (SoilDry, SoilWet)
  • Implemented surface_color_v2(): two-factor palette with integer hash jitter
  • Added color_jitter_hash()

terrain.rs

  • Added BEVEL_FRAC, VERTS_PER_CELL_MAX constants
  • Implemented calculate_vertex_ao(): per-corner AO calculation
  • build_hex_terrain(): accepts seed, bare_mode parameters
  • build_chunk(): bakes AO into top-face vertices, emits bevel quads (6 per cell)
  • Hard capacity asserts (60k verts / 120k indices)

terrain_cube.rs

  • Updated signatures for seed, bare_mode parameters
  • Updated color calculation to use surface_color_v2()
  • Updated test calls

main.rs

  • Added --bare and --height-scale CLI flags
  • Updated all terrain build calls to pass seed + bare_mode

Closes #440

mrtlvmbt and others added 2 commits July 14, 2026 11:09
… asserts

Core implementation of the look pack features:
- Palette v2: two-factor coloring (material hue × height value + jitter)
- Per-vertex AO: darken vertices by neighbor height differences
- Top bevel: chamfer ring on hex prisms for toy-diorama feel
- Bare mode: water renders as dry-bed sand
- Material support: added SoilDry (9) and SoilWet (10) to palette
- Per-kind capacity: VERTS_PER_CELL_MAX + hard asserts (60k/120k)
- CLI flags: --bare for bare mode, --height-scale for variants

Both hex and cube paths updated; capacity checks in place.
Compiles cleanly with render workspace (v2/crates/render).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KSFzwj8cXU3wLePgNZWAra
R-14 look pack features implemented and compiling.
Blocked on local rendering (no-local-sim guard); pending screenshot verification.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KSFzwj8cXU3wLePgNZWAra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant