- Summary
- Start Here
- Install
- Feature Highlights
- Common Use Cases
- Important Limitations
- Reference: What is Foliage Assembly and voxel-based rendering?
- Development: Agentic Workflow, Repo Requirements, Verification
- Cross-links: Package README, Runtime Authority
- License
- Kudos
This repository hosts the authoritative vegetation package, repo-local scenes and docs, and the agentic development workflow around them.
The feature itself is an opaque-only, branch-assembled vegetation workflow for Unity 6 URP with GPU classification, GPU-resident indirect emission, and indirect depth/color submission.
Inspired by Unreal Engine 5.7 foliage innovations (Assemblies, voxelized LOD, and hierarchical wind animation).
- Authoritative feature contract: Packages/com.voxgeofol.vegetation/README.md
- Runtime authority: DetailedDocs/VegetationRuntimeArchitecture.md
- Embedded package(see Install): Packages/com.voxgeofol.vegetation
- Playground scene: Assets/Scenes/Playground.unity
- Package sample content: Packages/com.voxgeofol.vegetation/Samples~/VegetationDemo
- Next Install
The distributable Unity package lives at Packages/com.voxgeofol.vegetation. If you only need the package in another project, install that package path directly instead of copying repo files by hand.
- Open Package Manager in Unity (
Window -> Package Manager). - Click
+in the top-left corner. - Select
Add package from git URL.... - Enter the following URL and click
Add:
https://github.com/studentutu/VoxGeoFoliage.git?path=/Packages/com.voxgeofol.vegetation
NOTE: If you want to pin the install, append
#branch,#tag, or a commit SHA. Do not assume repo tags map cleanly topackage.jsonversions.
- Close Unity if it is holding the manifest open.
- Open
Packages/manifest.json. - Add the package entry under
"dependencies":
"com.studentutu.vegetation": "https://github.com/studentutu/VoxGeoFoliage.git?path=/Packages/com.voxgeofol.vegetation"- Reopen the project in Unity and let Package Manager resolve the dependency.
If this repository is already checked out next to your Unity project, you can point manifest.json to the package folder directly:
"com.studentutu.vegetation": "file:../path-to-cloned-repo/Packages/com.voxgeofol.vegetation"Replace ../path-to-cloned-repo with the actual relative path from your Unity project's Packages/manifest.json file to this repository clone.
VegetationTreeAuthoring -> TreeBlueprintSO -> BranchPlacement[] -> BranchPrototypeSO- One blueprint can mix or reuse branch prototypes.
- Many authorings can share one blueprint.
- Runtime batching is driven by draw slots keyed by
mesh + material + material kind. - Runtime is container-scoped, GPU-resident, URP-only, opaque-only, and snapshot-based until refresh.
- Wind.
- Support non-package only materials and shaders.
- Generation of canopy-shell (primary voxelization) based on the GPUVoxelizer from quad, alpha-masked branch material.
- Repeated trees built from shared branch modules.
- Mixed species that share meshes and materials for stronger batching.
- Grass or flowers authored as clumps or as many small plants depending on culling and placement needs.
Examples:
tree species -> 1 blueprint -> many branch placements -> shared branch prototypesgrass clump -> 1 authoring -> many blade placementsindividual grass -> many authorings -> 1 blade placement each
For full setup, draw-slot behavior, tradeoffs, pipeline, and limitations, use the package README above as the source of truth.
- No transparent or alpha-clipped runtime vegetation.
- URP only.
- Compute-shader and indirect-draw support are required.
- No CPU fallback.
- Registration changes after enable require
RefreshRuntimeRegistration().
See Unreal 5.7 foliage assemblies (Nanite vegetation):
- Witcher 4 presentation Presentation
- Procedural Vegetation Editor/ Nanite vegetation (Nanite Foliage) OfficialDocs
Short summary:
- No masked / alpha-tested materials, fully opaque based rendering (fully avoid transparency, as it breaks tile-based rendering on mobiles)
- each foliage consists of trunk + branches + leaves (Branch-based assembly with reusable modules)
- reuse branch modules across single tree to minimize memory footprint of the used meshes
- use canopy shells (voxelized mesh) for each of the level of detail.
- each branch consists of multi-level hierarchy of the canopy shells (includes leaves into a voxelized form), thus evenly preserved hight quality in the near and heavy minimize the level of details of obscured (behind the trunk) branches.
- last level of detail (imposter) is fully opaque based on the minimum requirements
- Nanite opaque rendering if very fast if no shader movement exists, thus wind is animated per branch bone (wind is animation, compute shader based)
We can't make it one-to-one right now, but we still have options:
- Unity doesn't have Nanite alternative, closest to it is an experimental virtual mesh package VirtualMeshPackage
- Unity SRP (URP) does support similar mechanism to the assemblies, which is custom render batch by Indirect draw within a custom feature/render pass.
- Reduced geometry at all levels in SRP (custom lods) needs to be explicit for the manual render batch approach
- to keep SRP-friendly batching and allow variation we can use Unity API Renderer Shader User Value (RSUV) which is a tightly pack
uintthat is manually unpacked in shader for any form of variation for the instances.
- Read AGENTS.md before repo work.
- For feature work, read memorybank/techContext.md, memorybank/projectrules.md, and memorybank/FeatureRouter.md, then follow the routed docs.
- Ask to
read memory bankbefore deep repo work andupdate memory bankwhen documentation or implementation state changes. - Fast compile:
./rebuildSolutionWithRiderMsBuild.sh - Full Unity compile and solution refresh:
./rebuildSolutionFromUnityItself.sh - Run Unity tests:
./runTestsFromRoot.sh - Parse Unity test output:
./runParsetests.sh - If Unity, Rider, or Git Bash are installed elsewhere, update the hardcoded paths in those scripts and in .vscode/tasks.json.
- CI/Tests/Compilation
- change versions and path to Unity Editor and Rider in: rebuildSolutionFromUnityItself, parseTestErrors, rebuildSolutionWithRiderMsBuild, runTestsBash
- change solution for quick MSBuild (take solution that is generated by Unity Editor) change solution field 'SOLUTION_UNIX="$PROJECT_PATH/VoxGeoFol.sln"' in rebuildSolutionWithRiderMsBuild
- VScode tasks use system git bash path: "C:\Program Files\Git\bin\bash.exe" (windows path, properly escaped)
- Unity Hub with a Unity
6000.3+editor installation. - Git and Git Bash.
- Rider or another MSBuild-capable setup.
- VS Code is optional, but repo task wrappers are configured there.
- Fast compile output:
CI/RiderMsBuild.log - Unity compile output:
CI/CompileErrorsAfterUnityRun.txt - Unity test output:
CI/CITestOutput.xml - Unity test log:
CI/UnityLogs.log
MIT license.
- Root repository license: LICENSE
- Package license: Packages/com.voxgeofol.vegetation/LICENSE.md
Big thanks to the unity-voxel and it's author @mattatz !


