reckfellENGINE

RDShaderSource

Individual shader-stage source code for RenderingDevice.

On this page
class RDShaderSourceReckfellSharpInherits RefCounted

RDShaderSource holds source strings and the selected language. For compute, set SourceCompute and explicitly call ShaderCompileSpirVFromSource; the string is not a compiled GPU resource. GLSL is the default language.

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

Constructors1

RDShaderSourceConstructor
# RDShaderSource
C#
public RDShaderSource();

Creates an object with all ten stage strings empty and Language=Glsl. Runs no compiler and creates no GPU shader. Set the required stage source before compiling; empty stages are skipped.

Properties11

LanguageProperty
# Language
C#
public RenderingDevice.ShaderLanguage Language { get; set; }

Source-string language, initially ShaderLanguage.Glsl. The setter neither translates nor compiles text. Current ShaderCompileSpirVFromSource implements GLSL when glslang is built; the Hlsl enum does not establish HLSL compiler support through this path.

SourceAnyHitProperty
# SourceAnyHit
C#
public string SourceAnyHit { get; set; }

Source for any-hit: intersection-candidate processing, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.AnyHit). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.

SourceClosestHitProperty
# SourceClosestHit
C#
public string SourceClosestHit { get; set; }

Source for closest-hit: closest-intersection processing, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.ClosestHit). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.

SourceComputeProperty
# SourceCompute
C#
public string SourceCompute { get; set; }

Compute-stage source code. For GLSL provide #version and kernel code without the #[compute] import marker; assigning the string does not compile the shader.

SourceFragmentProperty
# SourceFragment
C#
public string SourceFragment { get; set; }

Source for fragment: fragment output, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.Fragment). One stage, not a file containing all sections. Call ShaderCompileSpirVFromSource separately; the setter creates no GPU shader.

SourceIntersectionProperty
# SourceIntersection
C#
public string SourceIntersection { get; set; }

Source for intersection: custom procedural-geometry intersection, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.Intersection). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.

SourceMissProperty
# SourceMiss
C#
public string SourceMiss { get; set; }

Source for miss: processing a ray without a hit, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.Miss). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.

SourceRaygenProperty
# SourceRaygen
C#
public string SourceRaygen { get; set; }

Source for ray generation: launching rays, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.Raygen). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.

SourceTesselationControlProperty
# SourceTesselationControl
C#
public string SourceTesselationControl { get; set; }

Source for tessellation control: patch control, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.TesselationControl). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.

SourceTesselationEvaluationProperty
# SourceTesselationEvaluation
C#
public string SourceTesselationEvaluation { get; set; }

Source for tessellation evaluation: evaluating a tessellated patch, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.TesselationEvaluation). One stage, not a file containing all sections. String storage was checked, not tessellation/ray compilation or execution.

SourceVertexProperty
# SourceVertex
C#
public string SourceVertex { get; set; }

Source for vertex: vertex processing, initially empty. Getter/setter use the same slot as GetStageSource/SetStageSource(ShaderStage.Vertex). One stage, not a file containing all sections. Call ShaderCompileSpirVFromSource separately; the setter creates no GPU shader.

Methods4

GetLanguageRenderingDevice.ShaderLanguage
# GetLanguage
C#
public RenderingDevice.ShaderLanguage GetLanguage();

Returns stored Language, initially Glsl. Checks no compiler backend and establishes no match between the text and selected language.

Returns RenderingDevice.ShaderLanguage

Stored ShaderLanguage, initially Glsl; not a language-support check.

GetStageSourcestring
# GetStageSource
C#
public string GetStageSource(RenderingDevice.ShaderStage stage);

Returns one stage’s stored text, initially empty. Equivalent to the corresponding Source-property getter; reads no file and returns no generated SPIR-V. Use a ShaderStage index, not a …Bit value.

Parameters
NameTypeDefault
stageRenderingDevice.ShaderStage—
stage

Stage index, such as ShaderStage.Compute or ShaderStage.Vertex. Do not pass ComputeBit/VertexBit, a mask or Max: these are not the requested stage index and can select another stage or emit a native error.

Returns string

Stored selected-stage string; empty when no source is set.

SetLanguagevoid
# SetLanguage
C#
public void SetLanguage(RenderingDevice.ShaderLanguage language);

Source-string language, initially ShaderLanguage.Glsl. The setter neither translates nor compiles text. Current ShaderCompileSpirVFromSource implements GLSL when glslang is built; the Hlsl enum does not establish HLSL compiler support through this path.

Parameters
NameTypeDefault
languageRenderingDevice.ShaderLanguage—
language

Source-string language, initially ShaderLanguage.Glsl. The setter neither translates nor compiles text. Current ShaderCompileSpirVFromSource implements GLSL when glslang is built; the Hlsl enum does not establish HLSL compiler support through this path.

SetStageSourcevoid
# SetStageSource
C#
public void SetStageSource(RenderingDevice.ShaderStage stage, string source);

Replaces one stage’s text without compiling or changing other stages. Supply actual stage code, such as GLSL with #version, without a #[compute] file-section marker or shader_type spatial. …Bit values are not stage indices for this method. Source edits change no earlier RDShaderSpirV or GPU shader.

Parameters
NameTypeDefault
stageRenderingDevice.ShaderStage—
sourcestring—
stage

Stage index, such as ShaderStage.Compute or ShaderStage.Vertex. Do not pass ComputeBit/VertexBit, a mask or Max: these are not the requested stage index and can select another stage or emit a native error.

source

Full source for one stage in the selected Language, without a #[compute] file-section marker. Not a path or high-level spatial Shader source.

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.