Each tree's trunk goes into the ground all round on a hill, with no root skirt or root piece standing over the slope #21

Merged
agra merged 4 commits from task/3930-trees-on-hills-float-each-stands-with-it into master 2026-10-30 11:36:59 +02:00
Owner

Tracker: #3930

On the first map's hillsides every fir's and island tree's bark now meets the slope all round, as it met its own ground in the scan, and nothing of its roots hangs over the ground or stands apart from the trunk.

What changes

  • The prefabs' trunks carry the slope (assets/prefabs/polyhaven_tree.py). After decimation, each trunk is cut level at root, above the scanned ground and its loose roots: 0.2 m for the fir, where the scan's flat root skirt (textured with the scanned leaf litter) and its detached root pieces end, and 0.05 m for the island tree. The cut's rim is carried on down into the ground: to the tree's own ground at the origin's height, flaring out 25° from upright as a root flare does, and on to 0.5 m below it. Down the rim each face's bark texture carries on mirrored, as the bark rises above the cut. The script refuses a cut that is not one closed rim round the trunk. Rerunning the script from the recorded Poly Haven downloads (sizes and MD5s checked) reproduces both prefabs exactly; next to master's, only the tree meshes differ: the fir is 25390 triangles (trunk 1361, was 2478), the island tree 41129 (trunk 2167, was 2047). The textures and the collision proxies are byte for byte as they were.
  • The trees are reseated (assets/scenes/first_map_prefabs.py, run over first_map.blend). A tree's base is now what its prefab draws from its own ground to 0.5 m above it, and each tree stands with its origin at the lowest ground under that base, so its uphill side is in the ground and its trunk goes on down below. 868 of the 900 trees rose, by up to 0.235 m; nothing else in the map moved.

Tests

  • tests/first_map_world.sx:
    • The base check reads the new base (vertices from the tree's own ground to 0.5 m up). Every tree's highest base vertex still lies within 3 cm of the ground, from above and from below (the worst ±0.000022 m).
    • New: in each of 16 directions about the trunk's axis through the middle of its base, the lowest point of every tree's bark lies at least 5 cm under the map's ground beneath it. At the head the shallowest lies 0.32 m under (fir) and 0.36 m under (island tree). On master's bake it fails for 600 of 603 firs and all 297 island trees; the shallowest point stands 0.17 m above the ground.
    • New: every vertex a tree draws lower than 1 m above its origin that stands above the ground joins, through edges above the ground, what the tree draws higher. On master's bake it fails for 302 firs (the worst has 121 vertices apart) and 14 island trees.
  • tests/first_map_views.sx: a new Metal golden, tests/pixels/steep-fir-metal.png, of the fir on the steepest ground (the greatest drop across its origin over 4 m in 16 directions), seen from 1.6 m downhill with the eye 0.6 m above the ground and looking at the ground under its origin. It fails on master's bake (11717 of 144000 pixels). The forest golden is regenerated for the new trees.
  • tests/bake_extract.py: the linked fir's triangle count is 25390.
  • The trunks still block the player: the test walking a body into a fir passes, and the proxies are unchanged.

Mutants, each rerun through the scripts, a bake and the tests in a scratch arm, all fail first_map_world: the trunk ending at the tree's own ground, a trunk going only 2 cm below it, seating that counts the trunk below the tree's own ground as base, and seating at the ground under the trunk's centre.

Gates

At 9fa4c5d: fast (gate run 919) and full (gate run 920) both passed, 36 of 36.

Headless renders at the head of the task's fir 563 from downhill and across the slope, and of a hillside of firs, are attached to the task as results (files 811–814). Agra's check in the app that no tree's base floats on a hill is left.

Tracker: [#3930](https://sak.swipelab.com/tasks/3930) On the first map's hillsides every fir's and island tree's bark now meets the slope all round, as it met its own ground in the scan, and nothing of its roots hangs over the ground or stands apart from the trunk. ## What changes - **The prefabs' trunks carry the slope** (`assets/prefabs/polyhaven_tree.py`). After decimation, each trunk is cut level at `root`, above the scanned ground and its loose roots: 0.2 m for the fir, where the scan's flat root skirt (textured with the scanned leaf litter) and its detached root pieces end, and 0.05 m for the island tree. The cut's rim is carried on down into the ground: to the tree's own ground at the origin's height, flaring out 25° from upright as a root flare does, and on to 0.5 m below it. Down the rim each face's bark texture carries on mirrored, as the bark rises above the cut. The script refuses a cut that is not one closed rim round the trunk. Rerunning the script from the recorded Poly Haven downloads (sizes and MD5s checked) reproduces both prefabs exactly; next to master's, only the tree meshes differ: the fir is 25390 triangles (trunk 1361, was 2478), the island tree 41129 (trunk 2167, was 2047). The textures and the collision proxies are byte for byte as they were. - **The trees are reseated** (`assets/scenes/first_map_prefabs.py`, run over `first_map.blend`). A tree's base is now what its prefab draws from its own ground to 0.5 m above it, and each tree stands with its origin at the lowest ground under that base, so its uphill side is in the ground and its trunk goes on down below. 868 of the 900 trees rose, by up to 0.235 m; nothing else in the map moved. ## Tests - `tests/first_map_world.sx`: - The base check reads the new base (vertices from the tree's own ground to 0.5 m up). Every tree's highest base vertex still lies within 3 cm of the ground, from above and from below (the worst ±0.000022 m). - New: in each of 16 directions about the trunk's axis through the middle of its base, the lowest point of every tree's bark lies at least 5 cm under the map's ground beneath it. At the head the shallowest lies 0.32 m under (fir) and 0.36 m under (island tree). On master's bake it fails for 600 of 603 firs and all 297 island trees; the shallowest point stands 0.17 m above the ground. - New: every vertex a tree draws lower than 1 m above its origin that stands above the ground joins, through edges above the ground, what the tree draws higher. On master's bake it fails for 302 firs (the worst has 121 vertices apart) and 14 island trees. - `tests/first_map_views.sx`: a new Metal golden, `tests/pixels/steep-fir-metal.png`, of the fir on the steepest ground (the greatest drop across its origin over 4 m in 16 directions), seen from 1.6 m downhill with the eye 0.6 m above the ground and looking at the ground under its origin. It fails on master's bake (11717 of 144000 pixels). The forest golden is regenerated for the new trees. - `tests/bake_extract.py`: the linked fir's triangle count is 25390. - The trunks still block the player: the test walking a body into a fir passes, and the proxies are unchanged. Mutants, each rerun through the scripts, a bake and the tests in a scratch arm, all fail `first_map_world`: the trunk ending at the tree's own ground, a trunk going only 2 cm below it, seating that counts the trunk below the tree's own ground as base, and seating at the ground under the trunk's centre. ## Gates At 9fa4c5d: `fast` (gate run 919) and `full` (gate run 920) both passed, 36 of 36. Headless renders at the head of the task's fir 563 from downhill and across the slope, and of a hillside of firs, are attached to the task as results (files 811–814). Agra's check in the app that no tree's base floats on a hill is left.
agra merged commit d962aee44f into master 2026-10-30 11:36:59 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sx/hulken!21
No description provided.