Blueprint Brush System - Landmass

Presentation

ShaderWorlds can be further shaped and customized using a Blueprint brush system, via a BP_BrushManager, of class AShaderWorldBrushManager, placed in the same level and linked in the ‘Brush Manager’ tab.

Using the brush system, the ShaderWorld will send to the BrushManager its originally created heightmap, which in turn will apply the relevant layers and their related brushes for this given heightmap.

Brushes are Blueprint actors of class AShaderWorldBrush placed in the world as well, and linked to the BP_BrushManager from a layer. Brushes are defined by a material to be applied to the heightmap, and a world footprint on the XY plane, visible as a box, which allows to efficiently compute only the necessary brushes for a given terrain LOD. Brush box dimensions are the responsibility of the user, which can either use the scaling of the brush actor to increase its footprint, or adjust the dimension of the BoxComponent directly.

How To

For a brush system demo, please refer to the map Map_Reference within the plugin content folder.

Brushes actors are basically managing a dynamic material which will be applied to the ShaderWorlds heightmap. From the brush blueprint you can access the dynamic material and therefore manage any shader parameter you might want to add to your brush.

A blueprint function named DoesBrushNeedRedraw is called from c++ at a frequency defined in the BP_BrushManager ‘required’ tab. It’s based on the update rate of the layer stack defined in RedrawCheckPerSecond and IncludeBlueprintUpdateEvery.

Blueprint workload being performance intensive, the blueprint implementable functions will only be called once every IncludeBlueprintUpdateEvery update of the layer stack. Preferably, Blueprints should rarely update parameters outside of the context of modeling the landscape in Editor. If a given brush has to update parameters regularly, it’s recommended to create it using c++ by inheriting the AShaderWorldBrush class and overriding ApplyBrushAt and Reset functions.

Update of the layer stack allows it to check if any enabled brush has moved, as well as layers and brushes being toggled enabled/disabled, or influence changed, in which case it’ll ask the ShaderWorlds to redraw the impacted LODs, update the appropriate collisions, and spawnables.

If spawnables locations aren’t updated, they were most likely out of the Brush footprint bounds

Force a vegetation update by checking Rebuild vegetation only in Spawnable tab.

Last updated