# Masking out water

<figure><img src="/files/MDPXLduXd1eVY2i48w67" alt=""><figcaption><p>Water is masked out of the boat hull interior</p></figcaption></figure>

There are two ways of masking out water:

1. Using `M_WaterInvalidator` material that gets water removed from the volume covered by the mesh it is assigned to. Mesh should be ceiled.&#x20;

{% hint style="success" %}
Check the `BP_Boat`. There's a `hull_mask` static mesh attached with the `M_WaterInvalidator` material assigned. Mesh covers the whole volume of the boat hull.
{% endhint %}

2. Using distance field mask. In the `M_OceanFFT` check the reroute node called `Masking Out Water` that is unused. Plug it into the `Opacity Mask` input in the root node. `Opacity Mask` accepts either `0` or `1` value per-pixel and discards the pixel based on this value.

<div align="left"><figure><img src="/files/mfH9Kvw68q2d3BETF3is" alt=""><figcaption></figcaption></figure></div>

This mask removes water wherever the distance field is negative, meaning it affects the interior of the mesh. Use the `Mask Offset` parameter to adjust the mask's position. Ensure that the distance field is enabled on the mesh you want to exclude water from.

{% hint style="warning" %}
The distance field method gives you less control as it will be applied for every mesh that has distance field enabled. Whereas the first method, which is based on the material, give you full control over the areas you want to exclude water from.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.planetaryoceans.com/guide-v.-2.1/masking-out-water.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
