Skip to content

Visual: add procedural biome grass and wind#55

Closed
ael-dev3 wants to merge 2 commits into
mainfrom
agent/procedural-biome-grass-wind
Closed

Visual: add procedural biome grass and wind#55
ael-dev3 wants to merge 2 commits into
mainfrom
agent/procedural-biome-grass-wind

Conversation

@ael-dev3

Copy link
Copy Markdown
Owner

Scope and branch boundary

What changed

  • Replaced the sparse CPU-matrix-animated green-tuft / dry-tuft path with deterministic procedural, low-poly instanced grass; static stones remain a separate bounded detail family.
  • Added renderer-neutral macro/meso value noise, deterministic stratified scatter, biome profiles, complete bare patches, terrain tinting, slope thinning, placement clearance, permanent castle-slot suppression, and generic feature-root exclusion circles.
  • Added camera-local active windows, LRU cell data, deterministic rank thinning, fixed-capacity instance pools, opaque edge shrink/fade, and per-quality hard ceilings.
  • Added a MeshStandardMaterial.onBeforeCompile GPU-wind path pinned to the Three r185 shader hook with a stable cache key, fail-closed contract fallback, planted root flex, max-sway bounds, and no grass raycasting.
  • Added selected-cell (42%) and hovered-cell (70%) shader flattening; ordinary motion interpolates uniforms and reduced motion settles immediately.
  • Replaced the 180 ms CPU wind timer with a demand-driven, rAF-aligned scheduler: High 24 fps, Balanced 16 fps, Reduced static; overview, hidden tabs, reduced motion, and disposal stop animation.
  • Added bounded grass telemetry, including terrain-kind counts, without individual positions or player data.

Biome policy

Biome High candidates/cell Complete-bare threshold
Meadow 30 0.12
Lowland 24 0.20
Forest 20 0.32
Heath 14 0.47
Ridge 4 0.84
Ancient Stone 2 0.96
Lake 0 1.00
Render apron 5 0.65

Balanced uses 0.62x candidate density and Reduced uses 0.25x, with deterministic rounding.

Fixed runtime ceilings

Quality Active clumps Triangles Draws Radius Wind
High <=14,000 <=210,000 1 12 cells 24 fps
Balanced <=7,000 <=84,000 1 9 cells 16 fps
Reduced <=2,000 <=18,000 1 6 cells static

Wind updates material uniforms only. Focused regression coverage proves no setMatrixAt or instanceMatrix.needsUpdate work occurs during wind steps; matrices update only on active-window repack.

Canonical 10,000-cell evidence

The new canonical-surface test runs against 10,000 playable / 10,981 rendered cells. At the center High keep window it attests:

  • 469 active candidate cells; 397 cached cells; 1,880 packed clumps; 28,200 grass triangles; one draw call.
  • presentation digest (packed matrices + phases): d096966756353ad1d09c90c68ef51a23a6348dc8b8105b638a47a624844401c3.
  • overview has zero detailed grass; traversal stays below the 2,048-cell cache and all High allocation ceilings.

Verification

Passed:

  • tsc -b
  • full Vitest: 153 files / 1,504 tests
  • ordinary production build, runtime-asset and Gold Mine candidate verification, production-output exclusions
  • file-size and license policy verification
  • canonical Pages-style build and Pages configuration validation with shared alpha disabled
  • focused deterministic noise/generation, geometry, shader, active-window, layer, lifecycle, scheduler, and canonical-Genesis tests

Not completed locally:

  • rendered WebGL browser QA failed closed before launch because the required local authorized castle source archive is unavailable; no screenshots/video are claimed.
  • production alpha attestation could not reach https://warpkeep.com from this environment.
  • CodeQL and dependency-audit binaries are not installed locally; hosted CI remains the authoritative gate.

Non-goals and residual risks

No SpacetimeDB schema/binding/reducer change, gameplay authority/resource/collision/pathfinding change, deploy, Pages publish, backend publish, tag, release/version claim, or merge occurred.

Density and color remain provisional art-direction values; browser thermal behavior needs continued observation. Grass is decorative and does not react physically to units. Future reviewed structures must supply generic exclusion circles. The shader hook remains intentionally coupled to pinned Three r185, and full-Realm overview intentionally omits individual grass.

@ael-dev3

Copy link
Copy Markdown
Owner Author

Superseded by the audited Alpha 0.3.11 integration in #64, now merged to protected main. Accepted work was reconciled, corrected where needed, and validated there; this original branch is intentionally not merged again.

@ael-dev3 ael-dev3 closed this Jul 19, 2026
@ael-dev3
ael-dev3 deleted the agent/procedural-biome-grass-wind branch July 19, 2026 02:19
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