Skip to content

Commit d92c537

Browse files
TMHSDigitalclaude
andcommitted
fix(showcase): terrain-scatter second quality pass, with three new budgets
The tile read as a slice of cake with pebbles dropped on it. - Stones were seated by one dirt sample at their centre, which left daylight under the downhill side: no stone was sealed in more than 6 of 8 azimuth sectors. Each stone now samples the ground under every vertex and sinks until every sector holds a buried vertex (exit 21, --perch-rocks). - All nine stones were within ~20% of one size. STONE_SIZES gives each a factor from 0.55 to 1.45 and the relaxation spaces pairs by their own bounds (footprint ratio 9.81 >= 3.0, exit 22, --uniform-rocks). - The hill met the walls at a knife edge. The rim is bevelled in four segments, bounded by the step in normal elevation (33.5 <= 40 deg, exit 23, --sharp-rim). - Two closed-form micro-relief terms in the GN tree; hill smooth-shaded; stones mid-grey; dirt darkens to subsoil down the walls. Base tris 1758 -> 2398. The collider hulls a coarse unbevelled tile (36). The outer AABB was re-fitted from 0.584 to 0.570 m. Same results on 4.5.11, 5.1.2 and 5.2.1. Includes the asset sheet. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: TMHSDigital <154358121+TMHSDigital@users.noreply.github.com>
1 parent ca285b3 commit d92c537

8 files changed

Lines changed: 619 additions & 120 deletions

File tree

33.8 KB
Loading
-1.84 KB
Loading
-748 Bytes
Loading

‎docs/gallery/terrain-scatter/index.html‎

Lines changed: 286 additions & 59 deletions
Large diffs are not rendered by default.

‎showcase/gallery.json‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@
101101
{
102102
"name": "terrain-scatter",
103103
"dir": "showcase/terrain-scatter",
104-
"teaches": "A Geometry Nodes hill tile with seated icosphere scatter through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.",
105-
"alt": "A square tile of dark rolling earth with nine faceted grey rocks seated across the hill, none touching.",
106-
"witnessesFix": "Recomputed: 1758 tris, two materials with 720 stone faces, UVs in 0..1 with zero AABB overlap, outer AABB 1.800×1.800×0.552 m, grounded zmin, 9 stones of ≥80 faces seated on sampled dirt Z (offset −35 mm, floor zmin 0.113 m), LOD ratios in band, convex collider 81 tris, hygiene zero, non-empty glTF. --skip-decimate exits 9; --stray-vert 15; --lift-z 16; --poke-rock 17; --float-rocks 18; --box-rocks 19.",
104+
"teaches": "A Geometry Nodes hill tile with embedded, varied stone scatter through UVs, bake, LOD, collider, and Unity glTF, asserting recomputed budgets rather than an API contract.",
105+
"alt": "A square tile of dark rolling earth with a rounded edge, nine faceted grey stones from cobble to boulder sunk into the ground across the hill.",
106+
"witnessesFix": "Recomputed: 2398 tris, two materials with 720 stone faces, UVs in 0..1 with zero AABB overlap, outer AABB 1.800x1.800x0.570 m, grounded zmin, 9 stones of >=80 faces each sealed into the ground in 8/8 sectors, footprint ratio 9.8, rim tilt step 33.5 deg, no stone pairs overlapping, LOD ratios in band, convex collider 36 tris, hygiene zero, non-empty glTF. --skip-decimate exits 9; --stray-vert 15; --lift-z 16; --poke-rock 17; --float-rocks 18; --box-rocks 19; --pile-rocks 20; --perch-rocks 21; --uniform-rocks 22; --sharp-rim 23.",
107107
"hero": "docs/gallery/assets/terrain-scatter-hero.webp",
108108
"preview": "showcase/terrain-scatter/preview.webp",
109109
"tags": [

‎showcase/terrain-scatter/README.md‎

Lines changed: 69 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ replaced by closed-form cleaved, faceted stones seated on sampled dirt Z,
66
then the shipped pipeline: unique-cell UVs, Cycles high-to-low normal
77
bake, LOD chain, convex collider, Unity glTF export.
88

9-
GN still builds the hill and the instance grid. After realize+slabify,
10-
cube islands are deleted and each centroid is reseated: stone `zmin`
11-
equals sampled dirt Z minus a named bite, then verts clamp above the
12-
slab floor. That is why rocks sit on the hill instead of punching
13-
through the slab as bevelled crates.
9+
GN still builds the hill, with two closed-form micro-relief terms on top
10+
of the sine, and the instance grid. After realize+slabify, whose rim is
11+
bevelled into the walls, cube islands are deleted and each centroid is
12+
reseated as a sized stone, sunk until the ground closes around it on
13+
every side, then clamped above the slab floor.
1414

1515
It asserts **budget conformance** of the generated result. It does not
1616
witness an API contract. "It rendered without error" is not a check.
@@ -24,7 +24,8 @@ imported as a package). Hygiene combinatorics match
2424
`examples/mesh-hygiene-audit` (copied, not imported).
2525

2626
Intended size: 1.80 m square hill tile, ~0.16 m sine amplitude, nine
27-
seated stones; outer AABB 1.800 × 1.800 × 0.584 m.
27+
embedded stones from cobble to boulder; outer AABB 1.800 × 1.800 ×
28+
0.570 m.
2829

2930
## Budgets
3031

@@ -33,20 +34,28 @@ materials, UVs, evaluated LOD, collider, or export file.
3334

3435
| Axis | Declared | Measured (4.5.11 / 5.1.2 / 5.2.1) |
3536
| --- | --- | --- |
36-
| Base triangles | 1400–2800 | 1758 / 1758 / 1758 |
37-
| LOD1 ratio | 0.32–0.62 of base | 0.4994 / 0.4994 / 0.4994 |
38-
| LOD2 ratio | 0.10–0.35 of base | 0.2196 / 0.2196 / 0.2196 |
37+
| Base triangles | 1400–2800 | 2398 / 2398 / 2398 |
38+
| LOD1 ratio | 0.32–0.62 of base | 0.4996 / 0.4996 / 0.4996 |
39+
| LOD2 ratio | 0.10–0.35 of base | 0.2193 / 0.2193 / 0.2193 |
3940
| Materials | exactly 2 distinct, ≥24 stone faces | 2 slots, 720 stone |
4041
| UVs | in `0..1`, AABB overlap ≤ 1e-5 | in range, overlap 0 |
41-
| Outer AABB | (1.800, 1.800, 0.584) m ± 0.015 | (1.8000, 1.8000, 0.5838), zmin 0 |
42-
| Collider tris | ≤ 120 | 72 |
43-
| Export | written, size > 0 | 157476 / 157476 / 157460 bytes |
42+
| Outer AABB | (1.800, 1.800, 0.570) m ± 0.015 | (1.8000, 1.8008, 0.5700), zmin 0 |
43+
| Collider tris | ≤ 120 | 36 |
44+
| Export | written, size > 0 | 199496 / 199496 / 199480 bytes |
4445

45-
Base triangles rose from **1194 to 1758** in the quality pass: 9-vert hill
46+
Base triangles rose from **1194 to 1758** in the first quality pass: 9-vert hill
4647
became a 21-vert grid, and bevelled cubes became subdiv-2 icospheres.
4748
Outer Z dropped from 0.655 m (crate corners swinging through the slab)
4849
to 0.552 m of seated stone on the hill.
4950

51+
The second pass took them from **1758 to 2398**: the four-segment rim
52+
bevel adds 640. The outer Z moved from 0.584 m to 0.570 m, because the
53+
stones now sink into the ground rather than perch on it, and the
54+
declared size was re-fitted to match. The collider fell from 72 to 36
55+
triangles because it now hulls a coarse, unbevelled 9-vertex tile
56+
(`COLLIDER_GRID`): the chamfer and micro-relief are visual, and on the
57+
full-resolution tile they pushed the hull to 178, over its ceiling.
58+
5059
DECIMATE COLLAPSE triangle counts are **not** guaranteed identical across
5160
series — the gate is a ratio band, not an exact count. This mesh matched
5261
on 4.5.11 / 5.1.2 / 5.2.1. Bake pixels are stochastic; the gate is
@@ -70,9 +79,12 @@ Recomputed from the generated mesh, not asserted about the script.
7079
| Grounded: `zmin` | within 1e-4 of 0 | 0.0000 |
7180
| Stone shells | 9 | 9 |
7281
| Per-stone faces | ≥ 40 | 80 |
73-
| Stone floor `zmin` | ≥ 0.012 m | 0.11112 |
74-
| Seat offset (`zmin` − dirt Z) | ≤ 0.02 m | −0.00745 |
82+
| Stone floor `zmin` | ≥ 0.012 m | 0.06946 |
83+
| Seat offset (`zmin` − dirt Z) | ≤ 0.02 m | −0.03326 |
7584
| Interpenetrating stone pairs (BVH overlap) | 0 | 0 |
85+
| Sealed sectors per stone (buried vertex in each of 8) | 8 / 8 | 8 / 8 |
86+
| Stone footprint ratio (largest / smallest) | ≥ 3.0 | 9.812 |
87+
| Rim tilt step between adjacent dirt faces | ≤ 40° | 33.52° |
7688

7789
### Why the stones are cleaved, relaxed and faceted
7890

@@ -98,9 +110,40 @@ also interpenetrated, because the GN scatter jitters by up to 0.22 m on a
98110
- **Materials.** Dark mottled soil and grey weathered stone, with
99111
roughness and a small bump from fine object-space noise.
100112

113+
### Why the stones are sunk, sized, and the rim is rounded
114+
115+
The second pass inspected the tile in clay, wire, six orthos and
116+
ground-contact close-ups, and found the tile read as a slice of cake
117+
with pebbles dropped on it.
118+
119+
- **Sealed.** Stones were seated by sampling the dirt once, at the
120+
stone's centre, and biting the lowest point 35 mm below it. On the
121+
hill's slopes that left daylight under the downhill side: measured
122+
around each stone in 8 azimuth sectors, no stone had a buried vertex in
123+
more than 6, two in only 4. Now every vertex samples the ground under
124+
itself (a ray down onto the dirt, captured before any stone is added),
125+
and each stone sinks until every sector's most-buried vertex is
126+
`EMBED_SINK` below it.
127+
- **Sized.** All nine stones were within about 20% of one size, on a
128+
relaxed 3×3 grid, and the top view read as planted. `STONE_SIZES` gives
129+
each scatter point a factor from 0.55 to 1.45, boulders among cobbles,
130+
and the relaxation spaces each pair by the sum of their own bounds.
131+
- **Rounded rim.** The hill met the vertical walls at a knife edge all
132+
round. The rim is bevelled in four segments, and the budget bounds the
133+
step in normal elevation between adjacent faces. Elevation, not
134+
dihedral: at the corners the chamfer strips meet at a right angle in
135+
plan, which is a rounded corner.
136+
- **Ground, not a sine.** Two closed-form relief terms, 14 mm and 7 mm,
137+
ride on the hill in the same GN tree. The hill and rim are
138+
smooth-shaded, because flat shading printed the 21×21 grid on the
139+
ground; stones and walls stay flat.
140+
- **Materials.** Stones are mid-grey (they were near-white where the key
141+
hit them), and the dirt darkens toward a subsoil colour below the slab
142+
lift, in object space, without adding a material.
143+
101144
`stone_overlap_audit` BVH-tests every stone pair. `--pile-rocks` skips
102-
the relaxation and draws the scatter in to 40% so neighbours collide: 6
103-
pairs interpenetrate on 5.2.1, and the piece exits 20. Skipping the
145+
the relaxation and draws the scatter in to 40% so neighbours collide: 7
146+
pairs interpenetrate, and the piece exits 20. Skipping the
104147
relaxation alone would prove nothing, because the cleaved stones miss
105148
each other unrelaxed.
106149

@@ -118,6 +161,9 @@ and returned the same code on each.
118161
| `--float-rocks` | seat offset vs sampled dirt Z | 18 |
119162
| `--box-rocks` | per-stone face floor | 19 |
120163
| `--pile-rocks` | stone-to-stone interpenetration is 0 | 20 |
164+
| `--perch-rocks` | every stone sealed in 8/8 sectors (measures 3/8) | 21 |
165+
| `--uniform-rocks` | footprint ratio ≥ 3.0 (measures 1.851) | 22 |
166+
| `--sharp-rim` | rim tilt step ≤ 40° (measures 88.50°) | 23 |
121167

122168
## Run
123169

@@ -130,6 +176,9 @@ blender --background --python terrain_scatter.py -- --poke-rock
130176
blender --background --python terrain_scatter.py -- --float-rocks
131177
blender --background --python terrain_scatter.py -- --box-rocks
132178
blender --background --python terrain_scatter.py -- --pile-rocks
179+
blender --background --python terrain_scatter.py -- --perch-rocks
180+
blender --background --python terrain_scatter.py -- --uniform-rocks
181+
blender --background --python terrain_scatter.py -- --sharp-rim
133182
blender --background --python terrain_scatter.py -- --output terrain.png
134183
```
135184

@@ -164,3 +213,6 @@ hygiene and joint-fit family.
164213
| 18 | Float above host (`--float-rocks`) |
165214
| 19 | Stone shell faces (`--box-rocks`) |
166215
| 20 | Stone pairs interpenetrate (`--pile-rocks`) |
216+
| 21 | A stone not sealed in every sector (`--perch-rocks`) |
217+
| 22 | Stone footprint ratio below floor (`--uniform-rocks`) |
218+
| 23 | Rim tilt step above ceiling (`--sharp-rim`) |
-1.96 KB
Loading

0 commit comments

Comments
 (0)