RDShaderSource¶
继承: RefCounted < Object
着色器源代码(由RenderingDevice使用)。
描述¶
文本形式的着色器源代码。
另请参阅RDShaderFile。RDShaderSource仅适用于RenderingDeviceAPI。它不应该与i3D自己的Shader资源混淆,i3D的各种节点都使用它来进行高级着色器编程。
属性¶
方法¶
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之一。
注意:如果您直接使用此方法设置计算着色器源代码,请记住删除i3D特定的提示#[compute]。