Vegetation Simulation

Generating accurate forests requires a close connection to the climate and biome simulation, and a wide variety of species which are distributed in a realistic way. Here is how Planet Architect does it.
Building forests from environmental conditions
Each biome has a vegetation profile describing its forest coverage, density, available species, and minimum growing temperature. Coverage and density serve different purposes. Coverage controls the distribution of forest patches through layered spatial noise, while density controls how many trees appear within those patches. This makes it possible to produce scattered dense forests or broad areas of sparse woodland without treating them as the same distribution.

At biome boundaries, the system blends coverage and density using the biome weights calculated earlier. A candidate tree’s initial spawn probability is the product of these two values, reduced gradually near the profile’s minimum temperature.
Deterministic placement
Tree placement begins with a grid of candidate cells. Each cell contains one randomly offset candidate, which breaks up the visible grid while keeping the distribution more controlled than unrestricted random scattering. The randomness comes from a hash of the planet seed, cube face, and cell coordinates. Additional hash values determine the candidate’s offset, species selection, model variant, rotation, and scale.

Because these choices belong to the cell rather than a shared random-number sequence, they do not depend on which chunk happens to generate first. Thread scheduling therefore does not change the candidate’s random values.
Trees are oriented along the local radial direction, with an additional rotation around that axis. This gives them a consistent upright orientation anywhere on the sphere.
Species Selection
Each tree species is given a preferred (mean) temperature and precipitation value, together with a variance. This defines a normal probability distrubution across the cilmate map for each species. Given a particular candidate, we evaluate each species' normal distrubition at that temperature-precipitation value, and use the relative values to determine the spawn probabilities.
As these values vary across a particular biome, some regions fit certain species better than others leading to species-consistent forests and smooth transitions from one forest to another. In the example below, pine trees have a much lower preferred temperature than birches and oaks, so as the temperature decreases with higher altitude the forests gradually transition to just pine trees.

Rendering large populations
Vegetation is rendered through GPU instancing, with instances grouped by model and material rather than represented by individual scene objects. Placement and transformation data are prepared during threaded chunk generation, while rendering batches are finalized on the main thread.
Each tree is given multiple Levels Of Detail (LODs) which are dynamically swapped based on the distance from the player character. This significantly improves performance as most trees are far enough that they look identical even when turned into billboards.





