Foliage & PCG
Generating foliage onto an existing surface.
Last updated
Generating foliage onto an existing surface.
Last updated
There is an example available on this topic!
As of this release, native Voxel Plugin foliage has been replaced with a PCG integration. This gives full control over scattering behavior, and allows for spawning actors (including voxel brushes) as well as the usual static meshes.
PCG updates from the Voxel World can be paused using the voxel.DisablePCGRegen 1
console command.
With PCG comes the ability to analyze points and do contextual operations on them. This opens the door to things like combining multiple smaller cliff points into a single larger cliff mesh. The logic that would be used for that kind of behavior is generic to any PCG-based system.
The key node for anything voxel-related on the PCG side is the Get Voxel Data
node. This can be plugged into a Voxel Sampler
to spawn new points, or into a Voxel Projection
node to make existing points conform to the terrain. Both of these can be configured from the details panel to be height-based or volumetric.
When using PCG with Voxel Plugin, we strongly recommend:
On any PCG graph, setting Use Hierarchical Generation
to true.
Note that PCG's spline sampling does not work well with Hierarchical Generation. Use Voxel Metadata instead.
On any in-world graph actor:
Setting Generation Trigger
to Generate at Runtime
.
Setting Is Partitioned
to true.
On the PCG World Actor:
Setting Treat Editor Viewport as Generation Source
to true.
If the world isn't largely a heightfield (i.e. it contains lots of caves, or is a planet), setting Use 2DGrid
to false.