Skip to content

feat(gfx): per-plant flora size, placement & tint variation (#675) - #676

Merged
marceld23 merged 1 commit into
mainfrom
feat/flora-size-variation
Aug 2, 2026
Merged

feat(gfx): per-plant flora size, placement & tint variation (#675)#676
marceld23 merged 1 commit into
mainfrom
feat/flora-size-variation

Conversation

@marceld23

Copy link
Copy Markdown
Owner

Summary

All flora of a species rendered identically — solid flora (cactus/crystal/mushroom/...) stamped the same full-cell shape for every individual, and cross-billboard plants sat dead-centre on the grid with one fixed rosette orientation, their per-cell triangular jitter averaging back to a uniform carpet at viewing distance.

Everything below is client-only (ChunkMesher.cs, BlockTextureAtlas.cs), derived from pure world-position hashes: deterministic across clients and remeshes, zero protocol/save changes, applies to existing worlds. The block footprint stays exactly one cell.

  • A — Solid flora scale + squash: per-column bell x rare outliers (~0.45..1.0 overall) plus an independent height-vs-radius squash; shrink-only, anchored at the cell-floor centre. AddShapedBlock gained optional sizeXZ/sizeY and scales face coords BEFORE emission, so normals/tangents derive from final geometry and the collider (same verts) matches the visual. Player-built shapes pass 1/1 and stay exact.
  • B — De-grid: per-plant XZ offset (+/-0.13; AddCrossPlant re-clamps the rosette half-width by the offset magnitude so the floor line stays inside the cell) + rosette spin (+/-30 deg). Keyed per COLUMN (wy = 0) so stacked kelp/vine strands stay one straight, consistently-rotated strand.
  • C — Visible distribution: FloraScale blends the fine per-cell bell 50/50 with a coarse 8x8-cell patch hash (meadows form patches of tall and short growth — the scale the eye actually registers); FloraOutlier adds ~5 % giants (x1.4-1.6) and ~8 % runts (x0.5-0.65), keyed per column so an outlier is outsized in every dimension. Torches stay fully exempt.
  • D — Tint jitter: +/-8 % per-column brightness wobble on the species tint, gated to flora_* keys (tree leaves/logs untouched) and kept small so species identity incl. toxic-colour recognition stays readable.
  • E — Flora variant tiles: the atlas variant mechanism (previously 8 ground blocks) now also paints 2 silhouette-aware variants for 8 signature flora species — variant A sparser/darker (erodes ~40 % of cutout-alpha BOUNDARY pixels; skipped for opaque solid-flora tiles where a zeroed pixel would render black), variant B lighter/warmer. 16 more of the 256 atlas slots (~150 used); flora slots fill AFTER the ground ones so long-shipped variant slot positions are unchanged, with the same graceful capacity guard.

Verification

  • dotnet build -c Release: 0 warnings.
  • Non-Slow test suite: 1343 server + 147 client passed, 0 failed.
  • Local Unity Windows player build from this branch: succeeded (client/Assets changed).

closes #675

🤖 Generated with Claude Code

All flora of a species rendered identically: solid flora stamped the same
full-cell shape for every individual, and cross-billboard plants sat
dead-centre on the grid with one fixed rosette orientation, their
triangular per-cell jitter averaging back to a uniform carpet.

- Solid flora: per-column bell x rare outliers (~0.45..1.0) plus a
  height-vs-radius squash; shrink-only, collider scales with the visual
  (AddShapedBlock sizeXZ/sizeY, building shapes pass 1/1 and stay exact).
- De-grid: per-plant XZ offset (width re-clamped inside the cell) and
  rosette spin, keyed per column so kelp/vine strands stay straight.
- Visible distribution: FloraScale blends the fine bell 50/50 with a
  coarse 8x8-cell patch hash (meadows form tall/short patches);
  FloraOutlier adds ~5 % giants and ~8 % runts. Torches stay exempt.
- Tint jitter: +/-8 % per-column wobble on the species tint (flora_* only).
- Atlas: silhouette-aware variant tiles (sparser/darker via cutout-alpha
  edge erosion; lighter/warmer) for 8 signature flora species; flora slots
  fill after the ground ones so shipped variant positions are unchanged.

Client-only, pure world-position hashes: deterministic across clients and
remeshes, no protocol/save changes, applies to existing worlds.

Closes #675

Co-Authored-By: Claude Fable 5 <[email protected]>
@marceld23
marceld23 merged commit 0872738 into main Aug 2, 2026
12 checks passed
@marceld23
marceld23 deleted the feat/flora-size-variation branch August 2, 2026 22:32
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.

Flora reads uniform: per-plant size variation for billboards + solid flora (scale, de-grid, patches, tint, variant tiles)

1 participant