Navigation
API > API/Runtime > API/Runtime/Engine
A material that is rendered onto the surface of a mesh. A kind of 'bumper sticker' for a model.
| Name | UDecalComponent |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Components/DecalComponent.h |
| Include Path | #include "Components/DecalComponent.h" |
Syntax
UCLASS (Blueprintable, EditInlineNew,
HideCategories=(Collision, Object, Physics, SceneComponent, Activation, "Components|Activation", Mobility),
ClassGroup=Rendering, Meta=(BlueprintSpawnableComponent), MinimalAPI)
class UDecalComponent : public USceneComponent
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UActorComponent → USceneComponent → UDecalComponent
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UDecalComponent
(
const FObjectInitializer& ObjectInitializer |
Components/DecalComponent.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bDestroyOwnerAfterFade | uint8 | Automatically destroys the owning actor after fully fading out. | Components/DecalComponent.h |
|
| DecalColor | FLinearColor | Decal color, can be accessed using the material Decal Color node. | Components/DecalComponent.h |
|
| DecalSize | FVector | Decal size in local space (does not include the component scale), technically redundant but there for convenience | Components/DecalComponent.h |
|
| FadeDuration | float | Time in seconds for the decal to fade out. | Components/DecalComponent.h |
|
| FadeInDuration | float | Components/DecalComponent.h |
|
|
| FadeInStartDelay | float | Components/DecalComponent.h |
|
|
| FadeScreenSize | float | Components/DecalComponent.h |
|
|
| FadeStartDelay | float | Time in seconds to wait before beginning to fade out the decal. | Components/DecalComponent.h |
|
| LatestPSOPrecacheJobSet | int32 | Components/DecalComponent.h | ||
| LatestPSOPrecacheJobSetCompleted | std::atomic< int > | Atomic int used to track the last PSO precache events | Components/DecalComponent.h | |
| SceneProxy | FDeferredDecalProxy * | The decal proxy. | Components/DecalComponent.h | |
| SortOrder | int32 | Controls the order in which decal elements are rendered. | Components/DecalComponent.h |
|
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual UMaterialInstanceDynamic * CreateDynamicMaterialInstance() |
Utility to allocate a new Dynamic Material Instance, set its parent to the currently applied material, and assign it | Components/DecalComponent.h |
|
virtual FDeferredDecalProxy * CreateSceneProxy() |
Components/DecalComponent.h | ||
UMaterialInterface * GetDecalMaterial() |
Accessor for decal material | Components/DecalComponent.h |
|
float GetFadeDuration() |
Components/DecalComponent.h |
|
|
float GetFadeInDuration() |
Components/DecalComponent.h |
|
|
float GetFadeInStartDelay() |
Components/DecalComponent.h |
|
|
float GetFadeStartDelay() |
Components/DecalComponent.h |
|
|
virtual UMaterialInterface * GetMaterial
(
int32 ElementIndex |
Components/DecalComponent.h | ||
virtual int32 GetNumMaterials() |
Components/DecalComponent.h | ||
FTransform GetTransformIncludingDecalSize() |
Components/DecalComponent.h | ||
virtual void GetUsedMaterials
(
TArray< UMaterialInterface* >& OutMaterials, |
Retrieves the materials used in this component | Components/DecalComponent.h | |
void PushSelectionToProxy() |
Pushes new selection state to the render thread primitive proxy | Components/DecalComponent.h | |
void SetDecalColor
(
const FLinearColor& Color |
Sets the decal color. | Components/DecalComponent.h |
|
void SetDecalMaterial
(
UMaterialInterface* NewDecalMaterial |
Setting decal material on decal component. This will force the decal to reattach | Components/DecalComponent.h |
|
void SetFadeIn
(
float StartDelay, |
Components/DecalComponent.h |
|
|
void SetFadeOut
(
float StartDelay, |
Sets the decal's fade start time, duration and if the owning actor should be destroyed after the decal is fully faded out. | Components/DecalComponent.h |
|
void SetFadeScreenSize
(
float NewFadeScreenSize |
Set the FadeScreenSize for this decal component | Components/DecalComponent.h |
|
void SetLifeSpan
(
const float LifeSpan |
Components/DecalComponent.h | ||
virtual void SetMaterial
(
int32 ElementIndex, |
Components/DecalComponent.h | ||
void SetSortOrder
(
int32 Value |
Sets the sort order for the decal component. | Components/DecalComponent.h |
|
Overridden from USceneComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual FBoxSphereBounds CalcBounds
(
const FTransform& LocalToWorld |
Calculate the bounds of the component. Default behavior is a bounding box/sphere of zero size. | Components/DecalComponent.h | |
| Returns full material property path and UObject owner property object Path examples: Material property path with array element and inner struct Materials[0].InnerStruct.Material Material property path with array element Materials[0] Simple material property path Materials | Components/DecalComponent.h |
Overridden from UActorComponent
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual const UObject * AdditionalStatObject() |
Give a readable name for this component, including asset name if applicable | Components/DecalComponent.h | |
virtual void BeginPlay () |
Begins Play for the component. | Components/DecalComponent.h | |
virtual void CheckForErrors () |
Function that gets called from within Map_Check to allow this actor component to check itself for any potential errors and register them with map check dialog. | Components/DecalComponent.h | |
virtual void CreateRenderState_Concurrent
(
FRegisterComponentContext* Context |
Used to create any rendering thread information for this component | Components/DecalComponent.h | |
virtual void DestroyRenderState_Concurrent () |
Used to shut down any rendering thread structure for this component | Components/DecalComponent.h | |
virtual void OnRegister() |
Called when a component is registered, after Scene is set, but before CreateRenderState_Concurrent or OnCreatePhysicsState are called. | Components/DecalComponent.h | |
virtual void PrecachePSOs() |
Precache all PSOs which can be used by the actor component | Components/DecalComponent.h | |
virtual void SendRenderTransform_Concurrent () |
Called to send a transform update for this component to the rendering thread | Components/DecalComponent.h |
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual bool IsPostLoadThreadSafe() |
Components/DecalComponent.h | ||
virtual void PostLoad() |
Components/DecalComponent.h | ||
virtual void Serialize
(
FArchive& Ar |
Components/DecalComponent.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void LifeSpanCallback() |
Called when the life span of the decal has been exceeded | Components/DecalComponent.h |