UMaterialInstanceDynamic

Inheritance Hierarchy

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

============================================================================== MaterialInstanceDynamic.cpp: MaterialInstanceDynamic implementation.

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

 

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
)

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

UTexture ...

 

K2_GetTextureParameterValue

(
    FName ParameterName
)

Get the current MID texture parameter value

Public function

FLinearColor

 

K2_GetVectorParameterValue

(
    FName ParameterName
)

Get the current MID vector parameter value

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

(
    FName ParameterName,
    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

 

SetTextureParameterValue

(
    FName ParameterName,
    UTexture * Value
)

Set an MID texture parameter value

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

Overridden from UMaterialInstance

Name Description

Public function Virtual

bool

 

HasOverridenBaseProperties()

Overridden from UMaterialInterface

Name Description

Public function Virtual

EBlendMode

 

GetBlendMode()

Public function Virtual

float

 

GetOpacityMaskClipValue()

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

Public function Virtual

EMaterialSha ...

 

GetShadingModel()

Public function Virtual

float

 

GetTextureDensity

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

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

Public function Virtual

bool

 

IsDitheredLODTransition()

Public function Virtual

bool

 

IsMasked()

Public function Virtual

bool

 

IsTwoSided()

References

Module

Engine

Header

Runtime/Engine/Classes/Materials/MaterialInstanceDynamic.h