> For the complete documentation index, see [llms.txt](https://multiset.gitbook.io/multiset/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://multiset.gitbook.io/multiset/unity-sdk/occlusion.md).

# Occlusion

To add occlusion in your AR scene using mesh, follow the below steps

## Option 1

<figure><img src="/files/PeHGLwwsr2aAtkHXByFK" alt=""><figcaption></figcaption></figure>

### Runtime Occlusion with the existing Mesh

The Map Mesh Handler provides runtime management of mesh occlusion through a dedicated "Enable Occlusion" option. This feature optimizes the handling of raw meshes and their occlusion materials during application sessions.

The Map Mesh Handler script performs two primary functions:

1. Downloads raw meshes as needed during runtime
2. Applies occlusion materials to these meshes based on session requirements

### Occlusion Behavior in MapSets

When working with MapSets, the occlusion system implements a selective application approach:

* Occlusion is only applied to individual Maps where user localization has occurred
* This selective application is designed to optimize memory usage throughout the application lifecycle
* Other Maps within the MapSet remain unaffected until localization is performed

## Option 2

### 1. Download and Import Raw mesh in Unity

From Developer Portal download and import raw mesh, which is low poly and not textured. You can further reduce the size of this mesh in any 3D tool like Blender by reducing the poly count.

<figure><img src="/files/yOx8sTxgaHtmlJb5IkCI" alt=""><figcaption></figcaption></figure>

### 2. Create Occlusion material and texture

Create a simple occlusion texture and material that makes mesh invisible in the scene and will provide occlusion in AR if applied to a mesh. Below is a sample of it that you can use

{% file src="/files/UvJp6XGVwNzI5NY0sSk1" %}

{% file src="/files/gYvg31KGS9haaq55DkEJ" %}

### 3. Apply Occlusion material to the Mesh

Simply assign the occlusion material to the Mesh and it will become invisible in the editor, alternatively, you can assign this material in runtime using a script.

<div><figure><img src="/files/kRopPXe3jcyfFidJe9AT" alt=""><figcaption></figcaption></figure> <figure><img src="/files/bqrnQ0xOxG5kM2WITTkL" alt=""><figcaption></figcaption></figure></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://multiset.gitbook.io/multiset/unity-sdk/occlusion.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
