Page cover image

Foliage

Generating foliage onto an existing surface.

As of this release, native Voxel Plugin foliage has been replaced with a (work-in-progress) PCG integration. This gives significantly more flexibility when it comes to scattering meshes and actors onto a terrain.

We strongly recommend Unreal Engine 5.4 or above for projects making use of PCG. Older engine releases are missing important features for performant runtime generation.

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.

A terrain, including its volumetric shapes like a floating brush, being populated with trees, with a spline used as a mask.

The only significant change for scattering on a voxel terrain is the point sampler.

The key node for anything voxel-related on the PCG side is the Get Voxel Landscape Data node. This can be plugged into a Voxel Landscape Sampler to spawn new points, or into a Voxel Landscape 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.

Scattering points on the terrain is done using the Get Voxel Landscape Data and Voxel Landscape Sampler nodes.

Sometimes PCG will attempt to run its graphs before all the voxel-side data is ready. This can cause an otherwise functional graph to not spawn any instances. This can be prevented by using the Wait for Voxel Landscape node whenever referencing voxel data. This will prevent PCG from running before the voxel data is computed.

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.

  • 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

Last updated