Unreal PCG Systems
I made this foliage scattering tool using Unreal’s Procedural Content Generation (PCG) framework. It aims to help 3D artists quickly and efficiently populate large-scale models with highly realistic, organic-looking foliage.
Height Avoidance Logic
Whilst working on a project, I discovered an issue where certain types of foliage were intersecting with geometry above them. To remedy this, I had to ensure any trees that would intersect any geometry above them would be pruned out of the sample points via the boolean function. For this to happen I had to loop through each piece of foliage, setting the correct dimensions of the PCG bounding cell. I then had to sample the above mesh which could potentially be obstructing the foliage. Now if any intersection occurs between the two sets of cells, the relevant points will be pruned from the sample array, meaning any obstructed trees won’t be instanced.
Area Avoidance Logic
Similarly, the tool can also avoid areas, as opposed to spline shapes. This is especially useful in a desert-type environment when large areas of foliage need to be distributed, while avoiding certain types of infrastructure.
Spline Avoidance Logic
The tool can avoid certain areas of interest, i.e. roads, by drawing in a custom spline and tagging it with a certain text string. The PCG system then recognises this tag and subtracts the bounds of this spline from the original sample points using a boolean operation. The thickness of the avoidance is adjusted by declaring the bounding distance of the spline as a float variable and adjusting it in the blueprint actor.