Vary the forest per instance #120

Merged
sermuns merged 1 commit from feat/87-tree-instance-tint into main 2026-10-21 08:44:32 +00:00
Owner

Every tree on campus was the same green at the same scale, so a forest read as
one model stamped again. The bake already jitters each tree's pose and size;
the tint comes from where the tree stands, hashed from the instance transform,
so it needs no re-bake and no extra draw.

The tint rides in the tree instance buffer beside the transform and multiplies
the albedo in the lit fragment, the way PART_BODY carries its per-instance
colour. It scales the model's own colour rather than replacing it, so bark
stays bark and leaves stay leaves, and it stays within a narrow band around
the model's green.

closes #87

How to test

Fly up over the wooded parts of campus, or open the RTS overview with M, and
look at a stand of trees: neighbouring trees are no longer the exact same
green -- some read a little darker or brighter, some warmer or cooler. A
tree-lined path no longer reads as the same model repeated twenty times.

A tree's trunk and canopy share one transform, so they share one tint and the
tree does not come apart in two colours.

A 👍 reaction on this pull request flags it for merge.

Every tree on campus was the same green at the same scale, so a forest read as one model stamped again. The bake already jitters each tree's pose and size; the tint comes from where the tree stands, hashed from the instance transform, so it needs no re-bake and no extra draw. The tint rides in the tree instance buffer beside the transform and multiplies the albedo in the lit fragment, the way `PART_BODY` carries its per-instance colour. It scales the model's own colour rather than replacing it, so bark stays bark and leaves stay leaves, and it stays within a narrow band around the model's green. closes #87 ## How to test Fly up over the wooded parts of campus, or open the RTS overview with `M`, and look at a stand of trees: neighbouring trees are no longer the exact same green -- some read a little darker or brighter, some warmer or cooler. A tree-lined path no longer reads as the same model repeated twenty times. A tree's trunk and canopy share one transform, so they share one tint and the tree does not come apart in two colours. A 👍 reaction on this pull request flags it for merge.
Every CommonTree_1 on campus was the same green at the same scale, so a
forest read as one model stamped again. The bake already jitters each
tree's pose and size; the tint comes from where the tree stands, hashed
from the instance transform, so it needs no re-bake and no extra draw.

The tint rides in the tree instance buffer beside the transform and
multiplies the albedo in the lit fragment, the way PART_BODY carries its
per-instance colour. It scales the model's own colour rather than
replacing it, so bark stays bark and leaves stay leaves, and it stays
within a narrow band around the model's green.

The bark and the leaves of one tree share a transform, so they share a
tint and the tree does not come apart in two colours.
sermuns force-pushed feat/87-tree-instance-tint from 2bf6c692c2 to ef729e208e 2026-10-21 08:44:01 +00:00 Compare
Sign in to join this conversation.
No description provided.