UMaterialInstanceDynamic

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Materials/MaterialInstanceDynamic.h

Include

#include "Materials/MaterialInstanceDynamic.h"

Syntax

class UMaterialInstanceDynamic : public UMaterialInstance

Variables

Name Description

Public variable

TMap< FName, TA...

 

RenamedTextures

In order to remap to the correct texture streaming data, we must keep track of each texture renamed.

Constructors

Name Description

Public function

UMaterialInstanceDynamic

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

ClearParameterValues()

Remove all parameter values

Public function

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).

Public function

void

 

CopyMaterialUniformParameters

(
    UMaterialInterface* Source
)

Copies the uniform parameters (scalar, vector and texture) from a material or instance hierarchy.

Public function

void

 

CopyParameterOverrides

(
    UMaterialInstance* MaterialIns...
)

Copy parameter values from another material instance.

Public function

void

 

CopyScalarAndVectorParameters

(
    const UMaterialInterface& SourceMa...,
    ERHIFeatureLevel::Type FeatureLevel
)

Copy all interpolatable (scalar/vector) parameters from *SourceMaterialToCopyFrom to *this, using the current QualityLevel and given FeatureLevel For runtime use.

Public function Static

UMaterialIns...

 

Create

(
    UMaterialInterface* ParentMate...,
    UObject* InOuter
)

Create a material instance dynamic parented to the specified material.

Public function Static

UMaterialIns...

 

Create

(
    UMaterialInterface* ParentMate...,
    UObject* InOuter,
    FName Name
)

Create a material instance dynamic parented to the specified material with the specified name.

Public function

bool

 

InitializeScalarParameterAndGetIndex

(
    const FName& ParameterName,
    float Value,
    int32& OutParameterIndex
)

Use this function to set an initial value and fetch the index for use in the following function.

Public function

bool

 

InitializeVectorParameterAndGetIndex

(
    const FName& ParameterName,
    const FLinearColor& Value,
    int32& OutParameterIndex
)

Use this function to set an initial value and fetch the index for use in the following function.

Public function

void

 

K2_CopyMaterialInstanceParameters

(
    UMaterialInterface* Source,
    bool bQuickParametersOnly
)

Copies over parameters given a material interface (copy each instance following the hierarchy) Very slow implementation, avoid using at runtime.

Public function

float

 

K2_GetScalarParameterValue

(
    FName ParameterName
)

Get the current scalar (float) parameter value from an MID

Public function

float

 

K2_GetScalarParameterValueByInfo

(
    const FMaterialParameterInfo& Para...
)

Get the current scalar (float) parameter value from an MID, using MPI (to allow access to layer parameters)

Public function

UTexture ...

 

K2_GetTextureParameterValue

(
    FName ParameterName
)

Get the current MID texture parameter value

Public function

UTexture ...

 

K2_GetTextureParameterValueByInfo

(
    const FMaterialParameterInfo& Para...
)

Get the current MID texture parameter value, using MPI (to allow access to layer parameters)

Public function

FLinearColor

 

K2_GetVectorParameterValue

(
    FName ParameterName
)

Get the current MID vector parameter value

Public function

FLinearColor

 

K2_GetVectorParameterValueByInfo

(
    const FMaterialParameterInfo& Para...
)

Get the current MID vector parameter value, using MPI (to allow access to layer parameters)

Public function

void

 

K2_InterpolateMaterialInstanceParams

(
    UMaterialInstance* SourceA,
    UMaterialInstance* SourceB,
    float Alpha
)

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).

Public function

void

 

SetFontParameterValue

(
    const FMaterialParameterInfo& Para...,
    UFont* FontValue,
    int32 FontPage
)

Set the value of the given font parameter.

Public function

bool

 

SetScalarParameterByIndex

(
    int32 ParameterIndex,
    float Value
)

Use the cached value of OutParameterIndex above to set the scalar parameter ONLY on the exact same MID.

Public function

void

 

SetScalarParameterValue

(
    FName ParameterName,
    float Value
)

Set a MID scalar (float) parameter value

Public function

void

 

SetScalarParameterValueByInfo

(
    const FMaterialParameterInfo& Para...,
    float Value
)

Set a MID scalar (float) parameter value using MPI (to allow access to layer parameters)

Public function

void

 

SetTextureParameterValue

(
    FName ParameterName,
    UTexture* Value
)

Set an MID texture parameter value

Public function

void

 

SetTextureParameterValueByInfo

(
    const FMaterialParameterInfo& Para...,
    UTexture* Value
)

Set an MID texture parameter value using MPI (to allow access to layer parameters)

Public function

bool

 

SetVectorParameterByIndex

(
    int32 ParameterIndex,
    const FLinearColor& Value
)

Use the cached value of OutParameterIndex above to set the vector parameter ONLY on the exact same MID.

Public function

void

 

SetVectorParameterValue

(
    FName ParameterName,
    FLinearColor Value
)

Set an MID vector parameter value

Public function

void

 

SetVectorParameterValueByInfo

(
    const FMaterialParameterInfo& Para...,
    FLinearColor Value
)

Set an MID vector parameter value, using MPI (to allow access to layer parameters)

Overridden from UMaterialInstance

Name Description

Public function Virtual Const

bool

 

HasOverridenBaseProperties()

Overridden from UMaterialInterface

Name Description

Public function Virtual Const

EBlendMode

 

GetBlendMode()

Public function Virtual Const

bool

 

GetCastDynamicShadowAsMasked()

Public function Virtual Const

float

 

GetOpacityMaskClipValue()

Material base property overrides. MIDs cannot override these so they just grab from their parent.

Public function Virtual Const

FMaterialSha...

 

GetShadingModels()

Public function Virtual Const

float

 

GetTextureDensity

(
    FName TextureName,
    const FMeshUVChannelInfo& UVChanne...
)

This overrides does the remapping before looking at the parent data.

Public function Virtual Const

bool

 

IsDitheredLODTransition()

Public function Virtual Const

bool

 

IsMasked()

Public function Virtual Const

bool

 

IsShadingModelFromMaterialExpression()

Public function Virtual Const

bool

 

IsTwoSided()

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss