Edit

Share via


MeshOutline Examples

This scene illustrates the outline feature and its variation possibilities. Outlines are a quick and appealing feature you can use to highlight objects in a scene. In addition to color and thickness, we can define the highlighting by adding animations and gradient effects.

Screenshot of several objects with outlines.

To achieve the outline effect, add the MeshOutline script for single objects or the MeshOutlineHierarchy script for entire mesh hierarchies. Adjust the Outline Width to your needs and apply an outline material.

Screenshot of options in the MeshOutline and MeshOutlineHierarchy scripts.

For guides on how to set up an outline material, see MeshOutline Material Setup

Outline Pulse Example

Screenshot of a rectangular object with a pulsating outline.

In this example, the Outline Width value is animated and applied to the object itself as Animator 'OutlinePulseController'.

Screenshot of the Animator with the Controller option set to OutlinePulseController

[NOTE] Depending on the model's edge hardness, you might experience jagged and disrupted results. For the Outline effect to work properly, the model's vertex normals need to be smooth. If the model itself doesn't provide this, try an in-editor solution: apply the MeshSmoother script to the model. Learn more about the MeshSmoother.

Screenshot of the MeshSmoother component with the Smooth Normals on Awakening option turned on.

Hierarchies and multiple and skinned meshes

Screenshot of an animated cat with an outline.

Some imported 3D objects come in multiple parts in hierarchical structures. In this case, the model has several sub-nodes, such as skeletal joints and unattached additional meshes. In order to avoid searching and applying through the entire hierarchy, you can add the MeshOutlineHierarchy script to the root object and then all meshes inside that structure will have the effect applied as well. As seen in this example, the outline works very well on skinned and animated meshes, too.

Illumination effects

Screenshot of a doughnut-shaped object, also called a torus, outlined with an orbiting Proximity Light.

In this example, the outlines are illuminated by an orbiting Proximity Light, which is part of both the MRTK and the MRGT. Highlight size, color, gradients and intensity are configurable. To learn more about the Proximity Light, see the Proximity Light Overview and Proximity Lighting Example

See also