This document assumes:
- You have a basic understanding of Unity's interface.
- You've already installed FoliageTool into your Unity project.
- The assets for your foliage are imported and ready to be used in Unity.
FoliageTool is designed to be used with details such as grass, flowers, rocks, and other small details.
However, you can use any prefab that is supported by Unity's terrain details system, with the following limitations:
- The prefab must use a
MeshRenderer
component - The prefab must use a shader that supports GPU Instancing
Note: Unity uses a different rendering mechanism for trees, so they are not supported as a valid detail prefab.
That said, support for procedurally spawning trees is on the roadmap for a future version, but in the meantime, you are encouraged to paint trees using Unity's Terrain Inspector.
FoliageTool allows you to store foliage configurations as a FoliageAsset
.
- Create a new asset by going to
Assets > Create > FoliageTool > Foliage
- Set the
Prefab
field to your foliage's prefab. - All of the other fields are optional, but provide more customization.
Note:
FoliageAsset
is a wrapper for Unity's TerrainDetailPrototype
, which holds all the necessary properties for the terrain to automatically spawn your foliage
- Create a new biome by going to
Assets > Create > FoliageTool > Biome
- Add new foliage to the biome by clicking
+
- Click on the new element that was created. You will see all the rules for this given foliage asset.
- Drag the foliage asset you created earlier into the
Asset
field. - Configure any relevant properties for your foliage.
Note:
BiomeAsset
is a procedural rule-set for all the foliage in a biome.
- Add the
FoliageTerrain
component to your Terrain's GameObject. - Assign the biome you created to the
Biome
field. - Click
Refresh
and wait for FoliageTool to evaluate your terrain. - After it's done, you should see your foliage on the terrain.
- Create a biome brush object:
GameObject > Foliage > Biome Brush > Circle
- You should see a circle brush created in front of your camera.
- In the Inspector, you should see the Biome Brush component.