Skip to content

Caves, docks and hull interiors

Some dry spaces sit below the water line: a sea cave or tunnel, a room under a harbor, a dry dock, the inside of a boat. Without help, DRW treats them like the rest of the water: the camera gets the underwater look, floating objects float, and inside a hull you see the water surface cutting through the deck. DRW has two tools for this.

Water Masking ActorDRW Surface Mask component
Shipped asBP_WaterMaskingActorComponent you add to a boat Blueprint
ShapeA boxAny closed mesh (the hull’s dry interior)
Moves withPlaced once; after moving it during play, call Write Cave Transforms To Render Target for the underwater partIts actor (it follows the hull every frame)
Hides the water surfaceNoYes, inside the hull
Turns off the underwater lookYes (needs an ocean in the level)Optional (Mask Underwater Effects)
Stops other objects floatingYesOptional (Mask Buoyancy, on by default)
Typical useCaves, tunnels and rooms below sea level that are closed off aboveBoat holds, cabins and decks below the waterline; dry docks open to the sky

Surface Masks need one Water Masking Manager in the level, and so does the underwater part of Water Masking Actors.

BP_WaterMaskingManager makes the Surface Masks and the underwater part of the Water Masking Actors work.

  1. Drag BP_WaterMaskingManager (in the plugin’s Blueprints folder) into the level. Its position does not matter.
  2. Use the Blueprint, not the bare DRW_WaterMaskingManager class. With the bare class, Water Masking Actors never turn off the underwater look.
  3. Place exactly one. If there are several, DRW uses the first one it finds.
  4. Place it in the level rather than spawning it during play. The ocean, the water bodies and every Surface Mask look for the manager once, when play begins.

The shipped maps ExampleMap, LakeMap and PoolMap already contain one.

Under DRW Surface Masking in the manager’s Details panel. They only affect DRW Surface Masks.

SettingDefaultRangeWhat it does
Surface Mask EnabledOnHides the water surface inside hulls. It does not switch off Mask Buoyancy or Mask Underwater Effects; use each component’s Enabled for that. Set it before play.
Surface Mask Coverage6400 cm1000 cm or moreSize of the square area around the camera in which hull interiors are hidden. A hull more than half of this away from the camera shows the water inside it again. Raise it if you see water appear in distant boats; it lowers the detail of the hidden area.
Surface Mask Resolution1024Detail of the hidden area over that square. Higher gives cleaner hull edges at a larger memory cost. Set it before play.
Footprint Resolution25632 to 2048Detail of each hull’s outline seen from above. Raise it for long hulls with fine detail.
Edge Softness20 cm0 to 500 cmWidth over which the mask fades from water to dry across a hull’s outline. 0 gives the sharpest edge.
Blueprint nodeWhat it does
Write Cave Transforms To Render TargetRecords every Water Masking Actor box again for the underwater look. The manager does this once when play begins; call it after you spawn, move or destroy Water Masking Actors during play. Call it once per change, not every frame.
Register Surface Mask / Unregister Surface MaskAdds or removes a Surface Mask by hand. Surface Masks register themselves when play begins, so you only need this for a mask that began play before the manager existed.
Get Surface Mask RTThe texture of the hidden area, for your own materials.

BP_WaterMaskingManager also has a Bake Water Masking button in its Details panel that records the boxes in the editor, the same as Write Cave Transforms To Render Target.

Water Masking Actor: caves, tunnels and dry docks

Section titled “Water Masking Actor: caves, tunnels and dry docks”

A Water Masking Actor is a box that marks a dry space. Inside it:

  • The underwater look is off. With the camera inside the box, the whole view is drawn without the underwater look. Seen from outside, everything behind the box’s faces is drawn without it too.
  • Floating objects stop floating. An object that floats with DRW buoyancy (a DRW Physics Body) and touches the box loses its buoyancy, so it rests on the floor instead of hovering at sea level.

It does not hide the water surface. Use it for spaces that are closed off from the open water above, such as a cave with a solid rock ceiling whose floor lies below sea level. For a space that is open to the sky, such as a dry dock, use a DRW Surface Mask instead: only a Surface Mask hides the water surface.

  1. Make sure the level has a BP_WaterMaskingManager and an ocean.
  2. Drag BP_WaterMaskingActor into the level and place it in the dry space.
  3. Size it by scaling the actor or by editing Box Extent on its Box Component. Rotating the actor is fine.
  4. Keep the box inside the dry space. Any part of the box that sticks out into open water also removes the underwater look there, because the view behind the box’s faces is drawn without it.
  5. Give floating objects that should enter the box Generate Overlap Events on their collision, so the box notices them.

What else to know:

  • Ocean only for the underwater part. Water Masking Actors turn off the underwater look only in levels with an ocean. In a level that has only lakes, pools or rivers they still stop objects floating, but the camera keeps the underwater look.
  • Recorded when play begins. Boxes placed in the level are picked up for the underwater look automatically. Boxes spawned or moved during play are not, until you call Write Cave Transforms To Render Target on the manager. Buoyancy follows the box where it is.
  • When buoyancy turns off. As soon as any part of an object touches the box, the whole object loses its buoyancy, and it keeps it off while it moves inside. It gets its buoyancy back when it stops overlapping the box. Keep boxes away from the paths of boats and other floating objects that should keep floating, for example at a cave mouth.
  • Up to 500 boxes per level. With more, the log says RT too small and none of the boxes turn off the underwater look.
  • Distance. A box whose center is more than 128 m from the camera is ignored for the underwater look, unless the camera is inside it. Split large spaces into several boxes.
  • Post Process component. The actor carries a Post Process component bounded by the box. It changes nothing by default; add settings to it for a cave-specific look, such as exposure or color grading.

A DRW Surface Mask is a component that marks a hull’s dry interior with a mesh. It moves with its actor, so it suits boats, floating platforms and anything else that sits in the water with a dry inside. It works the same on an actor that never moves, such as a dry dock: make the mask mesh fill the dock from its floor to the top of its walls.

What it does, per mask:

  • Hides the water surface inside the hull’s outline, on the ocean and on lakes, pools and rivers, so you do not see water cutting through a deck or cockpit.
  • Mask Buoyancy (on by default): objects of other actors inside the hull do not float on the water the hull keeps out, so cargo in a dry hold rests on the floor. Water above the hull’s top (a swamped hull) counts as real water again. The mask never affects its own actor’s buoyancy.
  • Mask Underwater Effects (on by default): the underwater look turns off while the camera is inside the hull volume, so a cabin or cockpit below the waterline stays dry on screen. Once the water rises over the hull’s top at the camera (a swamped hull), the underwater look comes back.
  1. Make sure the level has a BP_WaterMaskingManager.
  2. Make a mask mesh: a closed mesh that fills the hull’s dry interior, from the inside of the hull bottom up to the top of its sides or deck. It is never drawn; DRW only uses its collision.
  3. Give the mask mesh complex (per-triangle) collision. The shipped mask meshes use the Simple And Complex collision setting. Without complex collision the log says has no complex collision; surface masking needs the mask mesh's collision trimesh and the mask does nothing.
  4. Open the boat Blueprint, add a DRW Surface Mask component, and attach it to the hull mesh so it follows the hull.
  5. Set Mask Mesh to your mask mesh and line the component up with the hull (location, rotation and scale of the component all apply).
  6. Choose Mask Buoyancy and Mask Underwater Effects for this boat.

Under DRW Surface Masking on the component. All four replicate.

SettingDefaultWhat it doesRuntime node
Mask MeshNoneClosed mesh of the hull’s dry interior. Needs complex collision on every machine, dedicated servers included. You can change the mesh, or the component’s scale, during play; the mask updates.Set Mask Mesh
EnabledOnTurns this mask on or off: surface, buoyancy and underwater alike.Set Mask Enabled
Mask BuoyancyOnObjects of other actors inside the hull ignore the water the hull keeps out, as described above.Set Mask Buoyancy
Mask Underwater EffectsOnTurns the underwater look off while the camera is inside the hull volume and the water has not risen over the hull’s top.Set Mask Underwater Effects

On a replicated actor, call the runtime nodes on the server; calls from clients are ignored.

Hull Mask Columns on a DRW Buoyancy component (category DRW Buoyancy|Simulation, default 12, 4 to 32) sets how exact that object’s buoyancy is where it touches another actor’s Surface Mask hull: higher is more exact at the hull wall and costs more. Only the parts of the object that touch such a hull pay for it. See the buoyancy reference.

AssetUsed by
DRW_RunaBoat_MaskBP_Runabout (Surface Mask with Mask Buoyancy off) and BP_FloatRunaBoat (Surface Mask with Mask Buoyancy on). Both keep Mask Underwater Effects on.
DRW_WoodDinghyBoat_MaskMask mesh for the wooden dinghy hull. BP_Dinghy and BP_FloatWoodDinghyBoat carry it on a plain mesh component named Mask, not on a DRW Surface Mask component.

BP_FloatRunaBoat and BP_FloatWoodDinghyBoat are floating (not drivable) versions of the two hulls; ExampleMap contains both.

  • Camera area. Hull interiors are hidden only within Surface Mask Coverage around the first local player’s camera. Buoyancy masking works everywhere.
  • First local player. In split screen, the hidden area and the Mask Underwater Effects check both follow the first local player’s camera.
  • Stacked decks. A hull with two dry decks one above the other is treated as one dry space from the lowest to the highest surface of the mask mesh.
  • Hulls on their side. A mask whose hull lies nearly on its side (rolled or pitched close to 90 degrees) is ignored until the hull tips back.