Materialpropertyblock



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

Inheritance
ClippingPrimitive

Graphics: Added array property getters (e.g. GetFloatArray) for Material, MaterialPropertyBlock and Shader class. Graphics: Added bool SystemInfo.usesReversedZBuffer to be able to know if the platform is using a 'reversed' depth buffer. Graphics: Added BuiltinRenderTextureType.ResolvedDepth enum so command buffers can use it. Easily setup GPU instancing / material property blocks to optimize your batches and draw callsAvailalbe at: http://u3d.as/1qXC. MaterialPropertyBlock A block of material values to apply. MaterialPropertyBlock is used by Graphics.DrawMesh. Use it in situations where you want to draw multiple objects with the same material, but slightly different properties. Jun 12, 2019 Hi, I wanna change the texture of my spine animations, with this forum's advice I made it work by using MaterialPropertyBlock. But some animations not working properly, some parts of its attachments are not replaced with the new texture.

Implements
Namespace: Microsoft.MixedReality.Toolkit.Utilities
Assembly: cs.temp.dll.dll
Syntax

Fields

clippingSide

Declaration
Field Value
TypeDescription
ClippingPrimitive.Side

materialPropertyBlock

Declaration
Field Value
TypeDescription
MaterialPropertyBlock

renderers

Declaration
Field Value
TypeDescription
List<Renderer>

Properties

ClippingSide

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

Declaration
Property Value
TypeDescription
ClippingPrimitive.Side

ClippingSideProperty

Declaration
Property Value
TypeDescription
String

IsDirty

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

Declaration
Property Value
TypeDescription
Boolean

Keyword

Declaration
Property Value
TypeDescription
String

UseOnPreRender

Toggles whether the primitive will use the Camera OnPreRender event.

Declaration
Property Value
TypeDescription
Boolean
Remarks

This is especially helpful if you're trying to clip dynamically created objects that may be added to the scene after LateUpdate such as OnWillRender

Methods

AddRenderer(Renderer)

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

Declaration
Parameters
TypeNameDescription
Renderer_renderer

ClearRenderers()

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

Declaration

GetRenderersCopy()

Declaration
Returns
TypeDescription
IEnumerable<Renderer>

The current list of renderers.

Materialpropertyblock

Initialize()

Declaration

LateUpdate()

Declaration

OnCameraPreRender(CameraEventRouter)

Declaration
Parameters
TypeNameDescription
CameraEventRouterrouter

OnDestroy()

Declaration
Materialpropertyblock

OnDisable()

Declaration

OnEnable()

Declaration

OnMaterialChanged(MaterialInstance)

Declaration
Parameters
TypeNameDescription
MaterialInstancematerialInstance

RemoveRenderer(Renderer)

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

Declaration
Parameters
TypeNameDescription
Renderer_renderer

ToggleClippingFeature(Material, Boolean)

Declaration
Parameters
TypeNameDescription
Materialmaterial
BooleankeywordOn

ToggleClippingFeature(Material[], Boolean)

Declaration
Parameters
TypeNameDescription
Material[]materials
BooleankeywordOn

ToggleClippingFeature(Boolean)

Declaration

Materialpropertyblock Performance

Parameters
TypeNameDescription
BooleankeywordOn

UpdateRenderers()

Declaration

UpdateShaderProperties(MaterialPropertyBlock)

Declaration
Parameters

Materialpropertyblock Example

TypeNameDescription
MaterialPropertyBlockmaterialPropertyBlock

Materialpropertyblock Batching

Implements

Materialpropertyblock Srp

IMaterialInstanceOwner