Skip to content
On this page

Visibility / culling through cameras

Geometry that can't be seen from certain angles and geometry that is occluded can have an impact on performance, memory and disk space. Simplygon has the ability to optimize geometry and remove parts that aren't visible from certain points in space. If material baking is used in combination with visibility Simplygon can decide how much texture space is needed based on the level of visibility. Unused texture space from culled triangles will allow higher texture density for the ones that remain.

This section goes through how to prepare a scene for the Visibility feature. The visibility feature require the user to setup one or more cameras, assign them to a selection-set and then select the set in the Simplygon UI.

The expected result is an asset that is visible from two cameras, with occluded and backfacing areas removed.

Expected result

The first step is to create an asset, in this example we'll use a couple of capsules (you may use any asset you prefer). Select the Capsule in the toolbar (GameObject -> 3D Object -> Capsule) and place it in the center of the scene just on top of the grid, repeat this step if you want more than one object.

Place objects in scene

The second step is to place two cameras (GameObject -> Camera), in most cases there already is a camera (Main Camera) in the scene, we'll reuse this one. Place the cameras so that the recently placed object(s) are in their view (along positive Z and positive X in this example). If you are using another asset you may need to adjust the position of the cameras so that they clearly see the asset. Clicking on a camera usually displays the frustum which can be helpful when placing the cameras.

Note: For visibility Simplygon reads camera properties such as direction, field of view, orthographic / perspective as well as transformation. Target cameras will use the vector between camera and target as view direction, the length will not affect the result.

Place camera in scene

The third step is to create a selection-set with these two cameras. As Unity does not have any official support for selection sets we'll need to add the SimplygonSelectionSet component to the cameras, go ahead and select the two cameras, then go to the main menu and select Component -> Simplygon -> Simplygon Selection Set or to the inspector and add the component Simplygon Selection Set.

Add selection set to selection

For each camera's Simplygon Selection Set component, change the name to "CameraSet" (or any other describing name). Objects with the same selection set name will be linked to the same set during export.

Specify selection set name

The fourth step is to let Simplygon know which camera set to use, let's create a Reduction Pipeline. If Simplygon is not visible, click on Simplygon located at the rightmost vertical edge.

Plug-in manager

Click on Add LOD Component -> Advanced -> Reduction to create a Reduction Pipeline. The reduction ratio is by default set to 0.5 (50%) so let's go with that in this tutorial. Now expand VisibilitySettings and check "Use Backface Culling" and "Cull Occluded Geometry", and in the "Camera Selection Set Name" dropdown, choose the selection-set named "CameraSet".

Create reduction pipeline

Specify visibility settings

The fifth and final step, select the asset in the Viewport or Outliner, then press the yellow Simplygon icon in the Simplygon UI to start the optimization. When the optimization has completed the result will be returned to Unity.

Optimized asset