reckfellENGINE

Decal

Entity that projects a texture onto a MeshInstance3D.

On this page
class DecalReckfellSharpInherits VisualInstance3D

Entity that projects a texture onto a MeshInstance3D.

Decals are used to project a texture onto a Mesh in the scene. Use Decals to add detail to a scene without affecting the underlying Mesh. They are often used to add weathering to building, add dirt or mud to the ground, or add variety to props. Decals can be moved at any time, making them suitable for things like blob shadows or laser sight dots. They are made of an Aabb and a group of Texture2Ds specifying Color, normal, ORM (ambient occlusion, roughness, metallic), and emission. Decals are projected within their Aabb so altering the orientation of the Decal affects the direction in which they are projected. By default, Decals are projected down (i.e. from positive Y to negative Y). The Texture2Ds associated with the Decal are automatically stored in a texture atlas which is used for drawing the decals so all decals can be drawn at once. Reckfell uses clustered decals, meaning they are stored in cluster data and drawn when the mesh is drawn, they are not drawn as a post-processing effect after. Note: Decals cannot affect an underlying material's transparency, regardless of its transparency mode (alpha blend, alpha scissor, alpha hash, opaque pre-pass). This means translucent or transparent areas of a material will remain translucent or transparent even if an opaque decal is applied on them. Note: Decals are only supported in the Forward+ and Mobile rendering methods, not Compatibility. When using the Mobile rendering method, only 8 decals can be displayed on each mesh resource. Attempting to display more than 8 decals on a single mesh resource will result in decals flickering in and out as the camera moves. Note: When using the Mobile rendering method, decals will only correctly affect meshes whose visibility AABB intersects with the decal's AABB. If using a shader to deform the mesh in a way that makes it go outside its AABB, GeometryInstance3D.ExtraCullMargin must be increased on the mesh. Otherwise, the decal may not be visible on the mesh.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

DecalConstructor
# Decal
C#
public Decal();

Properties15

AlbedoMixProperty
# AlbedoMix
C#
public float AlbedoMix { get; set; }

Base-color modification weight. Zero retains the original surface albedo but does not disable Normal/ORM when TextureAlbedo provides an alpha mask. Use Visible=false to disable the entire instance.

CullMaskProperty
# CullMask
C#
public uint CullMask { get; set; }

Receiver rendering-layer bitmask. The decal applies when it overlaps the mesh VisualInstance3D.Layers. This is not PhysicsBody3D.CollisionLayer or a single layer number. The example CullMask=2 selects floor meshes with Layers=2.

DistanceFadeBeginProperty
# DistanceFadeBegin
C#
public float DistanceFadeBegin { get; set; }

Camera-to-decal-position distance after which fading begins when DistanceFadeEnabled=true. Contribution is retained before it. Use a nonnegative distance for a predictable setup.

DistanceFadeEnabledProperty
# DistanceFadeEnabled
C#
public bool DistanceFadeEnabled { get; set; }

Enables fading by distance between the camera and decal position. Uses DistanceFadeBegin and DistanceFadeLength. This is visual decal optimization, not script suspension or Entity removal.

DistanceFadeLengthProperty
# DistanceFadeLength
C#
public float DistanceFadeLength { get; set; }

Transition length after DistanceFadeBegin. With distance fade enabled, the decal is excluded beyond Begin+Length. Use a positive value: zero length does not define a smooth transition.

EmissionEnergyProperty
# EmissionEnergy
C#
public float EmissionEnergy { get; set; }

TextureEmission multiplier. Zero removes that contribution, not albedo/Normal/ORM. Decal emission does not create a Light3D or guarantee lighting of neighboring meshes.

LowerFadeProperty
# LowerFade
C#
public float LowerFade { get; set; }

Nonnegative falloff exponent toward the projection volume’s negative local-Y boundary. Zero removes this gradient; negative assignments become zero. Reducing Size.Y changes the intersection region rather than this exponent.

ModulateProperty
# Modulate
C#
public Color Modulate { get; set; }

RGB multiplies albedo and emission colors. Alpha attenuates albedo and its mask-driven Normal/ORM blending; emission is not multiplied by Modulate.A. Alpha=0 therefore does not reliably disable the whole decal.

NormalFadeProperty
# NormalFade
C#
public float NormalFade { get; set; }

Attenuates projection on surfaces whose geometric normals face an unsuitable direction. A positive value enables angular falloff; this is not TextureNormal strength. The example uses 0.5; angular edge cases are not separately verified.

SizeProperty
# Size
C#
public Vector3 Size { get; set; }

Full projection-volume dimensions along local axes. X/Z define texture coverage and Y defines depth. The volume must intersect the surface. Assignment clamps every component to at least 0.001; these are not half-extents.

TextureAlbedoProperty
# TextureAlbedo
C#
public Texture2D TextureAlbedo { get; set; }

Decal color and alpha mask. Alpha also controls Normal and ORM blending; to change only those channels, retain the Albedo texture and set AlbedoMix=0. Removing this texture is not equivalent to zero AlbedoMix.

TextureEmissionProperty
# TextureEmission
C#
public Texture2D TextureEmission { get; set; }

Additive emission from texture RGB, independent of TextureAlbedo and its alpha mask. Non-emitting areas must be black in RGB; transparency alone does not guarantee zero emission. Brightness is multiplied by EmissionEnergy and Modulate.RGB.

TextureNormalProperty
# TextureNormal
C#
public Texture2D TextureNormal { get; set; }

Normal map modifies surface lighting within the TextureAlbedo alpha mask rather than geometry or collision. For a normal-only decal, assign both textures and AlbedoMix=0. The example does not validate imported-map orientation or authoring-tool conventions.

TextureOrmProperty
# TextureOrm
C#
public Texture2D TextureOrm { get; set; }

Packed channels: R ambient occlusion, G roughness, B metallic. Blending uses TextureAlbedo alpha. The example verifies a material change with AlbedoMix=0 and removal of that influence when the Albedo texture is absent.

UpperFadeProperty
# UpperFade
C#
public float UpperFade { get; set; }

Nonnegative falloff exponent toward the projection volume’s positive local-Y boundary. Zero removes this gradient; negative assignments become zero. This is separate from camera-distance fade.

Methods24

GetAlbedoMixfloat
# GetAlbedoMix
C#
public float GetAlbedoMix();

Reads AlbedoMix from this instance. The value alone does not establish visible projection onto a surface.

Returns float

Base-color modification weight. Zero retains the original surface albedo but does not disable Normal/ORM when TextureAlbedo provides an alpha mask. Use Visible=false to disable the entire instance.

GetCullMaskuint
# GetCullMask
C#
public uint GetCullMask();

Reads CullMask from this instance. The value alone does not establish visible projection onto a surface.

Returns uint

Receiver rendering-layer bitmask. The decal applies when it overlaps the mesh VisualInstance3D.Layers. This is not PhysicsBody3D.CollisionLayer or a single layer number. The example CullMask=2 selects floor meshes with Layers=2.

GetDistanceFadeBeginfloat
# GetDistanceFadeBegin
C#
public float GetDistanceFadeBegin();
Returns float
GetDistanceFadeLengthfloat
# GetDistanceFadeLength
C#
public float GetDistanceFadeLength();
Returns float
GetEmissionEnergyfloat
# GetEmissionEnergy
C#
public float GetEmissionEnergy();
Returns float
GetLowerFadefloat
# GetLowerFade
C#
public float GetLowerFade();
Returns float
GetModulateColor
# GetModulate
C#
public Color GetModulate();

Reads Modulate from this instance. The value alone does not establish visible projection onto a surface.

Returns Color

RGB multiplies albedo and emission colors. Alpha attenuates albedo and its mask-driven Normal/ORM blending; emission is not multiplied by Modulate.A. Alpha=0 therefore does not reliably disable the whole decal.

GetNormalFadefloat
# GetNormalFade
C#
public float GetNormalFade();
Returns float
GetSizeVector3
# GetSize
C#
public Vector3 GetSize();

Reads Size from this instance. The value alone does not establish visible projection onto a surface.

Returns Vector3

Full projection-volume dimensions along local axes. X/Z define texture coverage and Y defines depth. The volume must intersect the surface. Assignment clamps every component to at least 0.001; these are not half-extents.

GetTextureTexture2D
# GetTexture
C#
public Texture2D GetTexture(Decal.DecalTexture type);

Reads the resource assigned to the selected channel. Does not capture projection output or return a surface image.

Parameters
NameTypeDefault
typeDecal.DecalTexture—
type

Albedo, Normal, Orm or Emission channel. Do not pass Max.

Returns Texture2D

Assigned Texture2D, or null for an empty channel. A resource reference does not establish decal visibility.

GetUpperFadefloat
# GetUpperFade
C#
public float GetUpperFade();
Returns float
IsDistanceFadeEnabledbool
# IsDistanceFadeEnabled
C#
public bool IsDistanceFadeEnabled();
Returns bool
SetAlbedoMixvoid
# SetAlbedoMix
C#
public void SetAlbedoMix(float energy);

Sets AlbedoMix. Base-color modification weight. Zero retains the original surface albedo but does not disable Normal/ORM when TextureAlbedo provides an alpha mask. Use Visible=false to disable the entire instance.

Parameters
NameTypeDefault
energyfloat—
energy

Albedo blend weight, normally 0…1. Despite the name energy, this is not EmissionEnergy.

SetCullMaskvoid
# SetCullMask
C#
public void SetCullMask(uint mask);

Sets CullMask. Receiver rendering-layer bitmask. The decal applies when it overlaps the mesh VisualInstance3D.Layers. This is not PhysicsBody3D.CollisionLayer or a single layer number. The example CullMask=2 selects floor meshes with Layers=2.

Parameters
NameTypeDefault
maskuint—
mask

Receiver rendering-layer bitmask; zero selects no layers.

SetDistanceFadeBeginvoid
# SetDistanceFadeBegin
C#
public void SetDistanceFadeBegin(float distance);
Parameters
NameTypeDefault
distancefloat—
SetDistanceFadeLengthvoid
# SetDistanceFadeLength
C#
public void SetDistanceFadeLength(float distance);
Parameters
NameTypeDefault
distancefloat—
SetEmissionEnergyvoid
# SetEmissionEnergy
C#
public void SetEmissionEnergy(float energy);
Parameters
NameTypeDefault
energyfloat—
SetEnableDistanceFadevoid
# SetEnableDistanceFade
C#
public void SetEnableDistanceFade(bool enable);
Parameters
NameTypeDefault
enablebool—
SetLowerFadevoid
# SetLowerFade
C#
public void SetLowerFade(float fade);
Parameters
NameTypeDefault
fadefloat—
SetModulatevoid
# SetModulate
C#
public void SetModulate(Color color);

Sets Modulate. RGB multiplies albedo and emission colors. Alpha attenuates albedo and its mask-driven Normal/ORM blending; emission is not multiplied by Modulate.A. Alpha=0 therefore does not reliably disable the whole decal.

Parameters
NameTypeDefault
colorColor—
color

RGB color multiplier and alpha for the albedo/Normal/ORM mask. Alpha does not disable emission.

SetNormalFadevoid
# SetNormalFade
C#
public void SetNormalFade(float fade);
Parameters
NameTypeDefault
fadefloat—
SetSizevoid
# SetSize
C#
public void SetSize(Vector3 size);

Sets Size. Full projection-volume dimensions along local axes. X/Z define texture coverage and Y defines depth. The volume must intersect the surface. Assignment clamps every component to at least 0.001; these are not half-extents.

Parameters
NameTypeDefault
sizeVector3—
size

Full local dimensions. Every component is clamped to at least 0.001.

SetTexturevoid
# SetTexture
C#
public void SetTexture(Decal.DecalTexture type, Texture2D texture);

Assigns a texture to the specified decal channel. null clears the channel. Normal/ORM require a separate TextureAlbedo alpha mask; Emission is processed independently.

Parameters
NameTypeDefault
typeDecal.DecalTexture—
textureTexture2D—
type

DecalTexture.Albedo, Normal, Orm or Emission channel. Max is an enum bound, not a channel.

texture

Texture for the selected channel, or null to remove it. Check the particular Texture2D subtype: a viewport reference is not a regular imported decal-atlas texture.

SetUpperFadevoid
# SetUpperFade
C#
public void SetUpperFade(float fade);
Parameters
NameTypeDefault
fadefloat—

Decal.DecalTexture

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.