Widgets & Controls

Floating Foliage Fixer

A procedural Editor Widget for Unreal Engine 4 that automatically hides the exposed base edges of instanced trees and rocks on uneven terrain.

Floating Foliage FixerWidgets & Controls

Resource overview

Grounding Instanced Meshes on Uneven Terrain

Building natural environments in 3D space often involves scattering thousands of instanced meshes across varied topography. When populating hillsides, valleys, and uneven terrain, developers frequently encounter instances that do not conform well to the underlying ground. Trees and rocks placed on a steep gradient often exhibit an ugly open edge where the base of the mesh sticks out horizontally from the descending slope.

Resolving this visual artifact manually presents a frustrating choice for environment artists. One approach is to sink all the items uniformly into the ground to ensure no bases are exposed, but this pushes assets on flat terrain too deep, altering their intended scale and proportion. Alternatively, developers might attempt to carefully select and manually adjust only the specific instances located on the slopes. This manual selection process is time-consuming and highly inefficient for dense environments. The Floating Foliage Fixer is designed to address exactly that issue, providing a procedural Editor Widget utility to ground these assets automatically without compromising the placement of surrounding instances.

The Vertex-to-Ground Comparison Logic

To eliminate the exposed gaps on hillsides, the utility relies on a targeted geometric evaluation rather than simply dropping bounding boxes by an arbitrary distance. The system specifically isolates the lowest group of vertices on each individual foliage instance. By identifying the bottom-most geometry of a tree trunk or a rock formation, the tool establishes a precise reference point for how the asset interacts with the environment.

Once identified, these lowest vertices are compared directly against the ground surface situated immediately beneath them. Based on this localized comparison, the system shifts the asset downward along the vertical axis. The movement is calculated precisely so that it stops only when those specific base vertices are fully hidden beneath the terrain. This vertex-to-ground comparison guarantees that the open base edge is submerged, anchoring the rock or tree naturally into the slope while leaving properly seated assets unaffected.

Operating the Editor Widget Workflow

Integrating this adjustment into a level design pipeline involves a straightforward Blueprint Editor Widget workflow. Developers can launch the utility directly from their project files by running the widget located at the Content/FloatingFoliageFixer/FoliageFixer Directory path.

Upon opening the widget, the interface presents the available foliage types currently populated within the scene. Users can selectively tick the specific types of foliage they want to be fixed. This selective targeting means an artist can choose to correct the placement of scattered boulders while deliberately ignoring a specific type of grass or undergrowth. Once the desired foliage types are checked within the interface, pressing the 'fix' button executes the vertex comparison and downward adjustment across all selected instances simultaneously.

Managing Editor Updates and Scene State

Environment pipelines often require continuous back-and-forth iteration. While using the engine's native foliage editor to paint new instances, erase unwanted clusters, or adjust density scaling, the internal data regarding scene population changes. The fixer widget relies on an accurate inventory of the scene's current state to function correctly.

For that reason, if any modifications are made within the standard foliage editor, the user must press the 'refresh' button within the utility's interface before attempting to use it again. This refresh action forces the widget to pull the latest placement data, ensuring that subsequent fixes are applied to the most up-to-date arrangement of instances. Bypassing this step after altering the environment can desync the utility from the active scene.

Undo History and Re-applied Positions

Navigating the engine's undo history requires specific attention when utilizing this procedural adjustment. Certain engine actions fundamentally re-apply foliage positions across the environment, which can override the tool's calculations. The most prominent example of this occurs when a developer executes a manual move on a specific foliage item, decides the new placement is incorrect, and triggers an undo command.

When this undo action is processed, the engine resets the foliage locations to their previous internal state, effectively wiping out the downward vertex adjustments previously generated by the widget. If this location reset occurs, the affected instances will pop back up, once again exposing their open base edges on the slopes. To resolve this, the user must return to the widget and re-apply the fix explicitly to that affected foliage type.

Processing Capacity and Engine Environment

Handling dense natural environments requires a utility capable of processing thousands of coordinates efficiently. Performance metrics for this blueprint indicate an execution speed of approximately 20,000 foliage instances every 10 seconds. This processing rate is maintained even when evaluating fairly complex foliage assets with higher vertex counts, allowing level designers to run corrections on expansive forested areas or densely packed rocky landscapes rapidly.

The tool has been primarily tested on Windows operating systems, but its underlying Blueprint architecture dictates that it should run successfully anywhere the UE4Editor operates. The package functions purely as an editor utility widget to streamline environment art pipelines. Developers must supply their own 3D tree and rock assets, as the download provides only the procedural foliage fixer itself.

Related Resources Worth Checking

Free protected download

Access this resource

Sign in or create an account to continue to the protected download through the managed storage service.

Resources are manually reviewed before listing to improve quality and reduce obvious risks.

Resource archiveContent.7z

Related resources