UMaterialInterface

Windows
MacOS
Linux

Inheritance Hierarchy

Syntax

class UMaterialInterface :
    public UObject,
    public IBlendableInterface,
    public IInterface_AssetUserData

Variables

Name Description

Public variable

UAssetImportDat...

 

AssetImportData

Importing data and options used for this material

Protected variable

TArray< UAssetU...

 

AssetUserData

Array of user data stored with the asset

Protected variable

bool

 

bTextureStreamingDataSorted

Because of redirector, the texture names need to be resorted at each load in case they changed.

Public variable

TMap< FString, ...

 

LayerParameterExpansion

Protected variable

FLightmassMater...

 

LightmassSettings

The Lightmass settings for this object.

Public variable

TMap< FString, ...

 

ParameterOverviewExpansion

Public variable

FRenderCommandF...

 

ParentRefFence

A fence to track when the primitive is no longer used as a parent

Public variable

FSoftObjectPath

 

PreviewMesh

The mesh used by the material editor to preview the material.

Public variable

USubsurfaceProf...

 

SubsurfaceProfile

SubsurfaceProfile, for Screen Space Subsurface Scattering

Protected variable

TArray< FMateri...

 

TextureStreamingData

Data used by the texture streaming to know how each texture is sampled by the material.

Protected variable

int32

 

TextureStreamingDataVersion

Public variable

UThumbnailInfo ...

 

ThumbnailInfo

Information for thumbnail rendering

Constructors

Name Description

Public function

UMaterialInterface

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function

void

 

AnalyzeMaterialProperty

(
    EMaterialProperty InProperty,
    int32& OutNumTextureCoordinates,
    bool& bOutRequiresVertexData
)

Return number of used texture coordinates and whether or not the Vertex data is used in the shader graph

Public function Virtual Const

void

 

AppendReferencedTextures

(
    TArray< UTexture* >& InOutTex...
)

Appends textures referenced by expressions, including nested functions.

Public function Static

void

 

AssertDefaultMaterialsExist()

Asserts if any default material does not exist.

Public function Static

void

 

AssertDefaultMaterialsPostLoaded()

Asserts if any default material has not been post-loaded.

Public function Virtual

bool

 

CheckMaterialUsage

(
    const EMaterialUsage Usage
)

Checks if the material can be used with the given usage flag.

Public function Virtual Const

bool

 

CheckMaterialUsage_Concurrent

(
    const EMaterialUsage Usage
)

Same as above but is valid to call from any thread.

Public function

int32

 

CompileProperty

(
    FMaterialCompiler* Compiler,
    EMaterialProperty Property,
    uint32 ForceCastFlags
)

Compiles a material property.

Public function Virtual

int32

 

CompilePropertyEx

(
    FMaterialCompiler* Compiler,
    const FGuid& AttributeID
)

Allows material properties to be compiled with the option of being overridden by the material attributes input.

Protected function Const

bool

 

FindTextureStreamingDataIndexRange

(
    FName TextureName,
    int32& LowerIndex,
    int32& HigherIndex
)

Find entries within TextureStreamingData that match the given name.

Public function Virtual

void

 

ForceRecompileForRendering()

Clears the shader cache and recompiles the shader for rendering.

Public function Virtual Const

void

 

GetAllFontParameterInfo

(
    TArray< FMaterialParameterInfo >& ...,
    TArray< FGuid >& OutParameterIds
)

Public function Virtual Const

void

 

GetAllMaterialLayersParameterInfo

(
    TArray< FMaterialParameterInfo >& ...,
    TArray< FGuid >& OutParameterIds
)

Public function Virtual Const

void

 

GetAllScalarParameterInfo

(
    TArray< FMaterialParameterInfo >& ...,
    TArray< FGuid >& OutParameterIds
)

Public function Virtual Const

void

 

GetAllStaticComponentMaskParameterInfo

(
    TArray< FMaterialParameterInfo >& ...,
    TArray< FGuid >& OutParameterIds
)

Public function Virtual Const

void

 

GetAllStaticSwitchParameterInfo

(
    TArray< FMaterialParameterInfo >& ...,
    TArray< FGuid >& OutParameterIds
)

Public function Virtual Const

void

 

GetAllTextureParameterInfo

(
    TArray< FMaterialParameterInfo >& ...,
    TArray< FGuid >& OutParameterIds
)

Public function Virtual Const

void

 

GetAllVectorParameterInfo

(
    TArray< FMaterialParameterInfo >& ...,
    TArray< FGuid >& OutParameterIds
)

Public function

UMaterial &#...

 

GetBaseMaterial()

Walks up parent chain and finds the base Material that this is an instance of.

Public function Virtual Const

EBlendMode

 

GetBlendMode()

Public function Virtual Const

bool

 

GetCastDynamicShadowAsMasked()

Public function Virtual Const

bool

 

GetCastShadowAsMasked()

Public function Virtual Const

void

 

GetDependentFunctions

(
    TArray< class UMaterialFunctionInte...
)

Public function Virtual Const

float

 

GetDiffuseBoost()

Public function Virtual Const

float

 

GetEmissiveBoost()

Public function Virtual Const

float

 

GetExportResolutionScale()

Public function Static

uint32

 

GetFeatureLevelsToCompileForAllMaterials()

Get bitfield indicating which feature levels should be compiled by default

Protected function Const

uint32

 

GetFeatureLevelsToCompileForRendering()

Returns a bitfield indicating which feature levels should be compiled for rendering.

Public function Virtual Const

bool

 

GetFontParameterDefaultValue

(
    const FMaterialParameterInfo& Para...,
    UFont*& OutFontValue,
    int32& OutFontPage,
    bool bCheckOwnedGlobalOverrides
)

Public function Virtual Const

bool

 

GetFontParameterValue

(
    const FMaterialParameterInfo& Para...,
    UFont*& OutFontValue,
    int32& OutFontPage,
    bool bOveriddenOnly
)

Public function Virtual Const

bool

 

GetGroupName

(
    const FMaterialParameterInfo& Para...,
    FName& GroupName
)

Public function Virtual Const

bool

 

GetGroupSortPriority

(
    const FString& InGroupName,
    int32& OutSortPriority
)

Get the sort priority index of the given parameter group

Public function Const

int32

 

GetHeight()

Public function Const

const FGuid ...

 

GetLightingGuid()

Public function Virtual Const

void

 

GetLightingGuidChain

(
    bool bIncludeTextures,
    TArray< FGuid >& OutGuids
)

Returns all the Guids related to this material.

Public function Virtual Const

bool

 

GetLinearColorCurveParameterValue

(
    const FMaterialParameterInfo& Para...,
    FInterpCurveLinearColor& OutValue
)

Public function Virtual Const

bool

 

GetLinearColorParameterValue

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

Public function Virtual Const

const UMater...

 

GetMaterial()

Get the material which we are instancing.

Public function Virtual

UMaterial &#...

 

GetMaterial()

Get the material which we are instancing.

Public function Virtual Const

const UMater...

 

GetMaterial_Concurrent

(
    TMicRecursionGuard& RecursionGuard
)

Public function Virtual Const

bool

 

GetMaterialLayersParameterValue

(
    const FMaterialParameterInfo& Para...,
    FMaterialLayersFunctions& OutLayer...,
    FGuid& OutExpressionGuid,
    bool bCheckParent
)

Get the value of the given static material layers parameter

Public function Virtual

FMaterialRes...

 

GetMaterialResource

(
    ERHIFeatureLevel::Type InFeatureLev...,
    EMaterialQualityLevel::Type Quality...
)

Get the static permutation resource if the instance has one

Public function Virtual Const

const FMater...

 

GetMaterialResource

(
    ERHIFeatureLevel::Type InFeatureLev...,
    EMaterialQualityLevel::Type Quality...
)

Get the static permutation resource if the instance has one

Public function Virtual Const

float

 

GetOpacityMaskClipValue()

Access to overridable properties of the base material.

Public function Const

bool

 

GetOverrideCastShadowAsMasked()

Public function Const

bool

 

GetOverrideDiffuseBoost()

Public function Const

bool

 

GetOverrideEmissiveBoost()

Public function Const

bool

 

GetOverrideExportResolutionScale()

Public function Virtual Const

bool

 

GetParameterDesc

(
    const FMaterialParameterInfo& Para...,
    FString& OutDesc,
    const TArray< struct FStaticMateria...
)

Public function Virtual Const

bool

 

GetParameterSortPriority

(
    const FMaterialParameterInfo& Para...,
    int32& OutSortPriority,
    const TArray< struct FStaticMateria...
)

Get the sort priority index of the given parameter

Public function Virtual Const

UPhysicalMat...

 

GetPhysicalMaterial()

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

Public function Virtual Const

bool

 

GetRefractionSettings

(
    float& OutBiasValue
)

Public function Const

FMaterialRel...

 

GetRelevance

(
    ERHIFeatureLevel::Type InFeatureLev...
)

Public function Const

FMaterialRel...

 

GetRelevance_Concurrent

(
    ERHIFeatureLevel::Type InFeatureLev...
)

Public function Virtual Const

FMaterialRen...

 

GetRenderProxy()

Return a pointer to the FMaterialRenderProxy used for rendering.

Public function Static

UEnum *

 

GetSamplerTypeEnum()

Access the cached uenum type information for material sampler type

Public function Virtual Const

bool

 

GetScalarCurveParameterValue

(
    const FMaterialParameterInfo& Para...,
    FInterpCurveFloat& OutValue
)

Public function Virtual Const

bool

 

GetScalarParameterDefaultValue

(
    const FMaterialParameterInfo& Para...,
    float& OutValue,
    bool bOveriddenOnly,
    bool bCheckOwnedGlobalOverrides
)

Public function Virtual Const

bool

 

GetScalarParameterSliderMinMax

(
    const FMaterialParameterInfo& Para...,
    float& OutSliderMin,
    float& OutSliderMax
)

Public function Virtual Const

bool

 

GetScalarParameterValue

(
    const FMaterialParameterInfo& Para...,
    float& OutValue,
    bool bOveriddenOnly
)

Public function Virtual Const

EMaterialSha...

 

GetShadingModel()

Public function Virtual Const

bool

 

GetStaticComponentMaskParameterDefaultValue

(
    const FMaterialParameterInfo& Para...,
    bool& OutR,
    bool& OutG,
    bool& OutB,
    bool& OutA,
    FGuid& OutExpressionGuid,
    bool bCheckOwnedGlobalOverrides
)

Public function Virtual Const

bool

 

GetStaticComponentMaskParameterValue

(
    const FMaterialParameterInfo& Para...,
    bool& R,
    bool& G,
    bool& B,
    bool& A,
    FGuid& OutExpressionGuid,
    bool bOveriddenOnly,
    bool bCheckParent
)

Get the value of the given static component mask parameter

Public function Virtual Const

bool

 

GetStaticSwitchParameterDefaultValue

(
    const FMaterialParameterInfo& Para...,
    bool& OutValue,
    FGuid& OutExpressionGuid,
    bool bCheckOwnedGlobalOverrides
)

Public function Virtual Const

bool

 

GetStaticSwitchParameterValue

(
    const FMaterialParameterInfo& Para...,
    bool& OutValue,
    FGuid& OutExpressionGuid,
    bool bOveriddenOnly,
    bool bCheckParent
)

Get the value of the given static switch parameter

Public function Virtual Const

USubsurfaceP...

 

GetSubsurfaceProfile_Internal()

Public function Virtual Const

bool

 

GetTerrainLayerWeightParameterValue

(
    const FMaterialParameterInfo& Para...,
    int32& OutWeightmapIndex,
    FGuid& OutExpressionGuid
)

Get the weightmap index of the given terrain layer weight parameter

Public function Virtual Const

float

 

GetTextureDensity

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

Returns the density of a texture in (LocalSpace Unit / Texture).

Public function Virtual Const

bool

 

GetTextureParameterDefaultValue

(
    const FMaterialParameterInfo& Para...,
    UTexture*& OutValue,
    bool bCheckOwnedGlobalOverrides
)

Public function Virtual Const

bool

 

GetTextureParameterValue

(
    const FMaterialParameterInfo& Para...,
    UTexture*& OutValue,
    bool bOveriddenOnly
)

Public function Virtual

bool

 

GetTexturesInPropertyChain

(
    EMaterialProperty InProperty,
    TArray< UTexture* >& OutTextu...,
    TArray< FName >* OutTexturePar...,
    FStaticParameterSet* InStaticP...,
    ERHIFeatureLevel::Type InFeatureLev...,
    EMaterialQualityLevel::Type InQuali...
)

Get all of the textures in the expression chain for the given property (ie fill in the given array with all textures in the chain).

Public function Const

const TArray...

 

GetTextureStreamingData()

Accessor to the data.

Public function Virtual Const

void

 

GetUsedTextures

(
    TArray< UTexture* >& OutTextu...,
    EMaterialQualityLevel::Type Quality...,
    bool bAllQualityLevels,
    ERHIFeatureLevel::Type FeatureLevel,
    bool bAllFeatureLevels
)

Return the textures used to render this material.

Public function Virtual Const

void

 

GetUsedTexturesAndIndices

(
    TArray< UTexture* >& OutTextu...,
    TArray< TArray< int32 > >& OutIndi...,
    EMaterialQualityLevel::Type Quality...,
    ERHIFeatureLevel::Type FeatureLevel
)

Return the textures used to render this material and the material indices bound to each.

Public function Virtual Const

bool

 

GetVectorCurveParameterValue

(
    const FMaterialParameterInfo& Para...,
    FInterpCurveVector& OutValue
)

Public function Virtual Const

bool

 

GetVectorParameterDefaultValue

(
    const FMaterialParameterInfo& Para...,
    FLinearColor& OutValue,
    bool bOveriddenOnly,
    bool bCheckOwnedGlobalOverrides
)

Public function Virtual Const

bool

 

GetVectorParameterValue

(
    const FMaterialParameterInfo& Para...,
    FLinearColor& OutValue,
    bool bOveriddenOnly
)

Public function Const

int32

 

GetWidth()

Public function Const

bool

 

HasTextureStreamingData()

Returns whether there is any streaming data in the component.

Public function Static

void

 

InitDefaultMaterials()

Initializes all default materials.

Public function Virtual Const

bool

 

IsDeferredDecal()

Public function Virtual

bool

 

IsDependent

(
    UMaterialInterface* TestDepend...
)

Test this material for dependency on a given material.

Public function Virtual Const

bool

 

IsDitheredLODTransition()

Public function Virtual Const

bool

 

IsMasked()

Public function Virtual Const

bool

 

IsPropertyActive

(
    EMaterialProperty InProperty
)

Checks to see if an input property should be active, based on the state of the material

Public function Virtual Const

bool

 

IsScalarParameterUsedAsAtlasPosition

(
    const FMaterialParameterInfo& Para...,
    bool& OutValue,
    TSoftObjectPtr< class UCurveLinearC...,
    TSoftObjectPtr< class UCurveLinearC...
)

Public function Virtual Const

bool

 

IsTranslucencyWritingCustomDepth()

Public function Virtual Const

bool

 

IsTwoSided()

Public function Virtual Const

bool

 

IsVectorParameterUsedAsChannelMask

(
    const FMaterialParameterInfo& Para...,
    bool& OutValue
)

Public function Static

void

 

IterateOverActiveFeatureLevels

(
    FunctionType InHandler
)

Iterate over all feature levels currently marked as active

Public function Virtual Const

void

 

LogMaterialsAndTextures

(
    FOutputDevice& Ar,
    int32 Indent
)

Output to the log which materials and textures are used by this material.

Public function Virtual

void

 

OverrideScalarParameterDefault

(
    const FMaterialParameterInfo& Para...,
    float Value,
    bool bOverride,
    ERHIFeatureLevel::Type FeatureLevel
)

Public function Virtual

void

 

OverrideTexture

(
    const UTexture* InTextureToOve...,
    UTexture* OverrideTexture,
    ERHIFeatureLevel::Type InFeatureLev...
)

Override a specific texture (transient)

Public function Virtual

void

 

OverrideVectorParameterDefault

(
    const FMaterialParameterInfo& Para...,
    const FLinearColor& Value,
    bool bOverride,
    ERHIFeatureLevel::Type FeatureLevel
)

Overrides the default value of the given parameter (transient).

Public function Static

void

 

RecacheAllMaterialUniformExpressions

(
    bool bRecreateUniformBuffer
)

Re-caches uniform expressions for all material interfaces Set bRecreateUniformBuffer to true if uniform buffer layout will change (e.g. FMaterial is being recompiled).

Public function Virtual Const

void

 

RecacheUniformExpressions

(
    bool bRecreateUniformBuffer
)

Re-caches uniform expressions for this material interface Set bRecreateUniformBuffer to true if uniform buffer layout will change (e.g. FMaterial is being recompiled).

Public function Virtual

void

 

SaveShaderStableKeysInner

(
    const ITargetPlatform* TP,
    const FStableShaderKeyAndValue& Sa...
)

Public function

void

 

SetCastShadowAsMasked

(
    bool InCastShadowAsMasked
)

Public function

void

 

SetDiffuseBoost

(
    float InDiffuseBoost
)

Public function

void

 

SetEmissiveBoost

(
    float InEmissiveBoost
)

Public function

void

 

SetExportResolutionScale

(
    float InExportResolutionScale
)

Public function

void

 

SetFeatureLevelToCompile

(
    ERHIFeatureLevel::Type FeatureLevel,
    bool bShouldCompile
)

Set which feature levels this material instance should compile.

Public function Virtual

void

 

SetForceMipLevelsToBeResident

(
    bool OverrideForceMiplevelsToBeResi...,
    bool bForceMiplevelsToBeResidentVal...,
    float ForceDuration,
    int32 CinematicTextureGroups
)

Force the streaming system to disregard the normal logic for the specified duration and instead always load all mip-levels for all textures used by this material.

Public function Static

void

 

SetGlobalRequiredFeatureLevel

(
    ERHIFeatureLevel::Type FeatureLevel,
    bool bShouldCompile
)

Set which feature levels all materials should compile to. GMaxRHIFeatureLevel is always compiled.

Public function

void

 

SetLightingGuid()

Public function

void

 

SetOverrideCastShadowAsMasked

(
    bool bInOverrideCastShadowAsMasked
)

Public function

void

 

SetOverrideDiffuseBoost

(
    bool bInOverrideDiffuseBoost
)

Public function

void

 

SetOverrideEmissiveBoost

(
    bool bInOverrideEmissiveBoost
)

Public function

void

 

SetOverrideExportResolutionScale

(
    bool bInOverrideExportResolutionSca...
)

Public function

void

 

SetShouldForcePlanePreview

(
    const bool bInShouldForcePlanePrevi...
)

Set whether or not this Material Interface should force a plane preview

Public function

void

 

SetTextureStreamingData

(
    const TArray< FMaterialTextureInfo ...
)

Set new texture streaming data.

Public function Virtual

bool

 

ShouldForcePlanePreview()

True if this Material Interface should force a plane preview

Protected function

void

 

SortTextureStreamingData

(
    bool bForceSort,
    bool bFinalSort
)

Sort the texture streaming data by names to accelerate search. Only sorts if required.

Public function Virtual

bool

 

UpdateLightmassTextureTracking()

Check if the textures have changed since the last time the material was serialized for Lightmass...

Protected function

void

 

UpdateMaterialRenderProxy

(
    FMaterialRenderProxy& Proxy
)

Public function Const

bool

 

UseAnyStreamingTexture()

Return whether this material refer to any streaming textures.

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual Const

void

 

GetAssetRegistryTags

(
    TArray< FAssetRegistryTag >& OutTa...
)

Gathers a list of asset registry searchable tags which are name/value pairs with some type information This only needs to be implemented for asset objects

Public function Virtual

bool

 

IsReadyForFinishDestroy()

Called to check if the object is ready for FinishDestroy.

Public function Virtual

void

 

PostCDOContruct()

Called after the C++ constructor has run on the CDO for a class.

Public function Virtual

void

 

PostDuplicate

(
    bool bDuplicateForPIE
)

Called after duplication & serialization and before PostLoad.

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.

Public function Virtual

void

 

PreSave

(
    const ITargetPlatform* TargetP...
)

Presave function.

Overridden from IBlendableInterface

Name Description

Public function Virtual Const

void

 

OverrideBlendableSettings

(
    FSceneView& View,
    float Weight
)

Overridden from IInterface_AssetUserData

Name Description

Public function Virtual

void

 

AddAssetUserData

(
    UAssetUserData* InUserData
)

Public function Virtual

UAssetUserDa...

 

GetAssetUserDataOfClass

(
    TSubclassOf< UAssetUserData > InUse...
)

Public function Virtual

void

 

RemoveUserDataOfClass

(
    TSubclassOf< UAssetUserData > InUse...
)

Typedefs

Name

Description

TMicRecursionGuard

Same as above, but can be called concurrently

Constants

Name

Description

FeatureLevelsForAllMaterials

Feature level bitfield to compile for all materials

SamplerTypeEnum

Cached type information for the sampler type enumeration.

Deprecated Functions

Name Description

Public function Virtual

float

 

GetScalarParameterDefault

(
    const FMaterialParameterInfo& Para...,
    ERHIFeatureLevel::Type FeatureLevel
)

This function is deprecated. Use GetScalarParameterDefaultValue instead.

References

Module

Engine

Header

Runtime/Engine/Classes/Materials/MaterialInterface.h

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback