Attention: Here be dragons (unstable version)
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Redot.
Checking the stable version of the documentation...
RDShaderSource
Inherits: RefCounted < Object
Shader source code (used by RenderingDevice).
Description
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 Redot's own Shader resource, which is what Redot's various nodes use for high-level shader programming.
Properties
|
||
|
||
|
||
|
||
|
||
|
Methods
get_stage_source(stage: ShaderStage) const |
|
void |
set_stage_source(stage: ShaderStage, source: String) |
Property Descriptions
ShaderLanguage language = 0
🔗
void set_language(value: ShaderLanguage)
ShaderLanguage get_language()
The language the shader is written in.
void set_stage_source(stage: ShaderStage, source: String)
String get_stage_source(stage: ShaderStage) const
Source code for the shader's compute stage.
void set_stage_source(stage: ShaderStage, source: String)
String get_stage_source(stage: ShaderStage) const
Source code for the shader's fragment stage.
String source_tesselation_control = ""
🔗
void set_stage_source(stage: ShaderStage, source: String)
String get_stage_source(stage: ShaderStage) const
Source code for the shader's tessellation control stage.
String source_tesselation_evaluation = ""
🔗
void set_stage_source(stage: ShaderStage, source: String)
String get_stage_source(stage: ShaderStage) const
Source code for the shader's tessellation evaluation stage.
void set_stage_source(stage: ShaderStage, source: String)
String get_stage_source(stage: ShaderStage) const
Source code for the shader's vertex stage.
Method Descriptions
String get_stage_source(stage: 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.
void set_stage_source(stage: 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 Redot-specific hint #[compute]
.