Water Mask
Water Mask is a powerful feature in Oceanology that allows you to selectively mask both the water surface and underwater areas for enhanced visual effects. The Water Mask functionality is available for both the OceanologyInfiniteOcean
and OceanologyLake
actors, providing users with the flexibility to control which parts of the environment are visible and how they interact with the water.
The Water Mask system helps in achieving specific effects by controlling the visibility and interaction of water with landscape features or objects. By masking certain objects or landscape areas, you can create a more controlled and visually appealing scene that fits your desired look. Water masking is helpful when you need precise control over what is visible above and below the water surface, allowing for unique and immersive water interactions.
Key Features
-
Landscape Visibility Mask: Control how the landscape interacts with water, masking specific areas as needed.
-
Object Visibility Mask: Mask specific objects in the scene, making them interact with the water surface without necessarily being visible.
-
Mask Landscape Edges: Adjust the distance over which the landscape is masked, providing smooth blending with the water.
How to Use Water Mask in Your Project
Setting Up Object Masking
-
Add an Object to Your Scene
- To mask an object (e.g., a sphere), drag the object into your scene.
-
Enable Distance Fields
- Ensure Distance Fields are enabled in the Unreal Engine settings.
-
Activate ObjectVisibilityMask
- Activate the ObjectVisibilityMask in the Water Mask settings of the
OceanologyInfiniteOcean
orOceanologyLake
actor.
- Activate the ObjectVisibilityMask in the Water Mask settings of the
-
Make Object Invisible (Optional)
- If you want the object to mask water but remain invisible, locate the Rendering category of the object and disable Render in Main Pass and Render in Depth Pass. This will make the object invisible while still allowing it to interact with the water surface and underwater areas.
- Optionally, disable the collisions of the invisible object if that behavior suits your needs.
Setting Up Landscape Masking
-
Enable Virtual Texture
- To use the LandscapeVisibilityMask, make sure that Virtual Texture is enabled for your landscape.
-
Add OceanologyManager
- Drag the
OceanologyManager
actor into the scene to obtain height data for the landscape.
- Drag the
-
Activate LandscapeVisibilityMask
- Activate the LandscapeVisibilityMask to allow the landscape to interact correctly with the water surface.
-
Control Masking Distance
- You can control the masking distance with the Mask Landscape Edges parameter to blend the landscape and water more smoothly.
Masking Transparent Materials Underwater
-
For transparent materials that need to be rendered underwater, go to the material settings, specifically the Translucency section.
-
Enable Output Depth and Velocity if your shader allows for it.
-
Alternatively, go to the Advanced section of the translucency settings and change the Translucency Pass to Before DOF to ensure proper masking behavior underwater.
Examples of Water Mask Usage
-
Invisible Object Masking: Consider placing an invisible sphere that interacts with the water surface, creating ripples or displacement without being seen. This is useful for adding interactive elements in the environment that affect water dynamics.
-
Landscape Masking: Masking the edges of a landscape to blend seamlessly with a lake or ocean, creating a visually consistent shoreline where the landscape and water meet.
-
Transparent Material Adjustments: For transparent objects like glass or water plants that should be masked underwater, use the translucent material settings to properly integrate them into the scene without rendering issues.
Future Enhancements
In future updates, additional masking methods may be introduced, such as Custom Stencil or Single Layer Mask, providing even more options and flexibility for masking in your projects.
Summary
The Water Mask feature in Oceanology provides extensive control over how water interacts with both landscapes and objects in your scene. By using the LandscapeVisibilityMask and ObjectVisibilityMask, you can achieve a wide range of effects to enhance realism and immersion. Whether you're masking objects to create subtle interactions with water or adjusting landscape edges for smoother shorelines, Water Mask helps you bring your vision to life.