UMaterialInstanceConstant

Material Instances may be used to change the appearance of a material without incurring an expensive recompilation of the material.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

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

Include

#include "Materials/MaterialInstanceConstant.h"

Syntax

class UMaterialInstanceConstant : public UMaterialInstance

Remarks

Material Instances may be used to change the appearance of a material without incurring an expensive recompilation of the material. General modification of the material cannot be supported without recompilation, so the instances are limited to changing the values of predefined material parameters. The parameters are statically defined in the compiled material by a unique name, type and default value.

Variables

Name Description

Public variable

FGuid

 

ParameterStateId

Unique ID for this material instance's parameter set Updated on changes in the editor to allow those changes to be detected

Public variable

UPhysicalMateri...

 

PhysMaterialMask

Physical material mask to use for this graphics material. Used for sounds, effects etc.

Constructors

Name Description

Public function

UMaterialInstanceConstant

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

ClearParameterValuesEditorOnly()

Clear all parameter overrides on this material instance.

Public function

void

 

CopyMaterialUniformParametersEditorOnly

(
    UMaterialInterface* Source,
    bool bIncludeStaticParams
)

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

Public function

float

 

K2_GetScalarParameterValue

(
    FName ParameterName
)

Get the scalar (float) parameter value from an MIC

Public function

UTexture ...

 

K2_GetTextureParameterValue

(
    FName ParameterName
)

Get the MIC texture parameter value

Public function

FLinearColor

 

K2_GetVectorParameterValue

(
    FName ParameterName
)

Get the MIC vector parameter value

Public function

void

 

SetFontParameterValueEditorOnly

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

Public function

void

 

SetParentEditorOnly

(
    UMaterialInterface* NewParent,
    bool RecacheShader
)

Set the parent of this material instance.

Public function

void

 

SetRuntimeVirtualTextureParameterValueEditorOnly

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

Public function

void

 

SetScalarParameterAtlasEditorOnly

(
    const FMaterialParameterInfo& Para...,
    FScalarParameterAtlasInstanceData A...
)

Public function

void

 

SetScalarParameterValueEditorOnly

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

Public function

void

 

SetTextureParameterValueEditorOnly

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

Public function

void

 

SetVectorParameterValueEditorOnly

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

Set the value parameters.

Overridden from UMaterialInterface

Name Description

Public function Virtual Const

UPhysicalMat...

 

GetPhysicalMaterialMask()

Return a pointer to the physical material mask used by this material instance.

Overridden from UObject

Name Description

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

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