Method Override
Override(VolumeComponent, float)
Interpolates a VolumeComponent with this component by an interpolation factor and puts the result back into the given VolumeComponent.
Declaration
public virtual void Override(VolumeComponent state, float interpFactor)
Parameters
Type | Name | Description |
---|---|---|
VolumeComponent | state | The internal component to interpolate from. You must store the result of the interpolation in this same component. |
float | interpFactor | The interpolation factor in range [0,1]. |
Remarks
You can override this method to do your own blending. Either loop through the parameters list or reference direct fields. You should only use SetValue(VolumeParameter) to set parameter values and not assign directly to the state object. you should also manually check overrideState before you set any values.
Examples
Below is the default implementation for blending:
public virtual void Override(VolumeComponent state, float interpFactor)
{
int count = parameters.Count;
for (int i = 0; i < count; i++)
{
var stateParam = state.parameters[i];
var toParam = parameters[i];
// Keep track of the override state for debugging purpose
stateParam.overrideState = toParam.overrideState;
if (toParam.overrideState)
stateParam.Interp(stateParam, toParam, interpFactor);
}
}