Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

RDShaderSource

继承: RefCounted < Object

着色器源代码(由 RenderingDevice 使用)。

描述

文本形式的着色器源代码。

另见 RDShaderFileRDShaderSource 应该仅用于 RenderingDevice API。不应将其与 Godot 自己的 Shader 资源,Godot 的各种节点会使用后者来进行高阶着色器编程。

属性

ShaderLanguage

language

0

String

source_compute

""

String

source_fragment

""

String

source_tesselation_control

""

String

source_tesselation_evaluation

""

String

source_vertex

""

方法

String

get_stage_source ( ShaderStage stage ) const

void

set_stage_source ( ShaderStage stage, String source )


属性说明

ShaderLanguage language = 0

着色器的编写语言。


String source_compute = ""

着色器计算阶段的源代码。


String source_fragment = ""

着色器片段阶段的源代码。


String source_tesselation_control = ""

着色器曲面细分控制阶段的源代码。


String source_tesselation_evaluation = ""

着色器曲面细分求值阶段的源代码。


String source_vertex = ""

着色器顶点阶段的源代码。


方法说明

String get_stage_source ( ShaderStage stage ) const

返回指定着色器阶段 stage 的源代码。等价于获取 source_computesource_fragmentsource_tesselation_controlsource_tesselation_evaluationsource_vertex


void set_stage_source ( ShaderStage stage, String source )

设置指定着色器阶段 stage 的源代码 source。等价于设置 source_computesource_fragmentsource_tesselation_controlsource_tesselation_evaluationsource_vertex