Navigation
Unreal Engine C++ API Reference > Runtime > Engine > Materials > UMaterialInstanceDynamic
References
Module | Engine |
Header | /Engine/Source/Runtime/Engine/Classes/Materials/MaterialInstanceDynamic.h |
Include | #include "Materials/MaterialInstanceDynamic.h" |
Source | /Engine/Source/Runtime/Engine/Private/Materials/MaterialInstanceDynamic.cpp |
bool InitializeScalarParameterAndGetIndex
&40;
const FName & ParameterName,
float Value,
int32 & OutParameterIndex
&41;
Remarks
Use this function to set an initial value and fetch the index for use in SetScalarParameterByIndex. This function should only be called once for a particular name, and then use SetScalarParameterByIndex for subsequent calls. However, beware using this except in cases where optimization is critical, which is generally only if you're using an unusually high number of parameters in a material and setting a large number of parameters in the same frame. Also, if the material is changed in any way that can change the parameter list, the index can be invalidated.