Material Property Block: Difference between revisions

From Resonite Wiki
m my ass forgot to clean up that external link
Added a new section: Components That Take In Material Property Block Components
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
'''Material Property Blocks''' provide an efficient and compact method of changing certain properties of materials without need to duplicate said material.
'''Material Property Blocks''' provide an efficient and compact method of changing certain properties of [[Material|materials]] without need to duplicate said material.


For example, if one wishes to have the exact same material properties for many different objects spare the primary texture, a [[Component:MainTexturePropertyBlock|MainTexturePropertyBlock]] will provide such streamlined flexibility while also being more performant. Such performance increases are only significant when needing to render a huge amount of objects (on the order of hundreds)<ref>Mountainborn, Thomas. [https://web.archive.org/web/20200330085123/http://thomasmountainborn.com/2016/05/25/materialpropertyblocks/ "Unity material animation using MaterialPropertyBlocks"]. Archived from [http://thomasmountainborn.com/2016/05/25/materialpropertyblocks/ the original] on 30 March 2020.</ref>, but there is nonetheless no <em>downside</em> to using Material Property Blocks no matter the object count.<ref>[https://officehours.probableprime.co.uk/episodes/geenz-2023-11-08/ Geenz's Office Hours for 2023-11-08]. Event occurs at 6:09.</ref>
For example, if one wishes to have the exact same material properties for many different objects spare the primary texture, a [[Component:MainTexturePropertyBlock|MainTexturePropertyBlock]] will provide such streamlined flexibility while also being more performant. Such performance increases are only significant when needing to render a huge amount of objects (on the order of hundreds)<ref>Mountainborn, Thomas. [https://web.archive.org/web/20200330085123/http://thomasmountainborn.com/2016/05/25/materialpropertyblocks/ "Unity material animation using MaterialPropertyBlocks"]. Archived from [http://thomasmountainborn.com/2016/05/25/materialpropertyblocks/ the original] on 30 March 2020.</ref>, but there is nonetheless no <em>downside</em> to using Material Property Blocks no matter the object count.<ref>[https://officehours.probableprime.co.uk/episodes/geenz-2023-11-08/ Geenz's Office Hours for 2023-11-08]. Event occurs at 6:09.</ref>
Line 13: Line 13:
* [[Component:MainAndMaskTexturePropertyBlock]]
* [[Component:MainAndMaskTexturePropertyBlock]]
* [[Component:Projection360PropertyBlock]]
* [[Component:Projection360PropertyBlock]]
== Components That Take In Material Property Block Components ==
* [[Component:RawGraphic]]


== References ==
== References ==
<references />
<references />

Latest revision as of 22:11, 28 July 2024

Material Property Blocks provide an efficient and compact method of changing certain properties of materials without need to duplicate said material.

For example, if one wishes to have the exact same material properties for many different objects spare the primary texture, a MainTexturePropertyBlock will provide such streamlined flexibility while also being more performant. Such performance increases are only significant when needing to render a huge amount of objects (on the order of hundreds)[1], but there is nonetheless no downside to using Material Property Blocks no matter the object count.[2]

General Usage

Every PropertyBlock component will have fields to override their respective fields on compatible materials. On a MeshRenderer orSkinnedMeshRenderer, there exists a MaterialPropertyBlocks list. Placing a PropertyBlock component in this list will apply it to the material in the Materials list.

Limitations

Property blocks are only able to be used on materials that implement its respective material property. For example, UnlitMaterial does not provide a _MainTex property, so MainTexturePropertyBlock will have no effect on it. However, UI_UnlitMaterial provides this property.

Material Property Block Components

Components That Take In Material Property Block Components

References

  1. Mountainborn, Thomas. "Unity material animation using MaterialPropertyBlocks". Archived from the original on 30 March 2020.
  2. Geenz's Office Hours for 2023-11-08. Event occurs at 6:09.