RDShaderSource
继承: RefCounted < Object
着色器源代码(由 RenderingDevice 使用)。
描述
文本形式的着色器源代码。
另见 RDShaderFile。RDShaderSource 应该仅用于 RenderingDevice API。不应将其与 Godot 自己的 Shader 资源,Godot 的各种节点会使用后者来进行高阶着色器编程。
属性
|
||
|
||
|
||
|
||
|
||
|
方法
get_stage_source(stage: ShaderStage) const |
|
void |
set_stage_source(stage: ShaderStage, source: String) |
属性说明
ShaderLanguage language = 0 🔗
void set_language(value: ShaderLanguage)
ShaderLanguage get_language()
着色器的编写语言。
void set_stage_source(stage: ShaderStage, source: String)
String get_stage_source(stage: ShaderStage) const
着色器计算阶段的源代码。
void set_stage_source(stage: ShaderStage, source: String)
String get_stage_source(stage: ShaderStage) const
着色器片段阶段的源代码。
String source_tesselation_control = "" 🔗
void set_stage_source(stage: ShaderStage, source: String)
String get_stage_source(stage: ShaderStage) const
着色器曲面细分控制阶段的源代码。
String source_tesselation_evaluation = "" 🔗
void set_stage_source(stage: ShaderStage, source: String)
String get_stage_source(stage: ShaderStage) const
着色器曲面细分求值阶段的源代码。
void set_stage_source(stage: ShaderStage, source: String)
String get_stage_source(stage: ShaderStage) const
着色器顶点阶段的源代码。
方法说明
String get_stage_source(stage: ShaderStage) const 🔗
返回着色器阶段 stage 的源代码。等价于获取 source_compute、source_fragment、source_tesselation_control、source_tesselation_evaluation 或 source_vertex。
void set_stage_source(stage: ShaderStage, source: String) 🔗
设置着色器阶段 stage 的源代码 source。等价于设置 source_compute、source_fragment、source_tesselation_control、source_tesselation_evaluation 或 source_vertex。
注意:如果直接使用该方法设置计算着色器的源代码,请记得移除 Godot 专有的 #[compute] 提示。