acron.trees¶
Procedural trees and forests: species presets grown by the engine’s
native generator (acron.proctree: Weber & Penn 1995 with SeedThree’s
extensions, space colonisation, LODs), painted without art, and drawn by
hardware instancing with wind, seasons, impostors and the sky’s light.
The pieces (each its own module; the package re-exports the API):
Species(species) — a JSON preset (presets/*.json: oak, maple, birch, aspen, ash, pine, fir, spruce, willow, palm, bush): the Weber-Penn parameters by name, the recipe of growth ops, colours, LOD budgets and distances, and friendlycontrols(height, crown width, density, leaf size, droop, gnarl, lean);Species.describe()andSpecies.schema()document it. Pure Python.atlas— the no-art default: leaf-cluster sprites, needle sprays and tiling bark with their normal maps, painted by the engine (acron.proctree.TreeAtlas, grown out of acronvehicle’s tree atlas), and leaf mips that keep their alpha-tested coverage (Castaño 2010).prototypes— a species grown~12times and meshed at three LODs (PrototypeCache, in memory and on disk by a digest of the preset).ImpostorBaker(impostor) — octahedral impostors (Brucks 2018) baked offscreen: albedo/alpha, normal, depth; frames blended in the shader.Forest(forest) — cells of instance tables, one node per cell and LOD,gl_InstanceIDinstancing from a float texture (GL 4.1 and 4.5), LOD fades over time, every LOD in the sun’s shadow cascades through the forest’s own casters (wind and alpha test; impostors as light-facing quads). Culling, LOD choice with hysteresis, fades and the instance tables are native (acron.proctree.ForestCells).shaders— the GLSL (shaders/) assembled throughacron.shaderlib(wind.glsl,foliage.glsl, the sky’satmosphere.glsl/shadows.glsl);assemble_sources()needs no GL.
The package has no numpy dependency (Android and web builds strip it).
Without acron.proctree it still imports: presets and shader assembly
work, and growing or painting raises a clear ImportError.
from acron.sky import Environment, SunShadows
from acron.trees import Forest, Species
env = Environment(base)
forest = Forest(env, shadows=SunShadows(env))
forest.plant(Species.load("oak"), positions) # (n, 3) ground points
forest.set_season(autumn=0.6)