reckfellENGINE

Shader

Shader program and shared-settings resource.

On this page
class ShaderReckfellSharpInherits Resource

For a text Shader, Code stores source text and shader_type determines its mode/stages. GetMode is not compilation validation. Materials can share the Shader; default textures are shared while individual values belong to ShaderMaterial.

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

Constructors1

ShaderConstructor
# Shader
C#
public Shader();

Creates an empty text Shader defaulting to Spatial mode. Assign Code containing shader_type before use. GetMode on an empty resource does not prove a working shader exists.

Properties1

CodeProperty
# Code
C#
public string Code { get; set; }

Shader-resource source text in Reckfell shading language. Declares shader_type and stage functions; it is neither C# nor a complete OpenGL/Vulkan shader file. Reading the string or GetMode does not establish successful compilation: inspect diagnostics and actual output.

Methods9

GetCodestring
# GetCode
C#
public string GetCode();

Returns the original shader text with preprocessor directives. This is not expanded backend source or GPU bytecode.

Returns string

Original source text assigned to the Shader resource.

GetDefaultTextureParameterTexture
# GetDefaultTextureParameter
C#
public Texture GetDefaultTextureParameter(StringName name, int index = 0);

Reads the default texture assigned on Shader for a name and index. It is neither a particular ShaderMaterial value nor the built-in hint_default_white fallback texture. It does not prove that the current code declares the uniform.

Parameters
NameTypeDefault
nameStringName—
indexint0
name

Sampler uniform name without the shader_parameter/ prefix.

index

Sampler-array element index; normally 0 for a single sampler.

Returns Texture

Assigned Texture, or null when the name/index has no entry.

GetModeShader.Mode
# GetMode
C#
public Shader.Mode GetMode();

Returns the shader-resource mode, such as Spatial for 3D, CanvasItem for 2D or Fog for volumetric fog. Mode follows shader_type after preprocessing; the result alone does not validate error-free code.

Returns Shader.Mode

A Shader.Mode value. Terrain.reckfellshader with shader_type spatial is verified as Spatial.

GetShaderUniformListReckfell.Collections.Array
# GetShaderUniformList
C#
public Reckfell.Collections.Array GetShaderUniformList(bool getGroups = false);

Returns regular material-uniform metadata for checking names and types. The current rendering path excludes instance/global uniforms from this list; it does not read current material values.

Parameters
NameTypeDefault
getGroupsboolfalse
getGroups

If true, includes group/subgroup records. Defaults to false, which skips them. Do not treat a group record as a regular uniform.

Returns Reckfell.Collections.Array

Array of Dictionary records containing PropertyInfo metadata, including name and type. The example reads names with entry.AsReckfellDictionary()["name"].AsString(). Read uniform values separately.

InspectNativeShaderCodevoid
# InspectNativeShaderCode
C#
public void InspectNativeShaderCode();

Requests driver-code inspection through a deferred editor-viewer call when available. It returns no string and is distinct from GetCode, which contains resource text rather than native code. Do not expect a viewer window in an ordinary game run without that viewer.

SetCodevoid
# SetCode
C#
public void SetCode(string code);

Replaces source and processes directives and include dependencies. For relative paths on a resource without ResourcePath, set SetIncludePath first; source changes affect materials sharing this Shader.

Parameters
NameTypeDefault
codestring—
code

Complete engine shading-language source with a suitable shader_type, not arbitrary raw GLSL compute source.

SetDefaultTextureParameter2 overloads
# SetDefaultTextureParameter · 1/2
C#
public void SetDefaultTextureParameter(StringName name, Texture texture, int index = 0);

Assigns a shared default texture on Shader. Materials without their own value use it. null removes this index entry, not material overrides. Current GetShaderUniformList hides a uniform while any such assignment exists. Use the Texture overload for the general texture type.

Parameters
NameTypeDefault
nameStringName—
textureTexture—
indexint0
name

Exact sampler uniform name, such as source_texture.

texture

Appropriate texture, or null to clear. This configures Shader, not one material.

index

Existing sampler-array element; 0 for an ordinary sampler.

# SetDefaultTextureParameter · 2/2
C#
public void SetDefaultTextureParameter(StringName name, Texture2D texture, int index);

Texture2D-typed default assignment forwarding to the same implementation. Materials without their own value use it. null removes this index entry, not material overrides. Current GetShaderUniformList hides a uniform while any such assignment exists. Use the Texture overload for the general texture type.

Parameters
NameTypeDefault
nameStringName—
textureTexture2D—
indexint—
name

Exact sampler uniform name, such as source_texture.

texture

Appropriate texture, or null to clear. This configures Shader, not one material.

index

Existing sampler-array element; 0 for an ordinary sampler.

SetIncludePathvoid
# SetIncludePath
C#
public void SetIncludePath(string path);

Sets the fallback base filename for relative includes when Shader has no ResourcePath. Supply a full file path before SetCode; this call alone does not reprocess the source.

Parameters
NameTypeDefault
pathstring—
path

Full base shader filename, such as asset://effects/Main.reckfellshader, not only a directory.

Shader.Mode

ValueDescription
CanvasItem = 1

Mode used to draw all 2D objects.

Fog = 4

Mode used for setting the color and density of volumetric fog effect.

Particles = 2

Mode used to calculate particle information on a per-particle basis. Not used for drawing.

Sky = 3

Mode used for drawing skies. Only works with shaders attached to Sky objects.

Spatial = 0

Mode used to draw all 3D objects.

TextureBlit = 5

Mode used for drawing to DrawableTexture resources via blit calls.

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.