How to Use With Materials
This page covers how to use the features of Mesh Occlusion Material and integration.
For Materials
You can add this to materials very easily, here is how.
To support the shaders, switch to either masked or translucent blend mode based on your requirements. If you opt for translucent, change the lighting mode to "Surface TranslucencyVolume" to enable PBR inputs.

Right click the material graph and search for “Material function call”.

Locate the "visibility" option in the material function call node, and select "masked" or "translucency" based on your material type. In the pro version, additional options are available; refer to the demo map for all of the options available.

Set the parameters you want. If using the "Use Shader Component" boolean, follow the steps under the "Using the Shader Component" section.

That is it! Cameras should now support the visibility. if using the shader component, you must add it to the character/pawn you are using for it to work.
Using The Shader Component:
Go to your character or pawn that needs to check visibility occlusion for the shader.
Click add component and search for “visibility shader” it should be called “AC_VisibilityShader”.
Copy the camera tag on the component to your camera component.

Set the other parameters for interpolation speed, distance for occlusion, and debug draw type.

The shader should now recognize the player and detect if it is being blocked by an object. If you encounter issues, join the Discord for support.
What the shader parameters do:
Hole Size: For visibility shaders that apply a hole to the mesh to see through, this is how big the hole will be. For far away cameras set this to something high like 50-100 and use visibility ID.
Use Shader Component: This ensures the visibility shader only works when the player is being blocked from the mesh occluding it. Without this, any camera will use the visibility shader whenever near the mesh.
Noise Scale: how big should the noise pattern be on the visibility shader effect.
Object Scale Offset: This is a scale offset for the mesh to determine if it should be occluded, only on full mesh visibility shaders.
Max Noise Visibility: This is how much should the noise be translucent in the noise visibility shader translucency type.
How to use Visibility IDs for occlusion filtering:
Enable the checkbox in your material instance or material parameter for "Use Visibility ID" and assign it a unique ID value, such as "1.0".
Go to your actor that has the material occlusion enabled and add the component titled “AC_VisibilityID"
In the details panel of the AC_VisibilityID, assign it a Visibility ID that matches the material visibility ID used by its mesh. For example, if Material A is on Actor 1, both the material and actor should have the Visibility ID set to "1.0"
Make sure the
AC_VisibilityShader
is configured according to the instructions above. This will enable the shader to only occlude meshes with the compatible ID.
Last updated