# Vegetation v5 provenance and integration

`vegetation.js` is a standalone, independently authored procedural asset module. It exports `createPalmGeometries(THREE)`, `createBroadleafGeometries(THREE)`, and `createVegetationMaterials(THREE, { windTime })`. The geometry factories retain the `{ trunk, leaves }` instancing contract. Keep the existing geographic placement and building-exclusion checks.

The 9 m coconut palm has 22 fronds in upright, spreading and drooping age tiers, 884 folded leaflets, older brown foliage, a curved ring-scarred trunk, leaf-base collars and a coconut cluster. It contains **9,612 triangles**. The coastal shade tree has curved connected branches, root flares and a volumetric canopy of 1,012 rounded leaves, totaling **10,132 triangles**. Each species remains two instanced meshes.

All geometry, leaf-vein detail, bark texture, vertex contact shading, wind deformation and sun-dependent backlighting were authored for this project. Textures are generated locally from mathematical patterns. No downloaded media, external texture packs, source-repository assets or third-party code are included in this module; no external attribution dependency is required.

Leaf materials are opaque, double-sided and keep depth writing enabled. Their shared `windTime` object is compatible with the existing animation loop. A deterministic screen-space discard prevents near-camera foliage from filling the view: invisible at or below **0.65 m**, approximately half coverage at **1.025 m**, and fully opaque at or beyond **1.40 m**. This adds no draw calls or transparency blending.

Checks completed: finite attributes, valid indices, nonzero normals, finite bounds and ground origins across three seeds; exact 9 m palm maximum; wind/shader hook presence against vendored Three.js; near-fade sample coverage of 0/4,096 pixels at 0.65 m, 2,045/4,096 at midpoint, and 4,096/4,096 at 1.40 m. The integrating root task performs final WebGL compilation and in-game GPU review.

Final browser tuning expands the camera-clear zone to 1.60 m, with full opacity restored at 2.40 m. This prevents large nearby leaves from covering the narrow-screen view. The original 0.65–1.40 m CPU fade test validates the same smoothstep/dither implementation; the final distances were adjusted after visual inspection.
