UMaterial

A Material is an asset which can be applied to a mesh to control the visual look of the scene.

Windows
MacOS
Linux

Inheritance Hierarchy

Syntax

class UMaterial : public UMaterialInterface

Remarks

A Material is an asset which can be applied to a mesh to control the visual look of the scene. When light from the scene hits the surface, the shading model of the material is used to calculate how that light interacts with the surface.

Warning: Creating new materials directly increases shader compile times! Consider creating a Material Instance off of an existing material instead.

Variables

Name Description

Public variable

uint32: 1

 

AllowTranslucentCustomDepthWrites

Allows a translucent material to be used with custom depth writing by compiling additional shaders.

Public variable

FScalarMaterial...

 

AmbientOcclusion

Output ambient occlusion to the GBuffer

Public variable

uint32: 1

 

bAllowDevelopmentShaderCompile

If true the compilation environment will be changed to remove the global COMPILE_SHADERS_FOR_DEVELOPMENT flag.

Public variable

uint32: 1

 

bAllowNegativeEmissiveColor

Whether the material should allow outputting negative emissive color values.

Public variable

FColorMaterialI...

 

BaseColor

Public variable

uint32: 1

 

bAutomaticallySetUsageInEditor

Whether to automatically set usage flags based on what the material is applied to in the editor.

Public variable

uint32: 1

 

bBlockGI

If enabled, the material's opacity defines how much GI is blocked when using the LightPropagationVolume feature

Public variable

uint32: 1

 

bCanMaskedBeAssumedOpaque

True if this Material can be assumed Opaque when set to masked.

Public variable

uint32: 1

 

bCastDynamicShadowAsMasked

If true, translucent materials will cast dynamic shadows according to their opacity.

Public variable

uint32: 1

 

bComputeFogPerPixel

When true, translucent materials have fog computed for every pixel, which costs more but fixes artifacts due to low tessellation.

Public variable

uint32: 1

 

bContactShadows

Contact shadows on translucency

Public variable

uint32: 1

 

bDisableDepthTest

Whether to draw on top of opaque pixels even if behind them.

Public variable

uint32: 1

 

bEnableAdaptiveTessellation

Enables adaptive tessellation, which tries to maintain a uniform number of pixels per triangle.

Public variable

uint32: 1

 

bEnableCrackFreeDisplacement

Prevents cracks in the surface of the mesh when using tessellation.

Public variable

uint32: 1

 

bEnableMobileSeparateTranslucency

Indicates that the translucent material should not be affected by bloom or DOF.

Public variable

uint32: 1

 

bEnableResponsiveAA

Indicates that the material should be rendered using responsive anti-aliasing.

Public variable

uint32: 1

 

bEnableSeparateTranslucency

Indicates that the material should be rendered in the SeparateTranslucency Pass (not affected by DOF, requires bAllowSeparateTranslucency to be set in .ini).

Public variable

uint32: 1

 

bFullyRough

Forces the material to be completely rough. Saves a number of instructions and one sampler.

Public variable

uint32: 1

 

bGenerateSphericalParticleNormals

Whether to generate spherical normals for particles that use this material.

Public variable

uint32: 1

 

bIsFunctionPreviewMaterial

True if Material is the function preview material used in the material instance editor.

Public variable

uint32: 1

 

bIsMaterialEditorStatsMaterial

True if this is a special material used for stats by the material editor.

Public variable

uint32: 1

 

bIsPreviewMaterial

True if Material is the preview material used in the material editor.

Public variable

TEnumAsByte< en...

 

BlendableLocation

Where the node is inserted in the (post processing) graph, only used if domain is PostProcess

Public variable

bool

 

BlendableOutputAlpha

If this is enabled, the blendable will output alpha

Public variable

int32

 

BlendablePriority

If multiple nodes with the same type are inserted at the same point, this defined order and if they get combined, only used if domain is PostProcess

Public variable

TEnumAsByte< en...

 

BlendMode

Determines how the material's color is blended with background colors.

Public variable

uint32: 1

 

bNormalCurvatureToRoughness

Reduce roughness based on screen space normal changes.

Public variable

uint32: 1

 

bOutputVelocityOnBasePass

Skips outputting velocity during the base pass.

Public variable

uint32: 1

 

bScreenSpaceReflections

SSR on translucency

Public variable

uint32: 1

 

bTangentSpaceNormal

Whether the material takes a tangent space normal or a world space normal as input.

Public variable

uint32: 1

 

bUsedAsSpecialEngineMaterial

This is a special usage flag that allows a material to be assignable to any primitive type.

Public variable

uint32: 1

 

bUsedWithBeamTrails

Indicates that the material and its instances can be use with beam trails This will result in the shaders required to support beam trails being compiled which will increase shader compile time and memory usage.

Public variable

uint32: 1

 

bUsedWithClothing

Indicates that the material and its instances can be use with clothing This will result in the shaders required to support clothing being compiled which will increase shader compile time and memory usage.

Public variable

uint32: 1

 

bUsedWithEditorCompositing

Indicates that the material and its instances can be use with editor compositing This will result in the shaders required to support editor compositing being compiled which will increase shader compile time and memory usage.

Public variable

uint32: 1

 

bUsedWithGeometryCache

Public variable

uint32: 1

 

bUsedWithInstancedStaticMeshes

Indicates that the material and its instances can be use with instanced static meshes This will result in the shaders required to support instanced static meshes being compiled which will increase shader compile time and memory usage.

Public variable

uint32: 1

 

bUsedWithMeshParticles

Indicates that the material and its instances can be use with mesh particles This will result in the shaders required to support mesh particles being compiled which will increase shader compile time and memory usage.

Public variable

uint32: 1

 

bUsedWithMorphTargets

Indicates that the material and its instances can be use with morph targets This will result in the shaders required to support morph targets being compiled which will increase shader compile time and memory usage.

Public variable

uint32: 1

 

bUsedWithNiagaraMeshParticles

Public variable

uint32: 1

 

bUsedWithNiagaraRibbons

Public variable

uint32: 1

 

bUsedWithNiagaraSprites

Indicates that the material and its instances can be use with Niagara sprites (meshes and ribbons, respectively) This will result in the shaders required to support Niagara sprites being compiled which will increase shader compile time and memory usage.

Public variable

uint32: 1

 

bUsedWithParticleSprites

Indicates that the material and its instances can be use with particle sprites This will result in the shaders required to support particle sprites being compiled which will increase shader compile time and memory usage.

Public variable

uint32: 1

 

bUsedWithSkeletalMesh

Indicates that the material and its instances can be use with skeletal meshes.

Public variable

uint32: 1

 

bUsedWithSplineMeshes

Indicates that the material and its instances can be use with spline meshes This will result in the shaders required to support spline meshes being compiled which will increase shader compile time and memory usage.

Public variable

uint32: 1

 

bUsedWithStaticLighting

Indicates that the material and its instances can be use with static lighting This will result in the shaders required to support static lighting being compiled which will increase shader compile time and memory usage.

Public variable

uint32: 1

 

bUseEmissiveForDynamicAreaLighting

If enabled, the material's emissive colour is injected into the LightPropagationVolume

Public variable

uint32: 1

 

bUseFullPrecision

Forces this material to use full (highp) precision in the pixel shader.

Public variable

uint32: 1

 

bUseHQForwardReflections

Forward renderer: enables multiple parallax-corrected reflection captures that blend together.

Public variable

uint32: 1

 

bUseLightmapDirectionality

Use lightmap directionality and per pixel normals.

Public variable

uint32: 1

 

bUseMaterialAttributes

When true, the material attributes pin is used instead of the regular pins.

Public variable

uint32: 1

 

bUsePlanarForwardReflections

Enables planar reflection when using the forward renderer or mobile.

Public variable

uint32: 1

 

bUsesDistortion

Indicates that the material and its instances can be use with distortion This will result in the shaders required to support distortion being compiled which will increase shader compile time and memory usage.

Public variable

uint32: 1

 

bUseTranslucencyVertexFog

When true, translucent materials are fogged. Defaults to true.

Public variable

uint32: 1

 

bWriteOnlyAlpha

Whether the transluency pass should write its alpha, and only the alpha, into the framebuffer

Public variable

FScalarMaterial...

 

ClearCoat

Public variable

FScalarMaterial...

 

ClearCoatRoughness

Public variable

FVector2Materia...

 

CustomizedUVs

These inputs are evaluated in the vertex shader and allow artists to do arbitrary vertex shader operations and access them in the pixel shader.

Public variable

TEnumAsByte< en...

 

D3D11TessellationMode

The type of tessellation to apply to this object.

Public variable

TEnumAsByte< en...

 

DecalBlendMode

Defines how the GBuffer chanels are getting manipulated by a decal material pass.

Public variable

FDefaultMateria...

 

DefaultMaterialInstance

FMaterialRenderProxy derivative that represent this material to the renderer, when the renderer needs to fetch parameter values.

Public variable

uint32: 1

 

DitheredLODTransition

Whether meshes rendered with the material should support dithered LOD transitions.

Public variable

uint32: 1

 

DitherOpacityMask

Dither opacity mask.

Public variable

TArray< class U...

 

EditorComments

Array of comments associated with this material; viewed in the material editor.

Public variable

TMap< FName, TA...

 

EditorParameters

Used to detect duplicate parameters. Does not contain parameters in referenced functions!

Public variable

int32

 

EditorPitch

Public variable

int32

 

EditorX

Public variable

int32

 

EditorY

Public variable

int32

 

EditorYaw

Public variable

FColorMaterialI...

 

EmissiveColor

Emission.

Public variable

TArray< class U...

 

Expressions

Array of material expressions, excluding Comments. Used by the material editor.

Public variable

FMaterialAttrib...

 

MaterialAttributes

Public variable

TEnumAsByte< en...

 

MaterialDecalResponse

Defines how the material reacts on DBuffer decals (Affects look, performance and texture/sample usage).

Public variable

TEnumAsByte< en...

 

MaterialDomain

The domain that the material's attributes will be evaluated in.

Public variable

TArray< struct ...

 

MaterialFunctionInfos

Array of all functions this material depends on.

Public variable

UMaterialGraph ...

 

MaterialGraph

EdGraph based representation of the Material

Public variable

TArray< struct ...

 

MaterialParameterCollectionInfos

Array of all parameter collections this material depends on.

Public variable

float

 

MaxDisplacement

Public variable

FScalarMaterial...

 

Metallic

Public variable

FVectorMaterial...

 

Normal

Public variable

int32

 

NumCustomizedUVs

Number of customized UV inputs to display.

Public variable

FScalarMaterial...

 

Opacity

Transmission.

Public variable

FScalarMaterial...

 

OpacityMask

Public variable

float

 

OpacityMaskClipValue

If BlendMode is BLEND_Masked, the surface is not rendered where OpacityMask < OpacityMaskClipValue.

Public variable

TArray< FParame...

 

ParameterGroupData

Controls where this parameter group is displayed in a material instance parameter list.

Public variable

UPhysicalMateri...

 

PhysMaterial

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

Public variable

FScalarMaterial...

 

PixelDepthOffset

Public variable

FScalarMaterial...

 

Refraction

Output refraction index for translucent rendering Air:1.0 Water:1.333 Ice:1.3 Glass:~1.6 Diamond:2.42

Public variable

float

 

RefractionDepthBias

This is the refraction depth bias, larger values offset distortion to prevent closer objects from rendering into the distorted surface at acute viewing angles but increases the disconnect between surface and where the refraction starts.

Public variable

TEnumAsByte< en...

 

RefractionMode

Controls how the Refraction input is interpreted and how the refraction offset into scene color is computed for this material.

Public variable

FScalarMaterial...

 

Roughness

Public variable

FScalarMaterial...

 

Specular

Public variable

FGuid

 

StateId

Guid that uniquely identifies this material.

Public variable

FColorMaterialI...

 

SubsurfaceColor

Inner material color, only used for ShadingModel=Subsurface

Public variable

FScalarMaterial...

 

TessellationMultiplier

Multiplies the tessellation factors applied when a tessellation mode is set.

Public variable

float

 

TranslucencyDirectionalLightingIntensity

Useful for artificially increasing the influence of the normal on the lighting result for translucency.

Public variable

TEnumAsByte< en...

 

TranslucencyLightingMode

Sets the lighting mode that will be used on this material if it is translucent.

Public variable

float

 

TranslucentBackscatteringExponent

Controls how diffuse the material's backscattering is when using the MSM_Subsurface shading model.

Public variable

FLinearColor

 

TranslucentMultipleScatteringExtinction

Colored extinction factor used to approximate multiple scattering in dense volumes.

Public variable

float

 

TranslucentSelfShadowDensityScale

Scale used to make translucent self-shadowing more or less opaque than the material's shadow on other objects.

Public variable

float

 

TranslucentSelfShadowSecondDensityScale

Used to make a second self shadow gradient, to add interesting shading in the shadow of the first.

Public variable

float

 

TranslucentSelfShadowSecondOpacity

Controls the strength of the second self shadow gradient.

Public variable

float

 

TranslucentShadowDensityScale

Scale used to make translucent shadows more or less opaque than the material's actual opacity.

Public variable

float

 

TranslucentShadowStartOffset

Local space distance to bias the translucent shadow.

Public variable

uint32: 1

 

TwoSided

Indicates that the material should be rendered without backface culling and the normal should be flipped for backfaces.

Public variable

uint32

 

UsageFlagWarnings

True if we have printed a warning about material usage for a given usage flag.

Public variable

uint32: 1

 

Wireframe

Enables a wireframe view of the mesh the material is applied to.

Public variable

FVectorMaterial...

 

WorldDisplacement

Offset in world space applied to tessellated vertices.

Public variable

FVectorMaterial...

 

WorldPositionOffset

Adds to world position in the vertex shader.

Constructors

Name Description

Public function

UMaterial

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Virtual

bool

 

AddExpressionParameter

(
    UMaterialExpression* Expressio...,
    TMap< FName, TArray< UMaterialExpre...
)

Add an expression node that represents a parameter to the list of material parameters.

Public function Static

void

 

AddReferencedObjects

(
    UObject* InThis,
    FReferenceCollector& Collector
)

Public function Static

void

 

AllMaterialsCacheResourceShadersForRendering

(
    bool bUpdateProgressDialog
)

For all materials, UMaterial::CacheResourceShadersForRendering.

Public function Virtual

FMaterialRes...

 

AllocateResource()

Public function Const

void

 

AppendReferencedFunctionIdsTo

(
    TArray< FGuid >& OutIds
)

Returns an array of the guids of functions used in this material, with the call hierarchy flattened.

Public function Const

void

 

AppendReferencedParameterCollectionIdsTo

(
    TArray< FGuid >& OutIds
)

Returns an array of the guids of parameter collections used in this material.

Public function

bool

 

AttemptInsertNewGroupName

(
    const FString& InNewName
)

Attempts to add a new group name to the Group Data struct. True if new name was added.

Public function Static

void

 

BackupMaterialShadersToMemory

(
    TMap< class FMaterialShaderMap*...
)

Backs up all material shaders to memory through serialization, organized by FMaterialShaderMap.

Public function Virtual

void

 

BuildEditorParameterList()

Iterate through all of the expression nodes in the material and finds any parameters to put in EditorParameters.

Public function

void

 

CacheExpressionTextureReferences()

Cache the expression texture references for this UMaterial if the cache is not filled then it will rebuild the texture references see also RebuildExpressionTextureReferences

Public function Virtual

void

 

CancelOutstandingCompilation()

Cancels any currently outstanding compilation jobs for this material.

Public function Static

void

 

CompileMaterialsForRemoteRecompile

(
    const TArray< UMaterialInterface&#...,
    EShaderPlatform ShaderPlatform,
    TMap< FString, TArray< TRefCountPtr...
)

Builds a map from UMaterialInterface name to the shader maps that are needed for rendering on the given platform.

Public function Static

bool

 

CopyExpressionParameters

(
    UMaterialExpression* Source,
    UMaterialExpression* Destinati...
)

Copy the values of an expression parameter to another expression parameter of the same class.

Public function

void

 

DumpDebugInfo()

Public function

ExpressionTy...

 

FindExpressionByGUID

(
    const FGuid& InGUID
)

Attempt to find a expression by its GUID.

Public function Static

void

 

FixCommentPositions

(
    const TArray< UMaterialExpressionCo...
)

Shifts the positions of comments so that they are aligned correctly with other expressions

Public function Static

void

 

FlipExpressionPositions

(
    const TArray< UMaterialExpression&...,
    const TArray< UMaterialExpressionCo...,
    bool bScaleCoords,
    UMaterial* Material
)

Flip the X coordinates of a material's expressions and space them out more

Public function Const

void

 

GetAllCustomOutputExpressions

(
    TArray< class UMaterialExpressionCu...
)

Returns any UMaterialExpressionCustomOutput expressions

Public function Const

void

 

GetAllExpressionsForCustomInterpolators

(
    TArray< class UMaterialExpression&...
)

Public function Const

void

 

GetAllExpressionsInMaterialAndFunctionsOfType

(
    TArray< ExpressionType* >& Ou...
)

Get all expressions of the requested type, recursing through any function expressions in the material

Public function Const

void

 

GetAllExpressionsOfType

(
    TArray< const ExpressionType* ...
)

Get all expressions of the requested type

Public function Const

void

 

GetAllParameterInfo

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

Public function Virtual

bool

 

GetAllReferencedExpressions

(
    TArray< UMaterialExpression* >...,
    FStaticParameterSet* InStaticP...,
    ERHIFeatureLevel::Type InFeatureLev...,
    EMaterialQualityLevel::Type InQuali...,
    ERHIShadingPath::Type InShadingPath
)

Get all referenced expressions (returns the chains for all properties).

Public function Static

EBlendMode

 

GetBlendModeFromString

(
    const TCHAR* InBlendModeStr
)

Public function Static

const TCHAR ...

 

GetBlendModeString

(
    EBlendMode InBlendMode
)

Public function Const

uint32

 

GetDecalBlendMode()

Returns the material's decal blend mode, calculated from the DecalBlendMode property and what inputs are connected.

Public function Static

UMaterial &#...

 

GetDefaultMaterial

(
    EMaterialDomain Domain
)

Return the default material, loading it if necessary

Public function

FExpressionI...

 

GetExpressionInputForProperty

(
    EMaterialProperty InProperty
)

Get the expression input for the given property

Public function Static

bool

 

GetExpressionParameterName

(
    const UMaterialExpression* Exp...,
    FName& OutName
)

Get the name of a parameter.

Public function Virtual

bool

 

GetExpressionsInPropertyChain

(
    EMaterialProperty InProperty,
    TArray< UMaterialExpression* >...,
    FStaticParameterSet* InStaticP...,
    ERHIFeatureLevel::Type InFeatureLev...,
    EMaterialQualityLevel::Type InQuali...,
    ERHIShadingPath::Type InShadingPath
)

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

Public function Const

uint32

 

GetMaterialDecalResponse()

Returns the material's decal response mode

Public function Static

EMaterialSha...

 

GetMaterialShadingModelFromString

(
    const TCHAR* InMaterialShading...
)

Public function Static

const TCHAR ...

 

GetMaterialShadingModelString

(
    EMaterialShadingModel InMaterialSha...
)

Helper functions for text output of properties.

Public function

void

 

GetQualityLevelNodeUsage

(
    TArray< bool, TInlineAllocator< EMa...
)

Determines whether each quality level has different nodes by inspecting the material's expressions.

Public function

void

 

GetQualityLevelUsage

(
    TArray< bool, TInlineAllocator< EMa...,
    EShaderPlatform ShaderPlatform
)

Determines whether each quality level has different nodes by inspecting the material's expressions.

Public function Const

bool

 

GetUsageByFlag

(
    const EMaterialUsage Usage
)

Public function Const

FString

 

GetUsageName

(
    const EMaterialUsage Usage
)

Public function Const

bool

 

HasAnyExpressionsInMaterialAndFunctionsOfType()

Checks if the material contains an expression of the requested type, recursing through any function expressions in the material

Public function Virtual

bool

 

HasDuplicateDynamicParameters

(
    const UMaterialExpression* Exp...
)

Return whether the provided expression dynamic parameter has duplicates.

Public function Virtual

bool

 

HasDuplicateParameters

(
    const UMaterialExpression* Exp...
)

Return whether the provided expression parameter has duplicates.

Public function Const

bool

 

HasEmissiveColorConnected()

Public function

bool

 

HasFlippedCoordinates()

Checks whether a Material is arranged in the old style, with inputs flowing from right to left

Public function Const

bool

 

HasNormalConnected()

Public function

bool

 

IsCompilingOrHadCompileError

(
    ERHIFeatureLevel::Type InFeatureLev...
)

Useful to customize rendering if that case (e.g. hide the object)

Public function Const

bool

 

IsDefaultMaterial()

Returns true if the material is one of the default materials.

Public function Static

bool

 

IsDynamicParameter

(
    const UMaterialExpression* Exp...
)

Return whether the provided expression node is a dynamic parameter.

Public function Static

bool

 

IsParameter

(
    const UMaterialExpression* Exp...
)

Return whether the provided expression node is a parameter.

Public function Virtual Const

bool

 

IsPostProcessMaterial()

Public function Const

bool

 

IsPropertyActiveInDerived

(
    EMaterialProperty InProperty,
    const UMaterialInterface* Deri...
)

Like IsPropertyActive(), but considers any state overriden by DerivedMaterial

Public function Const

bool

 

IsPropertyActiveInEditor

(
    EMaterialProperty InProperty
)

Like IsPropertyActive(), but should be used in context of editor.

Public function

bool

 

IsTextureForceRecompileCacheRessource

(
    UTexture* Texture
)

Public function Virtual Const

bool

 

IsUIMaterial()

Public function

bool

 

IsUsageFlagDirty

(
    EMaterialUsage Usage
)

Checks to see if the Usage flag has an annotation marking it as needing to be saved

Public function Const

bool

 

NeedsSetMaterialUsage_Concurrent

(
    bool& bOutHasUsage,
    const EMaterialUsage Usage
)

Tests to see if this material needs a usage flag update

Public function Static

void

 

NotifyCompilationFinished

(
    UMaterialInterface* Material
)

Public function Static

FMaterialCom...

 

OnMaterialCompilationFinished()

Public function Virtual

void

 

PropagateExpressionParameterChanges

(
    UMaterialExpression* Parameter
)

A parameter with duplicates has to update its peers so that they all have the same value.

Public function

void

 

RebuildExpressionTextureReferences()

Rebuild ExpressionTextureReferences with all textures referenced by expressions in this material.

Protected function Virtual

bool

 

RecursiveGetExpressionChain

(
    UMaterialExpression* InExpress...,
    TArray< FExpressionInput* >& ...,
    TArray< UMaterialExpression* >...,
    FStaticParameterSet* InStaticP...,
    ERHIFeatureLevel::Type InFeatureLev...,
    EMaterialQualityLevel::Type InQuali...,
    ERHIShadingPath::Type InShadingPath
)

Recursively retrieve the expressions contained in the chain of the given expression.

Protected function

void

 

RecursiveUpdateRealtimePreview

(
    UMaterialExpression* InExpress...,
    TArray< UMaterialExpression* >...
)

Recursively update the bRealtimePreview for each expression based on whether it is connected to something that is time-varying.

Public function

void

 

ReleaseResources()

Releases rendering resources used by this material.

Public function Virtual

bool

 

RemoveExpressionParameter

(
    UMaterialExpression* Expressio...
)

Removes an expression node that represents a parameter from the list of material parameters.

Public function Static

void

 

RestoreMaterialShadersFromMemory

(
    const TMap< class FMaterialShaderMa...
)

Recreates FShaders for FMaterialShaderMap's from the serialized data.

Public function

void

 

SaveShaderStableKeys

(
    const ITargetPlatform* TP
)

Public function

bool

 

SetFontParameterValueEditorOnly

(
    FName ParameterName,
    UFont* InFontValue,
    int32 InFontPage
)

Public function

bool

 

SetMaterialLayersParameterValueEditorOnly

(
    FName ParameterName,
    FMaterialLayersFunctions InValue,
    FGuid OutExpressionGuid
)

Public function

bool

 

SetMaterialUsage

(
    bool& bNeedsRecompile,
    const EMaterialUsage Usage
)

Set the given usage flag.

Public function

bool

 

SetScalarParameterValueEditorOnly

(
    FName ParameterName,
    float InValue
)

Public function

void

 

SetShadingModel

(
    EMaterialShadingModel NewModel
)

Public function

bool

 

SetStaticComponentMaskParameterValueEditorOnly

(
    FName ParameterName,
    bool R,
    bool G,
    bool B,
    bool A,
    FGuid OutExpressionGuid
)

Public function

bool

 

SetStaticSwitchParameterValueEditorOnly

(
    FName ParameterName,
    bool OutValue,
    FGuid OutExpressionGuid
)

Public function

bool

 

SetTextureParameterValueEditorOnly

(
    FName ParameterName,
    UTexture* InValue
)

Public function

bool

 

SetVectorParameterValueEditorOnly

(
    FName ParameterName,
    FLinearColor InValue
)

Public function Virtual

void

 

UpdateExpressionDynamicParameters

(
    const UMaterialExpression* Exp...
)

Iterate through all of the expression nodes and fix up changed properties on matching dynamic parameters when a change occurs.

Public function Virtual

void

 

UpdateExpressionParameterName

(
    UMaterialExpression* Expressio...
)

Remove the expression from the editor parameters list (if it exists) and then re-adds it.

Public function

void

 

UpdateMaterialShaderCacheAndTextureReferences()

Recompute the ddc cache key and reload the material in case the key is not the same.

Public function Static

void

 

UpdateMaterialShaders

(
    TArray< FShaderType* >& Shade...,
    TArray< const FShaderPipelineType&...,
    TArray< const FVertexFactoryType&#...,
    EShaderPlatform ShaderPlatform
)

Go through every material, flush the specified types and re-initialize the material's shader maps.

Overridden from UMaterialInterface

Name Description

Public function Virtual Const

void

 

AppendReferencedTextures

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

Appends textures referenced by expressions, including nested functions.

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

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 Virtual Const

EBlendMode

 

GetBlendMode()

Public function Virtual Const

bool

 

GetCastDynamicShadowAsMasked()

Public function Virtual Const

void

 

GetDependentFunctions

(
    TArray< class UMaterialFunctionInte...
)

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& OutGroup
)

Public function Virtual Const

bool

 

GetGroupSortPriority

(
    const FString& InGroupName,
    int32& OutSortPriority
)

Get the sort priority index of the given parameter group

Public function Virtual Const

void

 

GetLightingGuidChain

(
    bool bIncludeTextures,
    TArray< FGuid >& OutGuids
)

Returns all the Guids related to this material.

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 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 Virtual Const

FMaterialRen...

 

GetRenderProxy()

Return a pointer to the FMaterialRenderProxy used for rendering.

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& OutMinSlider,
    float& OutMaxSlider
)

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

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

 

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 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 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 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 Virtual

bool

 

ShouldForcePlanePreview()

True if this Material Interface should force a plane preview

Public function Virtual

bool

 

UpdateLightmassTextureTracking()

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

Overridden from UObject

Name Description

Public function Virtual

void

 

BeginCacheForCookedPlatformData

(
    const ITargetPlatform* TargetP...
)

Starts caching of platform specific data for the target platform Called when cooking before serialization so that object can prepare platform specific data Not called during normal loading of objects

Public function Virtual

void

 

BeginDestroy()

Called before destroying the object.

Public function Virtual Const

bool

 

CanEditChange

(
    const UProperty* InProperty
)

Called by the editor to query whether a property of this object is allowed to be modified.

Public function Virtual

void

 

ClearAllCachedCookedPlatformData()

Clear all cached cooked platform data

Public function Virtual

void

 

ClearCachedCookedPlatformData

(
    const ITargetPlatform* TargetP...
)

Clears cached cooked platform data for specific platform

Public function Virtual

void

 

FinishDestroy()

Called to finish 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

void

 

GetResourceSizeEx

(
    FResourceSizeEx& CumulativeResourc...
)

Get the size of the object/resource for use in memory tools or to display to artists/LDs in the Editor This is the extended version which separates up the used memory into different memory regions (the actual definition of which may be platform specific).

Public function Virtual

bool

 

IsCachedCookedPlatformDataLoaded

(
    const ITargetPlatform* TargetP...
)

Have we finished loading all the cooked platform data for the target platforms requested in BeginCacheForCookedPlatformData

Public function Virtual

bool

 

IsReadyForFinishDestroy()

Called to check if the object is ready for FinishDestroy.

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

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

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

Public function Virtual

void

 

PreEditChange

(
    UProperty* PropertyAboutToChan...
)

This is called when a property is about to be modified externally

Public function Virtual

void

 

PreSave

(
    const ITargetPlatform* TargetP...
)

Presave function.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Overridden from UObjectBaseUtility

Name Description

Public function Virtual Const

bool

 

CanBeClusterRoot()

Called after load to determine if the object can be a cluster root

Classes

Name

Description

Public class

FMaterialCompilationFinished

Constants

Deprecated Variables

Name Description

Public variable

uint32: 1

 

bIsMasked_DEPRECATED

True if Material is masked and uses custom opacity

Public variable

uint32: 1

 

bUsedWithUI_DEPRECATED

Indicates that the material and its instances can be use with SlateUI and UMG This will result in the shaders required to support UI materials being compiled which will increase shader compile time and memory usage.

Public variable

FColorMaterialI...

 

DiffuseColor_DEPRECATED

Reflection.

Public variable

FColorMaterialI...

 

SpecularColor_DEPRECATED

Deprecated Functions

Name Description

Public function Const

void

 

GetAllFontParameterNames

(
    TArray< FName >& OutParameterNames,
    TArray< FGuid >& OutParameterIds
)

This function is deprecated. Use GetAllFontParameterInfo instead, this contains a struct with FNames, layer association, and index

Public function Const

void

 

GetAllParameterNames

(
    TArray< FName >& OutParameterNames,
    TArray< FGuid >& OutParameterIds,
    const TArray< FStaticMaterialLayers...
)

This function is deprecated. Use GetAllParameterInfo instead, this contains a struct with FNames, layer association, and index

Public function Const

void

 

GetAllScalarParameterNames

(
    TArray< FName >& OutParameterNames,
    TArray< FGuid >& OutParameterIds
)

This function is deprecated. Use GetAllScalarParameterInfo instead, this contains a struct with FNames, layer association, and index

Public function Const

void

 

GetAllStaticComponentMaskParameterNames

(
    TArray< FName >& OutParameterNames,
    TArray< FGuid >& OutParameterIds
)

This function is deprecated. Use GetAllStaticComponentMaskParameterInfo instead, this contains a struct with FNames, layer association, and index

Public function Const

void

 

GetAllStaticSwitchParameterNames

(
    TArray< FName >& OutParameterNames,
    TArray< FGuid >& OutParameterIds
)

This function is deprecated. Use GetAllStaticSwitchParameterInfo instead, this contains a struct with FNames, layer association, and index

Public function Const

void

 

GetAllTextureParameterNames

(
    TArray< FName >& OutParameterNames,
    TArray< FGuid >& OutParameterIds
)

This function is deprecated. Use GetAllTextureParameterInfo instead, this contains a struct with FNames, layer association, and index

Public function Const

void

 

GetAllVectorParameterNames

(
    TArray< FName >& OutParameterNames,
    TArray< FGuid >& OutParameterIds
)

This function is deprecated. Use GetAllVectorParameterInfo instead, this contains a struct with FNames, layer association, and index

References

Module

Engine

Header

Runtime/Engine/Classes/Materials/Material.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