Edit

Share via


ClippingPrimitive Class

Definition

An abstract primitive component to animate and visualize a clipping primitive that can be used to drive per pixel based clipping.

public ref class ClippingPrimitive abstract : UnityEngine::MonoBehaviour, Microsoft::MixedReality::Toolkit::Rendering::IMaterialInstanceOwner
[UnityEngine.ExecuteAlways]
[UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/rendering/clipping-primitive")]
public abstract class ClippingPrimitive : UnityEngine.MonoBehaviour, Microsoft.MixedReality.Toolkit.Rendering.IMaterialInstanceOwner
[<UnityEngine.ExecuteAlways>]
[<UnityEngine.HelpURL("https://docs.microsoft.com/windows/mixed-reality/mrtk-unity/features/rendering/clipping-primitive")>]
type ClippingPrimitive = class
    inherit MonoBehaviour
    interface IMaterialInstanceOwner
Public MustInherit Class ClippingPrimitive
Inherits MonoBehaviour
Implements IMaterialInstanceOwner
Inheritance
UnityEngine.MonoBehaviour
ClippingPrimitive
Derived
Attributes
UnityEngine.ExecuteAlwaysAttribute UnityEngine.HelpURLAttribute
Implements

Constructors

ClippingPrimitive()

Fields

clippingSide
materialPropertyBlock
rendererDict

The renderer(s) that should be affected by the primitive.

renderers

Properties

ApplyToSharedMaterial

Toggles whether the clipping features will apply to shared materials or material instances (default).

CacheSharedMaterialsFromRenderer

Whether to let managed MaterialInstances use a cached copy of cachedRenderer.sharedMaterials or call sharedMaterials on the Renderer directly. Enabling the option will lead to better performance but you must turn it off before modifying sharedMaterials of the Renderer.

ClippingSide

The renderer(s) that should be affected by the primitive.

ClippingSideProperty
IsDirty

Keeping track of any field, property or transformation changes to optimize material property block setting.

Keyword
UseOnPreRender

Toggles whether the primitive will use the Camera OnPreRender event.

Methods

AddRenderer(Renderer)

Adds a renderer to the list of objects this clipping primitive clips.

Awake()
BeginUpdateShaderProperties()
ClearRenderers()

Removes all renderers in the list of objects this clipping primitive clips.

ClearRenderers(Boolean)

Removes all renderers in the list of objects this clipping primitive clips.

EditorUpdate()
EndUpdateShaderProperties()
GetRenderersCopy()

Returns a copy of the current list of renderers.

Initialize()
LateUpdate()
OnCameraPreRender(CameraEventRouter)
OnDestroy()
OnDisable()
OnEnable()
OnMaterialChanged(MaterialInstance)

Method which is invoked by a MaterialInstance when an external material change is detected. This normally occurs when materials are changed via Renderer.material, Renderer.materials, or via the editor.

RemoveRenderer(Renderer)

Removes a renderer to the list of objects this clipping primitive clips.

RemoveRenderer(Renderer, Boolean)

Removes a renderer from the list of objects this clipping primitive clips.

ToggleClippingFeature(Boolean)
ToggleClippingFeature(Material, Boolean)
ToggleClippingFeature(Material[], Boolean)
Update()
UpdateRenderers()
UpdateShaderProperties(MaterialPropertyBlock)

Applies to