FMaterialResource

Implementation of the [FMaterial](API\Runtime\Engine\FMaterial) interface for a [UMaterial](API\Runtime\Engine\Materials\UMaterial) or [UMaterialInstance](API\Runtime\Engine\Materials\UMaterialInstance).

Windows
MacOS
Linux

Inheritance Hierarchy

FMaterial

FMaterialResource

FMaterialResourceStats

Syntax

class FMaterialResource : public FMaterial

Remarks

Implementation of the FMaterial interface for a UMaterial or UMaterialInstance.

Variables

Name Description

Protected variable

UMaterial *

 

Material

Protected variable

UMaterialInstan...

 

MaterialInstance

Constructors

Name Description

Public function

FMaterialResource()

Destructors

Name Description

Public function Virtual

~FMaterialResource()

Functions

Name Description

Public function Const

void

 

GetEstimatedNumTextureSamples

(
    uint32& VSSamples,
    uint32& PSSamples
)

Public function

void

 

GetResourceSizeEx

(
    FResourceSizeEx& CumulativeResourc...
)

Public function Const

int32

 

GetSamplerUsage()

Returns the number of samplers used in this material, or -1 if the material does not have a valid shader map (compile error or still compiling).

Public function Const

void

 

GetUserInterpolatorUsage

(
    uint32& NumUsedUVScalars,
    uint32& NumUsedCustomInterpolatorS...
)

Public function

void

 

SetMaterial

(
    UMaterial* InMaterial,
    EMaterialQualityLevel::Type InQuali...,
    bool bInQualityLevelHasDifferentNod...,
    ERHIFeatureLevel::Type InFeatureLev...,
    UMaterialInstance* InInstance
)

Overridden from FMaterial

Name Description

Public function Virtual

void

 

AddReferencedObjects

(
    FReferenceCollector& Collector
)

Public function Virtual Const

bool

 

AllowNegativeEmissiveColor()

Protected function Virtual Const

int32

 

CompilePropertyAndSetMaterialProperty

(
    EMaterialProperty Property,
    FMaterialCompiler* Compiler,
    EShaderFrequency OverrideShaderFreq...,
    bool bUsePreviousFrameTime
)

Entry point for compiling a specific material property. This must call SetMaterialProperty.

Public function Virtual Const

bool

 

ComputeFogPerPixel()

Protected function Virtual Const

void

 

GatherCustomOutputExpressions

(
    TArray< class UMaterialExpressionCu...
)

Gives the material a chance to compile any custom output nodes it has added

Protected function Virtual Const

void

 

GatherExpressionsForCustomInterpolators

(
    TArray< class UMaterialExpression&...
)

Gather any UMaterialExpressionCustomOutput expressions in the material and referenced function calls

Public function Virtual Const

bool

 

GetAllowDevelopmentShaderCompile()

Returns true if this material is allowed to make development shaders via the global CVar CompileShadersForDevelopment.

Protected function Virtual Const

FString

 

GetBaseMaterialPathName()

Useful for debugging.

Public function Virtual Const

int32

 

GetBlendableLocation()

Public function Virtual Const

bool

 

GetBlendableOutputAlpha()

Public function Virtual Const

enum EBlendM...

 

GetBlendMode()

Public function Virtual Const

bool

 

GetCastDynamicShadowAsMasked()

Protected function Virtual Const

FString

 

GetDebugName()

Public function Virtual Const

uint32

 

GetDecalBlendMode()

Public function Virtual Const

FString

 

GetFriendlyName()

Public function Virtual Const

uint32

 

GetMaterialDecalResponse()

Public function Virtual Const

EMaterialDom...

 

GetMaterialDomain()

Public function Virtual Const

FGuid

 

GetMaterialId()

Gets the Guid that represents this material.

Public function Virtual Const

UMaterialInt...

 

GetMaterialInterface()

Public function Virtual Const

FString

 

GetMaterialUsageDescription()

Returns a string that describes the material's usage for debugging purposes.

Public function Virtual Const

float

 

GetMaxDisplacement()

Public function Virtual Const

int32

 

GetNumCustomizedUVs()

Public function Virtual Const

float

 

GetOpacityMaskClipValue()

Public function Virtual Const

const TArray...

 

GetReferencedTextures()

Public function Virtual Const

float

 

GetRefractionDepthBiasValue()

Public function Virtual Const

enum ERefrac...

 

GetRefractionMode()

Public function Virtual Const

void

 

GetShaderMapId

(
    EShaderPlatform Platform,
    FMaterialShaderMapId& OutId
)

Material properties.

Public function Virtual Const

enum EMateri...

 

GetShadingModel()

Public function Virtual Const

enum EMateri...

 

GetTessellationMode()

Public function Virtual Const

float

 

GetTranslucencyDirectionalLightingIntensity()

Public function Virtual Const

enum ETransl...

 

GetTranslucencyLightingMode()

Public function Virtual Const

float

 

GetTranslucentBackscatteringExponent()

Public function Virtual Const

FLinearColor

 

GetTranslucentMultipleScatteringExtinction()

Public function Virtual Const

float

 

GetTranslucentSelfShadowDensityScale()

Public function Virtual Const

float

 

GetTranslucentSelfShadowSecondDensityScale()

Public function Virtual Const

float

 

GetTranslucentSelfShadowSecondOpacity()

Public function Virtual Const

float

 

GetTranslucentShadowDensityScale()

Public function Virtual Const

float

 

GetTranslucentShadowStartOffset()

Public function Virtual Const

bool

 

HasEmissiveColorConnected()

Protected function Virtual Const

bool

 

HasMaterialAttributesConnected()

Public function Virtual Const

bool

 

HasNormalConnected()

Protected function Virtual Const

bool

 

HasPixelDepthOffsetConnected()

Protected function Virtual Const

bool

 

HasVertexPositionOffsetConnected()

Public function Virtual Const

bool

 

IsAdaptiveTessellationEnabled()

Public function Virtual Const

bool

 

IsCrackFreeDisplacementEnabled()

Public function Virtual Const

bool

 

IsDefaultMaterial()

Public function Virtual Const

bool

 

IsDeferredDecal()

Public function Virtual Const

bool

 

IsDistorted()

Public function Virtual Const

bool

 

IsDitheredLODTransition()

Public function Virtual Const

bool

 

IsDitherMasked()

Public function Virtual Const

bool

 

IsFullyRough()

Public function Virtual Const

bool

 

IsLightFunction()

Public function Virtual Const

bool

 

IsMasked()

Public function Virtual Const

bool

 

IsMobileSeparateTranslucencyEnabled()

Public function Virtual Const

bool

 

IsNonmetal()

Public function Virtual Const

bool

 

IsPersistent()

Should shaders compiled for this material be saved to disk?

Public function Virtual Const

bool

 

IsSpecialEngineMaterial()

Public function Virtual Const

bool

 

IsTangentSpaceNormal()

Public function Virtual Const

bool

 

IsTranslucencyAfterDOFEnabled()

Public function Virtual Const

bool

 

IsTranslucencyWritingCustomDepth()

Public function Virtual Const

bool

 

IsTwoSided()

Public function Virtual Const

bool

 

IsUIMaterial()

Public function Virtual Const

bool

 

IsUsedWithAPEXCloth()

Public function Virtual Const

bool

 

IsUsedWithBeamTrails()

Public function Virtual Const

bool

 

IsUsedWithEditorCompositing()

Public function Virtual Const

bool

 

IsUsedWithGeometryCache()

Public function Virtual Const

bool

 

IsUsedWithInstancedStaticMeshes()

Public function Virtual Const

bool

 

IsUsedWithLandscape()

Public function Virtual Const

bool

 

IsUsedWithMeshParticles()

Public function Virtual Const

bool

 

IsUsedWithMorphTargets()

Public function Virtual Const

bool

 

IsUsedWithNiagaraMeshParticles()

Public function Virtual Const

bool

 

IsUsedWithNiagaraRibbons()

Public function Virtual Const

bool

 

IsUsedWithNiagaraSprites()

Public function Virtual Const

bool

 

IsUsedWithParticleSprites()

Public function Virtual Const

bool

 

IsUsedWithParticleSystem()

Public function Virtual Const

bool

 

IsUsedWithSkeletalMesh()

Public function Virtual Const

bool

 

IsUsedWithSplineMeshes()

Public function Virtual Const

bool

 

IsUsedWithStaticLighting()

Public function Virtual Const

bool

 

IsUsingFullPrecision()

Public function Virtual Const

bool

 

IsUsingHQForwardReflections()

Public function Virtual Const

bool

 

IsUsingPlanarForwardReflections()

Public function Virtual Const

bool

 

IsVolumetricPrimitive()

Public function Virtual Const

bool

 

IsWireframe()

Public function Virtual

void

 

LegacySerialize

(
    FArchive& Ar
)

Serializes the material.

Public function Virtual

void

 

NotifyCompilationFinished()

Called when compilation of an FMaterial finishes, after the GameThreadShaderMap is set and the render command to set the RenderThreadShaderMap is queued

Public function Virtual Const

bool

 

OutputsVelocityOnBasePass()

Public function Virtual Const

bool

 

RequiresSynchronousCompilation()

Public function Virtual Const

bool

 

ShouldApplyFogging()

Public function Virtual Const

bool

 

ShouldBlockGI()

Public function Virtual Const

bool

 

ShouldDisableDepthTest()

Public function Virtual Const

bool

 

ShouldDoContactShadows()

Public function Virtual Const

bool

 

ShouldDoSSR()

Public function Virtual Const

bool

 

ShouldEnableResponsiveAA()

Public function Virtual Const

bool

 

ShouldGenerateSphericalParticleNormals()

Public function Virtual Const

bool

 

ShouldInjectEmissiveIntoLPV()

Public function Virtual Const

bool

 

ShouldWriteOnlyAlpha()

Public function Virtual Const

bool

 

UseLmDirectionality()

Public function Virtual Const

bool

 

UseNormalCurvatureToRoughness()

References

Module

Engine

Header

Runtime/Engine/Public/MaterialShared.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