Give Page Feedback | API

Cell Visual Transition Controllers - Mat Prop Block Transitioner

The Mat Prop Block Transitioner stands for Material Property Block Transitioner. As this name implies, this component performs transitions by setting a material property using Material Property Blocks. Typically the property set will control some kind of transparency or cross fade effect, however this is not a strict requirement. It's possible the property will have nothing to do with transparency and/or cross fading.

Read About Material Property Blocks

Creating A Mat Prop Block Transitioner Component

You can add this component by selecting a game object and then selecting from the Top Menu Bar:

Component -> Deep Space Labs -> -> SAM -> Visual Transition Controllers -> Mat Prop Block Transitioner

Adding A Mat Prop Block Transitioner Component From The Top Menu Bar GIF

or by selecting a game object and using the Add Component menu via its inspector:

Component -> Deep Space Labs -> -> SAM -> Visual Transition Controllers -> Mat Prop Block Transitioner

Adding A Mat Prop Block Transitioner Component From Add Component Menu GIF

Benefits

Using Material Property Blocks allows you to use the same Material across many different Game Objects while allowing for each Renderer component to use unique values. In terms of the SAM, this allows the transitioner to transition the visibility specific Asset Chunks while maintaining the visibility of other Asset Chunks, even when all of those Asset Chunks use the same Material.

Mat Prop Block Transitioner Vs Per Material Transitioner

These two Transitioners function in nearly the same way; the only difference between them is that the Mat Prop Block Transitioner uses Material Property Blocks to adjust the shader property while the Per Material Transitioner uses Material.SetFloat. While this difference is subtle, the effects on your game can be huge depending on your setup.

The Mat Prop Block Transitioner is great for situations where you are using GPU Instancing (i.e., drawing the same mesh repeatedly) or not using the Scriptable Render Pipeline.

The Per Material Transitioner, on the other hand, is primarily intended to be used with the Scriptable Render Pipeline in situations where the SRP Batcher can take advantage of your Mesh/Material/Shader setup, which generally includes a small number of shaders/shader variants and a large number of unique materials or meshes.

We recommend testing with both transitioners to see which is more performant with your setup.

Read About The SRP Batcher

Multiple Materials Per Mesh

This Transitioner applies the material property block at the renderer level, which is usually desired. However, if you do not want all materials that use the shader property to be affected, you will need to create a custom transitioner that targets a specific Material and/or Materials.

Transition Settings

These settings allow you to control the amount of time transitions take as well as separate curves that control the lerping of the transition value while transitioning Asset Chunks from Invisible to Visible and Visible to Invisible.

--Special Note--
You can modify the transition time at runtime via the TransitionTime property.

Use Unity Crossfade

Enabling this special option allows the transitioner to manipulate materials in the same way that Unity does when using its built-in LODGroup component, i.e., it enables LOD Crossfading for materials which are compatible with the LODGroup component.

Do note, however, when using this option, you will almost certainly need to set the Visual State Of Stored Assets When Active option to Invisible, for any LOD Groups that will be used with the transitioner. This setting can be found on each LOD Group specific tab on your Streamable Grid Assets.

Also note that it is necessary to assign all of the Materials that will be transitioned using the Transitioner explicitly, in order for certain shader keywords to be enabled. If you do not do this, the transitions will not work.

Other Settings

Hover over the field labels in the inspector to view additional information about each setting.