reckfellENGINE

SpriteBase3D

2D sprite node in 3D environment.

On this page
class SpriteBase3DReckfellSharpInherits GeometryInstance3D

2D sprite node in 3D environment.

A node that displays 2D texture information in a 3D environment. See also Sprite3D where many other properties are defined.

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

Properties20

AlphaAntialiasingEdgeProperty
# AlphaAntialiasingEdge
C#
public float AlphaAntialiasingEdge { get; set; }

Threshold at which antialiasing will be applied on the alpha channel.

AlphaAntialiasingModeProperty
# AlphaAntialiasingMode
C#
public BaseMaterial3D.AlphaAntiAliasing AlphaAntialiasingMode { get; set; }

The type of alpha antialiasing to apply.

AlphaCutProperty
# AlphaCut
C#
public SpriteBase3D.AlphaCutMode AlphaCut { get; set; }

The alpha cutting mode to use for the sprite.

AlphaHashScaleProperty
# AlphaHashScale
C#
public float AlphaHashScale { get; set; }

The hashing scale for Alpha Hash. Recommended values between 0 and 2.

AlphaScissorThresholdProperty
# AlphaScissorThreshold
C#
public float AlphaScissorThreshold { get; set; }

Threshold at which the alpha scissor will discard values.

AxisProperty
# Axis
C#
public Vector3.Axis Axis { get; set; }

The direction in which the front of the texture faces.

BillboardProperty
# Billboard
C#
public BaseMaterial3D.BillboardModeEnum Billboard { get; set; }

Selects the sprite billboard mode. When billboard geometry also casts shadows, camera-facing orientation affects the shadow pass. With multiple cameras, check which camera orientation is used before relying on the shadow shape.

CenteredProperty
# Centered
C#
public bool Centered { get; set; }

If true, texture will be centered.

DoubleSidedProperty
# DoubleSided
C#
public bool DoubleSided { get; set; }

If true, texture can be seen from the back as well, if false, it is invisible when looking at it from behind.

FixedSizeProperty
# FixedSize
C#
public bool FixedSize { get; set; }

If true, the texture is rendered at the same size regardless of distance. The texture's size on screen is the same as if the camera was 1.0 units away from the texture's origin, regardless of the actual distance from the camera. The Camera3D's field of view (or Camera3D.Size when in orthogonal/frustum mode) still affects the size the sprite is drawn at.

FlipHProperty
# FlipH
C#
public bool FlipH { get; set; }

If true, texture is flipped horizontally.

FlipVProperty
# FlipV
C#
public bool FlipV { get; set; }

If true, texture is flipped vertically.

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

A color value used to multiply the texture's colors. Can be used for mood-coloring or to simulate the color of ambient light. Note: Unlike CanvasItem.Modulate for 2D, colors with values above 1.0 (overbright) are not supported. Note: If a GeometryInstance3D.MaterialOverride is defined on the SpriteBase3D, the material override must be configured to take vertex colors into account for albedo. Otherwise, the color defined in SpriteBase3D.Modulate will be ignored. For a BaseMaterial3D, BaseMaterial3D.VertexColorUseAsAlbedo must be true. For a ShaderMaterial, ALBEDO *= COLOR.rgb; must be inserted in the shader's fragment() function.

NoDepthTestProperty
# NoDepthTest
C#
public bool NoDepthTest { get; set; }

If true, depth testing is disabled and the object will be drawn in render order.

OffsetProperty
# Offset
C#
public Vector2 Offset { get; set; }

The texture's drawing offset. Note: When you increase SpriteBase3D.Offset.y in Sprite3D, the sprite moves upward in world space (i.e., +Y is up).

PixelSizeProperty
# PixelSize
C#
public float PixelSize { get; set; }

The size of one pixel's width on the sprite to scale it in 3D.

RenderPriorityProperty
# RenderPriority
C#
public int RenderPriority { get; set; }

Sets the render priority for the sprite. Higher priority objects will be sorted in front of lower priority objects. Note: This only applies if SpriteBase3D.AlphaCut is set to SpriteBase3D.AlphaCutMode.Disabled (default value). Note: This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).

ShadedProperty
# Shaded
C#
public bool Shaded { get; set; }

If true, the Light3D in the Environment has effects on the sprite.

TextureFilterProperty
# TextureFilter
C#
public BaseMaterial3D.TextureFilterEnum TextureFilter { get; set; }

Filter flags for the texture. Note: Linear filtering may cause artifacts around the edges, which are especially noticeable on opaque textures. To prevent this, use textures with transparent or identical colors around the edges.

TransparentProperty
# Transparent
C#
public bool Transparent { get; set; }

If true, the texture's transparency and the opacity are used to make those parts of the sprite invisible.

Methods34

GenerateTriangleMeshTriangleMesh
# GenerateTriangleMesh
C#
public TriangleMesh GenerateTriangleMesh();

Returns a TriangleMesh with the sprite's vertices following its current configuration (such as its SpriteBase3D.Axis and SpriteBase3D.PixelSize).

Returns TriangleMesh
GetAlphaAntialiasingBaseMaterial3D.AlphaAntiAliasing
# GetAlphaAntialiasing
C#
public BaseMaterial3D.AlphaAntiAliasing GetAlphaAntialiasing();
Returns BaseMaterial3D.AlphaAntiAliasing
GetAlphaAntialiasingEdgefloat
# GetAlphaAntialiasingEdge
C#
public float GetAlphaAntialiasingEdge();
Returns float
GetAlphaCutModeSpriteBase3D.AlphaCutMode
# GetAlphaCutMode
C#
public SpriteBase3D.AlphaCutMode GetAlphaCutMode();
Returns SpriteBase3D.AlphaCutMode
GetAlphaHashScalefloat
# GetAlphaHashScale
C#
public float GetAlphaHashScale();
Returns float
GetAlphaScissorThresholdfloat
# GetAlphaScissorThreshold
C#
public float GetAlphaScissorThreshold();
Returns float
GetAxisVector3.Axis
# GetAxis
C#
public Vector3.Axis GetAxis();
Returns Vector3.Axis
GetBillboardModeBaseMaterial3D.BillboardModeEnum
# GetBillboardMode
C#
public BaseMaterial3D.BillboardModeEnum GetBillboardMode();
Returns BaseMaterial3D.BillboardModeEnum
GetDrawFlagbool
# GetDrawFlag
C#
public bool GetDrawFlag(SpriteBase3D.DrawFlags flag);

Returns the value of the specified flag.

Parameters
NameTypeDefault
flagSpriteBase3D.DrawFlags—
Returns bool
GetItemRectRect2
# GetItemRect
C#
public Rect2 GetItemRect();

Returns the rectangle representing this sprite.

Returns Rect2
GetModulateColor
# GetModulate
C#
public Color GetModulate();
Returns Color
GetOffsetVector2
# GetOffset
C#
public Vector2 GetOffset();
Returns Vector2
GetPixelSizefloat
# GetPixelSize
C#
public float GetPixelSize();
Returns float
GetRenderPriorityint
# GetRenderPriority
C#
public int GetRenderPriority();
Returns int
GetTextureFilterBaseMaterial3D.TextureFilterEnum
# GetTextureFilter
C#
public BaseMaterial3D.TextureFilterEnum GetTextureFilter();
Returns BaseMaterial3D.TextureFilterEnum
IsCenteredbool
# IsCentered
C#
public bool IsCentered();
Returns bool
IsFlippedHbool
# IsFlippedH
C#
public bool IsFlippedH();
Returns bool
IsFlippedVbool
# IsFlippedV
C#
public bool IsFlippedV();
Returns bool
SetAlphaAntialiasingvoid
# SetAlphaAntialiasing
C#
public void SetAlphaAntialiasing(BaseMaterial3D.AlphaAntiAliasing alphaAA);
Parameters
NameTypeDefault
alphaAABaseMaterial3D.AlphaAntiAliasing—
SetAlphaAntialiasingEdgevoid
# SetAlphaAntialiasingEdge
C#
public void SetAlphaAntialiasingEdge(float edge);
Parameters
NameTypeDefault
edgefloat—
SetAlphaCutModevoid
# SetAlphaCutMode
C#
public void SetAlphaCutMode(SpriteBase3D.AlphaCutMode mode);
Parameters
NameTypeDefault
modeSpriteBase3D.AlphaCutMode—
SetAlphaHashScalevoid
# SetAlphaHashScale
C#
public void SetAlphaHashScale(float threshold);
Parameters
NameTypeDefault
thresholdfloat—
SetAlphaScissorThresholdvoid
# SetAlphaScissorThreshold
C#
public void SetAlphaScissorThreshold(float threshold);
Parameters
NameTypeDefault
thresholdfloat—
SetAxisvoid
# SetAxis
C#
public void SetAxis(Vector3.Axis axis);
Parameters
NameTypeDefault
axisVector3.Axis—
SetBillboardModevoid
# SetBillboardMode
C#
public void SetBillboardMode(BaseMaterial3D.BillboardModeEnum mode);
Parameters
NameTypeDefault
modeBaseMaterial3D.BillboardModeEnum—
SetCenteredvoid
# SetCentered
C#
public void SetCentered(bool centered);
Parameters
NameTypeDefault
centeredbool—
SetDrawFlagvoid
# SetDrawFlag
C#
public void SetDrawFlag(SpriteBase3D.DrawFlags flag, bool enabled);

If true, the specified flag will be enabled.

Parameters
NameTypeDefault
flagSpriteBase3D.DrawFlags—
enabledbool—
SetFlipHvoid
# SetFlipH
C#
public void SetFlipH(bool flipH);
Parameters
NameTypeDefault
flipHbool—
SetFlipVvoid
# SetFlipV
C#
public void SetFlipV(bool flipV);
Parameters
NameTypeDefault
flipVbool—
SetModulatevoid
# SetModulate
C#
public void SetModulate(Color modulate);
Parameters
NameTypeDefault
modulateColor—
SetOffsetvoid
# SetOffset
C#
public void SetOffset(Vector2 offset);
Parameters
NameTypeDefault
offsetVector2—
SetPixelSizevoid
# SetPixelSize
C#
public void SetPixelSize(float pixelSize);
Parameters
NameTypeDefault
pixelSizefloat—
SetRenderPriorityvoid
# SetRenderPriority
C#
public void SetRenderPriority(int priority);
Parameters
NameTypeDefault
priorityint—
SetTextureFiltervoid
# SetTextureFilter
C#
public void SetTextureFilter(BaseMaterial3D.TextureFilterEnum mode);
Parameters
NameTypeDefault
modeBaseMaterial3D.TextureFilterEnum—

SpriteBase3D.AlphaCutMode

ValueDescription
Disabled = 0

This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping.

Discard = 1

This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa). On the bright side, this mode doesn't suffer from transparency sorting issues when multiple transparent materials are overlapping. This mode is also known as alpha testing or 1-bit transparency.

Hash = 3

This mode draws cuts off all values below a spatially-deterministic threshold, the rest will remain opaque.

OpaquePrepass = 2

This mode draws fully opaque pixels in the depth prepass. This is slower than SpriteBase3D.AlphaCutMode.Disabled or SpriteBase3D.AlphaCutMode.Discard, but it allows displaying translucent areas and smooth edges while using proper sorting.

SpriteBase3D.DrawFlags

ValueDescription
DisableDepthTest = 3

Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it.

DoubleSided = 2

If set, texture can be seen from the back as well. If not, the texture is invisible when looking at it from behind.

FixedSize = 4

Label is scaled by depth so that it always appears the same size on screen.

Max = 5

Represents the size of the SpriteBase3D.DrawFlags enum.

Shaded = 1

If set, lights in the environment affect the sprite.

Transparent = 0

If set, the texture's transparency and the opacity are used to make those parts of the sprite invisible.

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.