Navigation
API > API/Runtime > API/Runtime/Engine
| Name | UMaterialInstanceDynamic |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Public/Materials/MaterialInstanceDynamic.h |
| Include Path | #include "Materials/MaterialInstanceDynamic.h" |
Syntax
UCLASS (HideCategories=Object, CollapseCategories, BlueprintType, MinimalAPI)
class UMaterialInstanceDynamic : public UMaterialInstance
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UMaterialInterface → UMaterialInstance → UMaterialInstanceDynamic
Implements Interfaces
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UMaterialInstanceDynamic
(
const FObjectInitializer& ObjectInitializer |
Materials/MaterialInstanceDynamic.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| RenamedTextures | TMap< FName, TArray< FName > > | In order to remap to the correct texture streaming data, we must keep track of each texture renamed. | Materials/MaterialInstanceDynamic.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void ClearParameterValues() |
Remove all parameter values | Materials/MaterialInstanceDynamic.h | |
void CopyInterpParameters
(
UMaterialInstance* Source |
Copies over parameters given a material instance (only copy from the instance, not following the hierarchy) much faster than K2_CopyMaterialInstanceParameters(), The output is the object itself (this). | Materials/MaterialInstanceDynamic.h |
|
void CopyMaterialUniformParameters
(
UMaterialInterface* Source |
Copies the uniform parameters (scalar, vector and texture) from a material or instance hierarchy. | Materials/MaterialInstanceDynamic.h | |
void CopyParameterOverrides
(
UMaterialInstance* MaterialInstance |
Copy parameter values from another material instance. | Materials/MaterialInstanceDynamic.h |
|
void CopyScalarAndVectorParameters
(
const UMaterialInterface& SourceMaterialToCopyFrom, |
Materials/MaterialInstanceDynamic.h | ||
void CopyScalarAndVectorParameters
(
const UMaterialInterface& SourceMaterialToCopyFrom, |
Copy all interpolatable (scalar/vector) parameters from *SourceMaterialToCopyFrom to *this, using the current QualityLevel and given FeatureLevel For runtime use. | Materials/MaterialInstanceDynamic.h | |
bool InitializeScalarParameterAndGetIndex
(
const FName& ParameterName, |
Use this function to set an initial value and fetch the index for use in SetScalarParameterByIndex. | Materials/MaterialInstanceDynamic.h |
|
bool InitializeVectorParameterAndGetIndex
(
const FName& ParameterName, |
Use this function to set an initial value and fetch the index for use in the following function. | Materials/MaterialInstanceDynamic.h | |
void K2_CopyMaterialInstanceParameters
(
UMaterialInterface* Source, |
Copies over parameters given a material interface (copy each instance following the hierarchy) Very slow implementation, avoid using at runtime. | Materials/MaterialInstanceDynamic.h |
|
float K2_GetScalarParameterValue
(
FName ParameterName |
Get the current scalar (float) parameter value from an MID | Materials/MaterialInstanceDynamic.h |
|
float K2_GetScalarParameterValueByInfo
(
const FMaterialParameterInfo& ParameterInfo |
Get the current scalar (float) parameter value from an MID, using MPI (to allow access to layer parameters) | Materials/MaterialInstanceDynamic.h |
|
UTextureCollection * K2_GetTextureCollectionParameterValue
(
FName ParameterName |
Get the current MID texture collection parameter value | Materials/MaterialInstanceDynamic.h |
|
UTextureCollection * K2_GetTextureCollectionParameterValueByInfo
(
const FMaterialParameterInfo& ParameterInfo |
Get the current MID texture collection parameter value, using MPI (to allow access to layer parameters) | Materials/MaterialInstanceDynamic.h |
|
| Get the current MID texture parameter value | Materials/MaterialInstanceDynamic.h |
|
|
UTexture * K2_GetTextureParameterValueByInfo
(
const FMaterialParameterInfo& ParameterInfo |
Get the current MID texture parameter value, using MPI (to allow access to layer parameters) | Materials/MaterialInstanceDynamic.h |
|
FLinearColor K2_GetVectorParameterValue
(
FName ParameterName |
Get the current MID vector parameter value | Materials/MaterialInstanceDynamic.h |
|
FLinearColor K2_GetVectorParameterValueByInfo
(
const FMaterialParameterInfo& ParameterInfo |
Get the current MID vector parameter value, using MPI (to allow access to layer parameters) | Materials/MaterialInstanceDynamic.h |
|
void K2_InterpolateMaterialInstanceParams
(
UMaterialInstance* SourceA, |
Interpolates the scalar and vector parameters of this material instance based on two other material instances, and an alpha blending factor The output is the object itself (this). | Materials/MaterialInstanceDynamic.h |
|
void SetDoubleVectorParameterValue
(
FName ParameterName, |
Set an MID vector parameter value | Materials/MaterialInstanceDynamic.h |
|
void SetFontParameterValue
(
const FMaterialParameterInfo& ParameterInfo, |
Set the value of the given font parameter. | Materials/MaterialInstanceDynamic.h | |
void SetNaniteOverride
(
UMaterialInterface* InMaterial |
Materials/MaterialInstanceDynamic.h | ||
void SetRuntimeVirtualTextureParameterValue
(
FName ParameterName, |
Set an MID texture parameter value | Materials/MaterialInstanceDynamic.h |
|
void SetRuntimeVirtualTextureParameterValueByInfo
(
const FMaterialParameterInfo& ParameterInfo, |
Set an MID texture parameter value using MPI (to allow access to layer parameters) | Materials/MaterialInstanceDynamic.h |
|
bool SetScalarParameterByIndex
(
int32 ParameterIndex, |
Use the cached value of OutParameterIndex from InitializeScalarParameterAndGetIndex to set the scalar parameter ONLY on the exact same MID. | Materials/MaterialInstanceDynamic.h |
|
void SetScalarParameterValue
(
FName ParameterName, |
Set a MID scalar (float) parameter value | Materials/MaterialInstanceDynamic.h |
|
void SetScalarParameterValueByInfo
(
const FMaterialParameterInfo& ParameterInfo, |
Set a MID scalar (float) parameter value using MPI (to allow access to layer parameters) | Materials/MaterialInstanceDynamic.h |
|
void SetSparseVolumeTextureParameterValue
(
FName ParameterName, |
Set an MID texture parameter value | Materials/MaterialInstanceDynamic.h |
|
void SetTextureCollectionParameterValue
(
FName ParameterName, |
Set an MID texture collection parameter value | Materials/MaterialInstanceDynamic.h |
|
void SetTextureCollectionParameterValueByInfo
(
const FMaterialParameterInfo& ParameterInfo, |
Set an MID texture collection parameter value using MPI (to allow access to layer parameters) | Materials/MaterialInstanceDynamic.h |
|
| Set an MID texture parameter value | Materials/MaterialInstanceDynamic.h |
|
|
void SetTextureParameterValueByInfo
(
const FMaterialParameterInfo& ParameterInfo, |
Set an MID texture parameter value using MPI (to allow access to layer parameters) | Materials/MaterialInstanceDynamic.h |
|
bool SetVectorParameterByIndex
(
int32 ParameterIndex, |
Use the cached value of OutParameterIndex above to set the vector parameter ONLY on the exact same MID. | Materials/MaterialInstanceDynamic.h | |
void SetVectorParameterValue
(
FName ParameterName, |
Set an MID vector parameter value | Materials/MaterialInstanceDynamic.h |
|
void SetVectorParameterValue
(
FName ParameterName, |
Conveniences to keep general FLinearColor constructors explicit without adding extra burden to existing users of this function (where the conversion is straightforward). | Materials/MaterialInstanceDynamic.h | |
void SetVectorParameterValue
(
FName ParameterName, |
Materials/MaterialInstanceDynamic.h | ||
void SetVectorParameterValueByInfo
(
const FMaterialParameterInfo& ParameterInfo, |
Materials/MaterialInstanceDynamic.h | ||
void SetVectorParameterValueByInfo
(
const FMaterialParameterInfo& ParameterInfo, |
Set an MID vector parameter value, using MPI (to allow access to layer parameters) | Materials/MaterialInstanceDynamic.h |
|
void SetVectorParameterValueByInfo
(
const FMaterialParameterInfo& ParameterInfo, |
Materials/MaterialInstanceDynamic.h |
Overridden from UMaterialInstance
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool HasOverridenBaseProperties() |
Materials/MaterialInstanceDynamic.h | ||
virtual void UpdateCachedData() |
Materials/MaterialInstanceDynamic.h |
Overridden from UMaterialInterface
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual EBlendMode GetBlendMode() |
Materials/MaterialInstanceDynamic.h | ||
virtual bool GetCastDynamicShadowAsMasked() |
Materials/MaterialInstanceDynamic.h | ||
virtual FDisplacementFadeRange GetDisplacementFadeRange() |
Materials/MaterialInstanceDynamic.h | ||
virtual FDisplacementScaling GetDisplacementScaling() |
Materials/MaterialInstanceDynamic.h | ||
virtual float GetMaxWorldPositionOffsetDisplacement() |
Materials/MaterialInstanceDynamic.h | ||
virtual float GetOpacityMaskClipValue() |
Material base property overrides. MIDs cannot override these so they just grab from their parent. | Materials/MaterialInstanceDynamic.h | |
virtual FMaterialShadingModelField GetShadingModels() |
Materials/MaterialInstanceDynamic.h | ||
virtual float GetTextureDensity
(
FName TextureName, |
This overrides does the remapping before looking at the parent data. | Materials/MaterialInstanceDynamic.h | |
virtual bool HasPixelAnimation() |
Materials/MaterialInstanceDynamic.h | ||
virtual bool IsDisplacementFadeEnabled() |
Materials/MaterialInstanceDynamic.h | ||
virtual bool IsDitheredLODTransition() |
Materials/MaterialInstanceDynamic.h | ||
virtual bool IsMasked() |
Materials/MaterialInstanceDynamic.h | ||
virtual bool IsShadingModelFromMaterialExpression() |
Materials/MaterialInstanceDynamic.h | ||
virtual bool IsThinSurface() |
Materials/MaterialInstanceDynamic.h | ||
virtual bool IsTranslucencyWritingVelocity() |
Materials/MaterialInstanceDynamic.h | ||
virtual bool IsTwoSided() |
Materials/MaterialInstanceDynamic.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void InitializeMID
(
UMaterialInterface* ParentMaterial |
Materials/MaterialInstanceDynamic.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static UMaterialInstanceDynamic * Create
(
UMaterialInterface* ParentMaterial, |
Create a material instance dynamic parented to the specified material. [Optional] Specify name. | Materials/MaterialInstanceDynamic.h |