New water system not working properly with world composition

After painstakingly testing a number of greybox scenarios related to this I’ve been able to decipher what causes the water to break when using world composition.

Things you must do to have water working:

  • Your landscape MUST have EnableEditLayers set to true.
  • Your landscape MUST have a WaterBrushManager actor added to it’s brushes list and the same WaterBrushManager actor must exist in it’s local level to deform the height map.
  • Your landscape MUST have a WaterMeshActor to draw the surface of the water.
  • Both the WaterMeshActor and WaterBrushManager MUST be placed in the EXACT center of the origin landscape. EG: if your landscape is 100x100 units and you want the WaterMeshActor and WaterBrushManager to be located at 0,0… the landscape game object must be located at -50,-50. If they aren’t, either the heightmap or surface of the water will appear at a different location than the water objects placed.
    NOTE: By default, the landscape actor’s transform is locked. To edit it, you can right click on the actor, go to Transform, then uncheck ‘Lock Actor Movement’.

Pitfalls:

  • Sometimes editing the various actors won’t update the scene. It’s good to try redragging your water body or pressing Force Update in the water brush manager after you make changes. Somethings reloading a level also works.
  • If a water body is added to a landscape with EnableEditLayers turned on and it doesn’t contain a water brush, UE will attempt to add the WaterBrushManager and WaterMeshActor to the local landscape. If your landscape has been placed off center or then gets moved after the two required components are added, the two may come out of sync. Also, by default, the WaterBrushManager and WaterMeshActor contribute to the LevelBounds via the IsRelevantToLevelBounds flag - This can cause your origin tile to show up with the wrong dimensions in your world compositor if the LevelBounds object is set to automatically calculate. You can either disable the LevelBounds relevancy, or manually set the level bounds to avoid this issue.
  • If the WaterMeshActor or WaterBrushManager become decoupled or have the wrong dimensions, it’s almost better to delete them and re-add them once the landscape is in the correct location with it’s correct level bounds as modifying the level bounds info that the Mesh or BrushManager is something I have yet to figure out.
  • A landscape can be placed off of the origin in the world compositor, HOWEVER: doing so will incur a hefty performance penalty when setting EnableEditLayers to true depending on the number of tiles in-between the compositor origin and the landscape. This is due to the number of landscape components & size of the texture needed to encapsulate the origin of the composition and the location of the landscape within the composition.

Things you can support:

  • Water objects (Rivers/Oceans/Lakes etc…) can exist in different levels than the origin landscape, but you won’t see them unless the level containing the WaterMeshActor and WaterBrushManager are also loaded.

A little better explanation:
The water brush uses an orthographic rendering of the splines & some imaging techniques to generate a texture representing an offset on the height map. In order to capture all of the deformations of the heightmap, the texture must be large enough to cover the entire bounds of your map, and so the water brush will attempt to allocate a texture using the level bounds to figure out how big it should be. The offset of the height map is basically what a brush is (it also includes the weight map… but getting into tmi here). When the landscape is rendered, it combines the texture with the height map to produce the actual height of the terrain. You can see these textures as various previews on the WaterBrushManager’s details pane if you need to debug.

Hope this helps.

3 Likes