Skip to content

RDShaderSource

Inherits: RefCounted < Object

Shader source code (used by RenderingDevice).

Shader source code in text form.

See also RDShaderFile. RDShaderSource is only meant to be used with the RenderingDevice API. It should not be confused with Orblit’s own Shader resource, which is what Orblit’s various nodes use for high-level shader programming.

Type Name Default
RenderingDevice.ShaderLanguage language 0
String source_any_hit ""
String source_closest_hit ""
String source_compute ""
String source_fragment ""
String source_intersection ""
String source_miss ""
String source_raygen ""
String source_tesselation_control ""
String source_tesselation_evaluation ""
String source_vertex ""
Returns Method
String get_stage_source(stage: RenderingDevice.ShaderStage) const
void set_stage_source(stage: RenderingDevice.ShaderStage, source: String)

language

RenderingDevice.ShaderLanguage language = 0

The language the shader is written in.

source_any_hit

String source_any_hit = ""

Source code for the shader’s any hit stage.

source_closest_hit

String source_closest_hit = ""

Source code for the shader’s closest hit stage.

source_compute

String source_compute = ""

Source code for the shader’s compute stage.

source_fragment

String source_fragment = ""

Source code for the shader’s fragment stage.

source_intersection

String source_intersection = ""

Source code for the shader’s intersection stage.

source_miss

String source_miss = ""

Source code for the shader’s miss stage.

source_raygen

String source_raygen = ""

Source code for the shader’s ray generation stage.

source_tesselation_control

String source_tesselation_control = ""

Source code for the shader’s tessellation control stage.

source_tesselation_evaluation

String source_tesselation_evaluation = ""

Source code for the shader’s tessellation evaluation stage.

source_vertex

String source_vertex = ""

Source code for the shader’s vertex stage.

get_stage_source

String get_stage_source(stage: RenderingDevice.ShaderStage) const

Returns source code for the specified shader stage. Equivalent to getting one of source_compute, source_fragment, source_tesselation_control, source_tesselation_evaluation or source_vertex.

set_stage_source

void set_stage_source(stage: RenderingDevice.ShaderStage, source: String)

Sets source code for the specified shader stage. Equivalent to setting one of source_compute, source_fragment, source_tesselation_control, source_tesselation_evaluation or source_vertex.

Note: If you set the compute shader source code using this method directly, remember to remove the Orblit-specific hint #[compute].