Material Transitions
Smash Ultimate contains a number of animated material transitions. The transitions happen quite quickly, so it's easy to miss the effect during normal gameplay. Examples of material transitions include inkling's ink or the metal box item. An animated threshold value combined with the model's NOR map blue channel enables models to smoothly transition between two completely different materials. The demo below demonstrates the effect of adjusting the threshold value.
Material Transition Blending
The pseudocode below describes how the blending factor is calculated using the model's NOR map. The smooth light to dark transitions in the NOR map blue channel are converted to values of either 0.0 or 1.0 using a threshold value. In the demo above, note the difference in appearance between the NOR.b and calculated transition blend values.
As the threshold value approaches 1.0, the transition material fills in more of the model, starting with brighter regions of the NOR map blue channel and growing into darker regions. A NOR map blue channel value of 0.0 would transition instantly, a value of 0.5 would take later to transition, and a value of 1.0 takes the longest to transition to the transition material. As the threshold value approaches 0.0, the transition is reversed with the brightest regions of the NOR map blue channel being the last regions of the model to return to the normal material.
Materials are blended together by blending their input parameters rather than blending the final colors for both materials. Blending the input parameters is generally more efficient because the model only has to be rendered once rather than rendering with each material separately and blending the results.
// Calculate the blending factor between the original and transition material.
float transitionBlend = 0.0;
if (norColor.b >= (1.0 - threshold)) {
transitionBlend = 1.0;
}
// Blend the relevant shading parameters.
shadingParameter = mix(originalParameter, transitionMaterialParameter, transitionBlend);