Edytuj

Udostępnij za pośrednictwem


MeshOutline Class

Definition

Component which can be used to render an outline around a mesh renderer. Enabling this component introduces an additional render pass of the object being outlined, but is designed to run performantly on mobile Mixed Reality devices and does not utilize any post processes. This behavior is designed to be used in conjunction with the MRTK/Standard shader. Limitations of this effect include it not working well on objects which are not watertight (or required to be two sided) and depth sorting issues can occur on overlapping objects.

public ref class MeshOutline : Microsoft::MixedReality::Toolkit::Utilities::BaseMeshOutline
[UnityEngine.AddComponentMenu("Scripts/MRTK/Core/MeshOutline")]
[UnityEngine.RequireComponent(typeof(UnityEngine.MeshRenderer))]
public class MeshOutline : Microsoft.MixedReality.Toolkit.Utilities.BaseMeshOutline
[<UnityEngine.AddComponentMenu("Scripts/MRTK/Core/MeshOutline")>]
[<UnityEngine.RequireComponent(typeof(UnityEngine.MeshRenderer))>]
type MeshOutline = class
    inherit BaseMeshOutline
Public Class MeshOutline
Inherits BaseMeshOutline
Inheritance
UnityEngine.MonoBehaviour
MeshOutline
Attributes
UnityEngine.AddComponentMenuAttribute UnityEngine.RequireComponentAttribute

Constructors

MeshOutline()

Fields

outlineMaterial (Inherited from BaseMeshOutline)
outlineWidth (Inherited from BaseMeshOutline)

Properties

OutlineMaterial

The material used to render the outline. Outline materials should normal have "Depth Write" set to Off and "Vertex Extrusion" enabled. Most MRTK/Standard features should work as an outline material, but it is recommended to keep the outline material as simple as possible.

(Inherited from BaseMeshOutline)
OutlineWidth

How thick (in meters) should the outline be. Overrides the "Extrusion Value" in the MRTK/Standard material.

(Inherited from BaseMeshOutline)

Methods

ApplyOutlineMaterial()

Prepares and applies the current outline material to the renderer.

ApplyOutlineWidth()

Updates the current vertex extrusion value used by the shader.

OnValidate()

Enables users to modify inspector properties while playing in the editor.

(Inherited from BaseMeshOutline)

Applies to