UDecalComponent

A material that is rendered onto the surface of a mesh. A kind of 'bumper sticker' for a model.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Components/DecalComponent.h

Include

#include "Components/DecalComponent.h"

Syntax

class UDecalComponent : public USceneComponent

Remarks

A material that is rendered onto the surface of a mesh. A kind of 'bumper sticker' for a model.

Variables

Name Description

Public variable

uint8: 1

 

bDestroyOwnerAfterFade

Automatically destroys the owning actor after fully fading out.

Protected variable

UMaterialInterf...

 

DecalMaterial

Decal material.

Public variable

FVector

 

DecalSize

Decal size in local space (does not include the component scale), technically redundant but there for convenience

Public variable

float

 

FadeDuration

Time in seconds for the decal to fade out.

Public variable

float

 

FadeInDuration

Public variable

float

 

FadeInStartDelay

Public variable

float

 

FadeScreenSize

Public variable

float

 

FadeStartDelay

Time in seconds to wait before beginning to fade out the decal.

Public variable

FDeferredDecalP...

 

SceneProxy

The decal proxy.

Public variable

int32

 

SortOrder

Controls the order in which decal elements are rendered.

Protected variable

FTimerHandle

 

TimerHandle_DestroyDecalComponent

Handle for efficient management of DestroyDecalComponent timer

Constructors

Name Description

Public function

UDecalComponent

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Virtual

UMaterialIns...

 

CreateDynamicMaterialInstance()

Utility to allocate a new Dynamic Material Instance, set its parent to the currently applied material, and assign it

Public function Virtual

FDeferredDec...

 

CreateSceneProxy()

Public function Const

UMaterialInt...

 

GetDecalMaterial()

Accessor for decal material

Public function Const

float

 

GetFadeDuration()

Public function Const

float

 

GetFadeInDuration()

Public function Const

float

 

GetFadeInStartDelay()

Public function Const

float

 

GetFadeStartDelay()

Public function Virtual Const

UMaterialInt...

 

GetMaterial

(
    int32 ElementIndex
)

Public function Virtual Const

int32

 

GetNumMaterials()

Public function Const

FTransform

 

GetTransformIncludingDecalSize()

Public function Virtual Const

void

 

GetUsedMaterials

(
    TArray< UMaterialInterface* > ...,
    bool bGetDebugMaterials
)

Retrieves the materials used in this component

Protected function Virtual

void

 

LifeSpanCallback()

Called when the life span of the decal has been exceeded

Public function

void

 

PushSelectionToProxy()

Pushes new selection state to the render thread primitive proxy

Public function

void

 

SetDecalMaterial

(
    UMaterialInterface* NewDecalMa...
)

Setting decal material on decal component. This will force the decal to reattach

Public function

void

 

SetFadeIn

(
    float StartDelay,
    float Duaration
)

Public function

void

 

SetFadeOut

(
    float StartDelay,
    float Duration,
    bool DestroyOwnerAfterFade
)

Sets the decal's fade start time, duration and if the owning actor should be destroyed after the decal is fully faded out.

Public function

void

 

SetFadeScreenSize

(
    float NewFadeScreenSize
)

Set the FadeScreenSize for this decal component

Public function

void

 

SetLifeSpan

(
    const float LifeSpan
)

Public function Virtual

void

 

SetMaterial

(
    int32 ElementIndex,
    UMaterialInterface* InMaterial
)

Public function

void

 

SetSortOrder

(
    int32 Value
)

Sets the sort order for the decal component.

Overridden from USceneComponent

Name Description

Public function Virtual Const

FBoxSphereBo...

 

CalcBounds

(
    const FTransform& LocalToWorld
)

Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size.

Overridden from UActorComponent

Name Description

Public function Virtual Const

const UObjec...

 

AdditionalStatObject()

Give a readable name for this component, including asset name if applicable

Public function Virtual

void

 

BeginPlay()

Begins Play for the component.

Public function Virtual

void

 

CreateRenderState_Concurrent

(
    FRegisterComponentContext* Con...
)

Used to create any rendering thread information for this component

Public function Virtual

void

 

DestroyRenderState_Concurrent()

Used to shut down any rendering thread structure for this component

Public function Virtual

void

 

SendRenderTransform_Concurrent()

Called to send a transform update for this component to the rendering thread

Overridden from UObject

Name Description

Public function Virtual Const

bool

 

IsPostLoadThreadSafe()

Called during async load to determine if PostLoad can be called on the loading thread.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

See Also

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