reckfellENGINE

FogMaterial

Built-in FogVolume density, scattering and emission material.

On this page
class FogMaterialReckfellSharpInherits Material

Multiplies Density by height attenuation, the DensityTexture red channel and SDF edge profile. FogVolumes can share the material. Use a fog-type ShaderMaterial for another formula; similarly named parameters on different material types are not automatically linked.

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

Constructors1

FogMaterialConstructor
# FogMaterial
C#
public FogMaterial();

Creates a fog material with Density=1, Albedo=White, Emission=Black, HeightFalloff=0, EdgeFade=0.1 and DensityTexture=null. It is a FogVolume material, not an ordinary MeshInstance3D surface material.

Properties6

AlbedoProperty
# Albedo
C#
public Color Albedo { get; set; }

Medium light-scattering color, not a guaranteed final pixel color. Output depends on lights, Density and Environment. Emission controls the medium’s own emission.

DensityProperty
# Density
C#
public float Density { get; set; }

Local volume contribution to density. Positive adds fog, zero removes its contribution and negative reduces existing density. This is not transparent-mesh alpha. In the gallery, 0.08 creates local mist at global density 0, while -0.12 reduces global fog at 0.02.

DensityTextureProperty
# DensityTexture
C#
public Texture3D DensityTexture { get; set; }

Optional Texture3D whose red channel multiplies Density using volume UVW. null clears it and leaves the built-in sampler white fallback. This is not a Texture2D. Use a fog-type ShaderMaterial for custom world-coordinate mapping.

EdgeFadeProperty
# EdgeFade
C#
public float EdgeFade { get; set; }

Nonnegative exponent of the shape-edge density falloff. Positive values fade density toward the boundary; increasing it changes the transition profile rather than Size. Negative assignments become zero. The gallery uses 0.5.

EmissionProperty
# Emission
C#
public Color Emission { get; set; }

Medium self-emission. Black removes this contribution. It does not replace Light3D for lighting neighboring meshes: the fog shader writes emission into the volume buffer rather than creating a light.

HeightFalloffProperty
# HeightFalloff
C#
public float HeightFalloff { get; set; }

Nonnegative density falloff upward along world Y relative to the FogVolume position. Zero retains density across height before other factors. The shader uses clamp(exp2(-HeightFalloff × (worldY − volumeY)), 0, 1); negative assignments become zero.

Methods12

GetAlbedoColor
# GetAlbedo
C#
public Color GetAlbedo();

Incoming-light scattering RGB. Without lighting/emission, black albedo produces an absorbing volume. Color alpha does not control fog transparency; density does.

Returns Color

Stored albedo Color.

GetDensityfloat
# GetDensity
C#
public float GetDensity();

Density contribution, not surface alpha. Positive adds fog, zero removes this material contribution and negative subtracts overlapping density. The setter retains negative values. Density subtraction does not guarantee removing another volume emission: RD accumulates them separately.

Returns float

Stored density.

GetDensityTextureTexture3D
# GetDensityTexture
C#
public Texture3D GetDensityTexture();

Optional Texture3D whose red channel multiplies Density using volume UVW. null clears it and leaves the built-in sampler white fallback. This is not a Texture2D. Use a fog-type ShaderMaterial for custom world-coordinate mapping.

Returns Texture3D

Assigned Texture3D, or null.

GetEdgeFadefloat
# GetEdgeFade
C#
public float GetEdgeFade();

Nonnegative exponent of SDF-based density falloff toward the shape boundary. It is neither a width in meters nor the volume Size. The setter clamps negative values to zero without an upper limit of one.

Returns float

Stored nonnegative exponent.

GetEmissionColor
# GetEmission
C#
public Color GetEmission();

Medium self-emission RGB, not a Light3D illuminating nearby models. Contribution depends on positive density. Black removes this material emission; another volume negative density does not necessarily erase it.

Returns Color

Stored emission Color.

GetHeightFallofffloat
# GetHeightFalloff
C#
public float GetHeightFalloff();

Nonnegative height attenuation along world Y relative to FogVolume position. The built-in shader uses clamp(exp2(-HeightFalloff * (worldY - volumeY)),0,1). The setter clamps negative values to zero but permits values above one.

Returns float

Coefficient after clamping its lower bound to zero.

SetAlbedovoid
# SetAlbedo
C#
public void SetAlbedo(Color albedo);

Incoming-light scattering RGB. Without lighting/emission, black albedo produces an absorbing volume. Color alpha does not control fog transparency; density does.

Parameters
NameTypeDefault
albedoColor—
albedo

Scattering color; the shader uses RGB.

SetDensityvoid
# SetDensity
C#
public void SetDensity(float density);

Density contribution, not surface alpha. Positive adds fog, zero removes this material contribution and negative subtracts overlapping density. The setter retains negative values. Density subtraction does not guarantee removing another volume emission: RD accumulates them separately.

Parameters
NameTypeDefault
densityfloat—
density

Density, including negative subtraction; the inspector range hint is not a setter clamp.

SetDensityTexturevoid
# SetDensityTexture
C#
public void SetDensityTexture(Texture3D densityTexture);

Optional Texture3D whose red channel multiplies Density using volume UVW. null clears it and leaves the built-in sampler white fallback. This is not a Texture2D. Use a fog-type ShaderMaterial for custom world-coordinate mapping.

Parameters
NameTypeDefault
densityTextureTexture3D—
densityTexture

3D density texture, or null.

SetEdgeFadevoid
# SetEdgeFade
C#
public void SetEdgeFade(float edgeFade);

Nonnegative exponent of SDF-based density falloff toward the shape boundary. It is neither a width in meters nor the volume Size. The setter clamps negative values to zero without an upper limit of one.

Parameters
NameTypeDefault
edgeFadefloat—
edgeFade

Boundary-profile exponent; initially 0.1.

SetEmissionvoid
# SetEmission
C#
public void SetEmission(Color emission);

Medium self-emission RGB, not a Light3D illuminating nearby models. Contribution depends on positive density. Black removes this material emission; another volume negative density does not necessarily erase it.

Parameters
NameTypeDefault
emissionColor—
emission

Self-emission color; RGB is used, not alpha.

SetHeightFalloffvoid
# SetHeightFalloff
C#
public void SetHeightFalloff(float heightFalloff);

Nonnegative height attenuation along world Y relative to FogVolume position. The built-in shader uses clamp(exp2(-HeightFalloff * (worldY - volumeY)),0,1). The setter clamps negative values to zero but permits values above one.

Parameters
NameTypeDefault
heightFallofffloat—
heightFalloff

Coefficient; zero disables height attenuation.

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.