reckfellENGINE

Trail3D

A node to draw lines behind moving objects.

On this page
class Trail3DReckfellSharpInherits Line3D

A node to draw lines behind moving objects.

The Trail3D node draws a flat line in space, with an optional billboard mode. Note: This node is designed for visual effects. For solid lines, pipes, and tubes, use a CsgPolygon3D node in CsgPolygon3D.ModeEnum.Path mode.

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

Constructors1

Trail3DConstructor
# Trail3D
C#
public Trail3D();

Properties15

ColorProperty
# Color
C#
public Color Color { get; set; }

The color of the trail. Note: Colors with values above 1.0 (overbright) are not supported. Note: To have a visible effect on a BaseMaterial3D, BaseMaterial3D.VertexColorUseAsAlbedo must be true. For a ShaderMaterial, ALBEDO *= COLOR.rgb; must be inserted in the shader's fragment() function. Otherwise, Trail3D.Color will have no visible effect.

ColorGradientProperty
# ColorGradient
C#
public Gradient ColorGradient { get; set; }

The color gradient over the trail length. Note: Colors with values above 1.0 (overbright) are not supported. Note: To have a visible effect on a BaseMaterial3D, BaseMaterial3D.VertexColorUseAsAlbedo must be true. For a ShaderMaterial, ALBEDO *= COLOR.rgb; must be inserted in the shader's fragment() function. Otherwise, Trail3D.Color will have no visible effect.

EmittingProperty
# Emitting
C#
public bool Emitting { get; set; }

If true, the trail will generate new points from its head. Note: Only one active trail is supported. Setting this property to true will cause the existing trail mesh to be cleared.

LifetimeProperty
# Lifetime
C#
public float Lifetime { get; set; }

The lifetime of the trail when Trail3D.LimitMode is Trail3D.LimitModeEnum.Lifetime.

LimitModeProperty
# LimitMode
C#
public Trail3D.LimitModeEnum LimitMode { get; set; }

Whether to limit the trail by lifetime or length.

MaterialProperty
# Material
C#
public ShaderMaterial Material { get; set; }

The material to assign to the trail mesh when Trail3D.MaterialMode is Line3D.MaterialModeEnum.Custom. Tip: To preserve billboarding, use the following shader as a base:

Shader
shader_type spatial;
render_mode blend_mix, depth_draw_never, unshaded, skip_vertex_transform, cull_disabled;

void vertex() {
    // Billboarding code for trails
    // CUSTOM0 contains the tangent of the trail and the width.
    if (dot(CUSTOM0.xyz, CUSTOM0.xyz) > 0.0) {
        vec3 p = (inverse(MODELVIEW_MATRIX) * vec4(0.0, 0.0, 0.0, 1.0)).xyz;
        p = VERTEX - p;
        vec3 t = CUSTOM0.xyz;
        vec3 binormal = normalize(cross(p, t));
        vec3 normal = normalize(cross(t, binormal));
        vec3 tangent = normalize(cross(binormal, normal));
        VERTEX += CUSTOM0.w * binormal;
        NORMAL = normal;
        TANGENT = tangent;
        BINORMAL = binormal;
    }
}

void fragment() {
    ALBEDO = COLOR.rgb;
    ALPHA = COLOR.a;
}
MaterialModeProperty
# MaterialMode
C#
public Line3D.MaterialModeEnum MaterialMode { get; set; }

The material mode for the trail.

MaxLengthProperty
# MaxLength
C#
public float MaxLength { get; set; }

The maximum length of the trail when Trail3D.LimitMode is Trail3D.LimitModeEnum.MaxLength.

MeshAlignmentProperty
# MeshAlignment
C#
public Line3D.MeshAlignmentEnum MeshAlignment { get; set; }

Alignment of the trail. Possible options are Line3D.MeshAlignmentEnum.Local for a 3D line, and Line3D.MeshAlignmentEnum.Billboard for a billboarded line.

MinSectionLengthProperty
# MinSectionLength
C#
public float MinSectionLength { get; set; }

Minimum required distance before adding a new section.

PinUVProperty
# PinUV
C#
public bool PinUV { get; set; }

If true, pins the UVs to their positions in space.

TilingModeProperty
# TilingMode
C#
public Line3D.TilingModeEnum TilingMode { get; set; }

How to tile the UVs across the length of the trail.

TilingMultiplierProperty
# TilingMultiplier
C#
public float TilingMultiplier { get; set; }

UV multiplier across the length of the trail.

WidthProperty
# Width
C#
public float Width { get; set; }

Width of the trail.

WidthCurveProperty
# WidthCurve
C#
public Curve WidthCurve { get; set; }

Width across the length of the trail.

Methods32

Clearvoid
# Clear
C#
public void Clear();

Clears the trail.

GetColorColor
# GetColor
C#
public Color GetColor();
Returns Color
GetColorGradientGradient
# GetColorGradient
C#
public Gradient GetColorGradient();
Returns Gradient
GetCurrentLengthfloat
# GetCurrentLength
C#
public float GetCurrentLength();

Returns the current length of the trail.

Returns float
GetLifetimefloat
# GetLifetime
C#
public float GetLifetime();
Returns float
GetLimitModeTrail3D.LimitModeEnum
# GetLimitMode
C#
public Trail3D.LimitModeEnum GetLimitMode();
Returns Trail3D.LimitModeEnum
GetMaterialShaderMaterial
# GetMaterial
C#
public ShaderMaterial GetMaterial();
Returns ShaderMaterial
GetMaterialModeLine3D.MaterialModeEnum
# GetMaterialMode
C#
public Line3D.MaterialModeEnum GetMaterialMode();
Returns Line3D.MaterialModeEnum
GetMaxLengthfloat
# GetMaxLength
C#
public float GetMaxLength();
Returns float
GetMeshAlignmentLine3D.MeshAlignmentEnum
# GetMeshAlignment
C#
public Line3D.MeshAlignmentEnum GetMeshAlignment();
Returns Line3D.MeshAlignmentEnum
GetMinSectionLengthfloat
# GetMinSectionLength
C#
public float GetMinSectionLength();
Returns float
GetPinUVbool
# GetPinUV
C#
public bool GetPinUV();
Returns bool
GetTilingModeLine3D.TilingModeEnum
# GetTilingMode
C#
public Line3D.TilingModeEnum GetTilingMode();
Returns Line3D.TilingModeEnum
GetTilingMultiplierfloat
# GetTilingMultiplier
C#
public float GetTilingMultiplier();
Returns float
GetWidthfloat
# GetWidth
C#
public float GetWidth();
Returns float
GetWidthCurveCurve
# GetWidthCurve
C#
public Curve GetWidthCurve();
Returns Curve
IsEmittingbool
# IsEmitting
C#
public bool IsEmitting();
Returns bool
SetColorvoid
# SetColor
C#
public void SetColor(Color color);
Parameters
NameTypeDefault
colorColor—
SetColorGradientvoid
# SetColorGradient
C#
public void SetColorGradient(Gradient gradient);
Parameters
NameTypeDefault
gradientGradient—
SetEmittingvoid
# SetEmitting
C#
public void SetEmitting(bool emitting);
Parameters
NameTypeDefault
emittingbool—
SetLifetimevoid
# SetLifetime
C#
public void SetLifetime(float lifetime);
Parameters
NameTypeDefault
lifetimefloat—
SetLimitModevoid
# SetLimitMode
C#
public void SetLimitMode(Trail3D.LimitModeEnum limitMode);
Parameters
NameTypeDefault
limitModeTrail3D.LimitModeEnum—
SetMaterialvoid
# SetMaterial
C#
public void SetMaterial(ShaderMaterial material);
Parameters
NameTypeDefault
materialShaderMaterial—
SetMaterialModevoid
# SetMaterialMode
C#
public void SetMaterialMode(Line3D.MaterialModeEnum materialMode);
Parameters
NameTypeDefault
materialModeLine3D.MaterialModeEnum—
SetMaxLengthvoid
# SetMaxLength
C#
public void SetMaxLength(float maxLength);
Parameters
NameTypeDefault
maxLengthfloat—
SetMeshAlignmentvoid
# SetMeshAlignment
C#
public void SetMeshAlignment(Line3D.MeshAlignmentEnum alignment);
Parameters
NameTypeDefault
alignmentLine3D.MeshAlignmentEnum—
SetMinSectionLengthvoid
# SetMinSectionLength
C#
public void SetMinSectionLength(float minSectionLength);
Parameters
NameTypeDefault
minSectionLengthfloat—
SetPinUVvoid
# SetPinUV
C#
public void SetPinUV(bool pinUV);
Parameters
NameTypeDefault
pinUVbool—
SetTilingModevoid
# SetTilingMode
C#
public void SetTilingMode(Line3D.TilingModeEnum tilingMode);
Parameters
NameTypeDefault
tilingModeLine3D.TilingModeEnum—
SetTilingMultipliervoid
# SetTilingMultiplier
C#
public void SetTilingMultiplier(float tilingMultiplier);
Parameters
NameTypeDefault
tilingMultiplierfloat—
SetWidthvoid
# SetWidth
C#
public void SetWidth(float width);
Parameters
NameTypeDefault
widthfloat—
SetWidthCurvevoid
# SetWidthCurve
C#
public void SetWidthCurve(Curve curve);
Parameters
NameTypeDefault
curveCurve—

Trail3D.LimitModeEnum

ValueDescription
Lifetime = 0

Limit the trail length in time.

Max = 2

Represents the size of the Trail3D.LimitModeEnum enum.

MaxLength = 1

Limit the trail length in size.

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.