Material Property Block: Difference between revisions

From Resonite Wiki
create page. TODO: what happens with >1 material in the materials list??? it's weird???
 
m my ass forgot to clean up that external link
Line 13: Line 13:
* [[Component:MainAndMaskTexturePropertyBlock]]
* [[Component:MainAndMaskTexturePropertyBlock]]
* [[Component:Projection360PropertyBlock]]
* [[Component:Projection360PropertyBlock]]
== External Links ==
https://web.archive.org/web/20200330085123/http://thomasmountainborn.com/2016/05/25/materialpropertyblocks/


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

Revision as of 01:36, 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

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.