Vegetation Clump Generator Tool

Solo | Maya Tool for generating vegetation clumps for Unreal Engine Landscapes

2024-08-21 08:00:00 +0000


The Vegetation Clump Generator tool is a Python tool for Maya that allows for the generation of clump meshes, and billboard textures from a selection of individual foliage meshes.

Generated meshes can be applied to Landscapes. Billboard LODs are almost indistinguishable.

Check out the project on GitHub to see the latest code.

Background

While investigating vegetation spawning in Unreal Engine’s Landscape editor, I discovered how tedious modelling performant vegetation could be. Seeing an opportunity for automation, I sought to develop a took that could take an array of individual foliage pieces and generate a variety of game-ready grass clump assets. At the time of writing, the tool is in an early prototype stage.

The Pipeline

Modelling

Artists must create plants as normal, before feeding them into the clump generator tool. Vertex count should be kept to the minimum necessary to maintain a strong silhouette.

I use a simple 1 x 256 gradient texture and shift the UVs to add colour to the grass objects.

Clump Generator

Once our plant meshes are ready, we can go ahead and launch the clump generator tool by selecting it in the shelf it was installed to.

The tool will prompt the user to make a selection, before launching the UI. This feature will be deprecated in favour of allowing users to pick and change the selection while generating a clump.

Once a selection is made, the tool should launch.

All UI parameters are persistent across sessions allowing users to reuse clump configurations with ease.
Foliage Distributions determines the ratios for how likely the clump generator is to spawn a given piece of grass. Higher values increase this likelihood.
Clump Settings allows for the configuration and distribution of grass pieces in the clump. Here we can set the size, density, random rotation, scale and whether grass pieces should be scaled down nearer the clump borders.
Billboard Settings allows us to toggle whether a billboard texture should be rendered for this clump and lets us choose a name and resolution for the render output.

Hitting Generate Clump will create a single clump mesh in the scene, and two billboard textures.

Note: Normal map values are not 100% accurate yet - especially on backfaces.

The clump mesh and textures are now ready for export.

Unreal

In Unreal, we can generate a simple static mesh object with two LODs; our clump, and a simple billboard mesh.

LOD0 (4680 tris)

LOD1 (8 tris)

Results

We have only generated one type, of clump but the results on the landscape are promising:

Improvements

The above result is clearly too uniform, but I believe this can be fixed by introducing more clump variety with their own characteristics.
The current pipeline is not without flaws. The generator tool in Maya runs on Arnold, which means renders take far longer than necessary. Also, artists cannot see the result until a render is complete, and so I would like to introduce live clump generation that will allow users to see the results of switching out clump pieces and adjusting clump parameters.
A list of issues and enhancements is maintained on Clump Generator - Issues - GitHub.