reckfellENGINE

CanvasTexture

Diffuse, normal and specular texture set for 2D lighting.

On this page
class CanvasTextureReckfellSharpInherits Texture2D

CanvasTexture groups DiffuseTexture, NormalTexture and SpecularTexture references for CanvasItem. Assign it to Sprite2D or another suitable 2D consumer; lighting, material and maps still need consistent setup. Assigning a normal map does not add relief geometry or lighting by itself. This is a 2D resource rather than a 3D material replacement.

Dimensions, GetImage and HasAlpha depend only on DiffuseTexture. GetImage does not combine normals and specular into a lit frame. NormalTexture and SpecularTexture use aligned UVs; the resource does not automatically pack maps. All three channels accept ordinary Texture2D references or null, but reject CanvasTexture.

TextureFilter and TextureRepeat override resource sampling; ParentNode preserves CanvasItem inheritance. A mipmap mode does not generate the chain. Use 0…1 for ordinary SpecularShininess even if the setter retains other values. SpecularColor.a does not supply shading-parameter alpha: shininess is used instead.

Channel references, parameters, diffuse readback, clearing and independent resource reload were checked in Windows Forward+/Vulkan. Specular-map RGB/alpha roles were established from shader source. Lighting rendering, normal/specular quality, 3D and other operating systems were not established in this run.

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

Constructors1

CanvasTextureConstructor
# CanvasTexture
C#
public CanvasTexture();

Creates a resource with three empty channels, white SpecularColor, SpecularShininess = 1 and inherited filtering/repeat. The resource owns its RID; do not free it manually. Without DiffuseTexture, GetImage returns null.

Properties7

DiffuseTextureProperty
# DiffuseTexture
C#
public Texture2D DiffuseTexture { get; set; }

Main color texture; null by default. Its logical dimensions, HasAlpha and GetImage supply the corresponding CanvasTexture queries. Without it, dimensions are 1×1, GetImage returns null and HasAlpha returns false. Assignment retains a reference rather than a copy. This channel rejects CanvasTexture, including another instance.

NormalTextureProperty
# NormalTexture
C#
public Texture2D NormalTexture { get; set; }

Normal map for 2D lighting; null by default. It does not alter geometry, silhouette or collision and does not define CanvasTexture size. Prepare correct normal orientation and UVs aligned with the color map. Assignment does not automatically enable a light. CanvasTexture is not accepted as a map; null clears the channel.

SpecularColorProperty
# SpecularColor
C#
public Color SpecularColor { get; set; }

Specular RGB multiplier, white by default. The getter retains Color alpha, but canvas shading parameters take alpha from SpecularShininess rather than this color. This does not modulate the entire diffuse texture. Visible output depends on lighting and shader; this run checked parameter storage rather than specular appearance.

SpecularShininessProperty
# SpecularShininess
C#
public float SpecularShininess { get; set; }

Specular sharpness parameter, defaulting to 1; use finite values in 0…1 for ordinary usage. Getter/setter are not clamped to the inspector hint: assigning 2 retains 2. This does not promise correct GPU output outside the range and is not 3D material roughness. SpecularTexture alpha also contributes when a map is present.

SpecularTextureProperty
# SpecularTexture
C#
public Texture2D SpecularTexture { get; set; }

Specular map for 2D lighting; null by default. In the current canvas shader, RGB modulates specular color and alpha modulates shininess, multiplied by SpecularColor.rgb and SpecularShininess. This is not a 3D material metallic/roughness map. This channel rejects CanvasTexture; null clears the reference. Resource dimensions still come from DiffuseTexture.

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

Filtering override for this CanvasTexture; defaults to CanvasItem.TextureFilterEnum.ParentNode, inheriting CanvasItem sampling. An explicit mode overrides the item baseline. Selecting a mipmap mode does not create mipmap chains in source maps. Use a valid enum value.

TextureRepeatProperty
# TextureRepeat
C#
public CanvasItem.TextureRepeatEnum TextureRepeat { get; set; }

Repeat override for this CanvasTexture; defaults to CanvasItem.TextureRepeatEnum.ParentNode. Disabled disables repeating, Enabled repeats and Mirror alternates mirrored repeats. This controls texture sampling; it does not turn AtlasTexture.Region into a separate seamless image. Use a valid enum value.

Methods14

GetDiffuseTextureTexture2D
# GetDiffuseTexture
C#
public Texture2D GetDiffuseTexture();

Returns CanvasTexture.DiffuseTexture.

Returns Texture2D

Current DiffuseTexture value. The texture reference is shared rather than copied; it can be null.

GetNormalTextureTexture2D
# GetNormalTexture
C#
public Texture2D GetNormalTexture();

Returns CanvasTexture.NormalTexture.

Returns Texture2D

Current NormalTexture value. The texture reference is shared rather than copied; it can be null.

GetSpecularColorColor
# GetSpecularColor
C#
public Color GetSpecularColor();

Returns CanvasTexture.SpecularColor.

Returns Color

Current SpecularColor value.

GetSpecularShininessfloat
# GetSpecularShininess
C#
public float GetSpecularShininess();

Returns CanvasTexture.SpecularShininess.

Returns float

Current SpecularShininess value.

GetSpecularTextureTexture2D
# GetSpecularTexture
C#
public Texture2D GetSpecularTexture();

Returns CanvasTexture.SpecularTexture.

Returns Texture2D

Current SpecularTexture value. The texture reference is shared rather than copied; it can be null.

GetTextureFilterCanvasItem.TextureFilterEnum
# GetTextureFilter
C#
public CanvasItem.TextureFilterEnum GetTextureFilter();

Returns CanvasTexture.TextureFilter.

Returns CanvasItem.TextureFilterEnum

Current TextureFilter value.

GetTextureRepeatCanvasItem.TextureRepeatEnum
# GetTextureRepeat
C#
public CanvasItem.TextureRepeatEnum GetTextureRepeat();

Returns CanvasTexture.TextureRepeat.

Returns CanvasItem.TextureRepeatEnum

Current TextureRepeat value.

SetDiffuseTexturevoid
# SetDiffuseTexture
C#
public void SetDiffuseTexture(Texture2D texture);

Sets CanvasTexture.DiffuseTexture.

Parameters
NameTypeDefault
textureTexture2D—
texture

Main color Texture2D or null; CanvasTexture is rejected.

SetNormalTexturevoid
# SetNormalTexture
C#
public void SetNormalTexture(Texture2D texture);

Sets CanvasTexture.NormalTexture.

Parameters
NameTypeDefault
textureTexture2D—
texture

Normal-map Texture2D or null; CanvasTexture is rejected.

SetSpecularColorvoid
# SetSpecularColor
C#
public void SetSpecularColor(Color color);

Sets CanvasTexture.SpecularColor.

Parameters
NameTypeDefault
colorColor—
color

Specular RGB multiplier; shading-parameter alpha comes from SpecularShininess.

SetSpecularShininessvoid
# SetSpecularShininess
C#
public void SetSpecularShininess(float shininess);

Sets CanvasTexture.SpecularShininess.

Parameters
NameTypeDefault
shininessfloat—
shininess

Finite 0…1 value for ordinary usage; the setter is not clamped to the inspector hint.

SetSpecularTexturevoid
# SetSpecularTexture
C#
public void SetSpecularTexture(Texture2D texture);

Sets CanvasTexture.SpecularTexture.

Parameters
NameTypeDefault
textureTexture2D—
texture

Specular-map Texture2D or null; CanvasTexture is rejected.

SetTextureFiltervoid
# SetTextureFilter
C#
public void SetTextureFilter(CanvasItem.TextureFilterEnum filter);

Sets CanvasTexture.TextureFilter.

Parameters
NameTypeDefault
filterCanvasItem.TextureFilterEnum—
filter

Valid filtering mode; ParentNode inherits CanvasItem sampling.

SetTextureRepeatvoid
# SetTextureRepeat
C#
public void SetTextureRepeat(CanvasItem.TextureRepeatEnum repeat);

Sets CanvasTexture.TextureRepeat.

Parameters
NameTypeDefault
repeatCanvasItem.TextureRepeatEnum—
repeat

Valid repeat mode; ParentNode inherits CanvasItem sampling.

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.