Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

RDShaderSource

繼承: RefCounted < Object

著色器原始程式碼(由 RenderingDevice 使用)。

說明

文字形式的著色器原始程式碼。

另見 RDShaderFileRDShaderSource 應該僅用於 RenderingDevice API。不應將其與 Godot 自己的 Shader 資源,Godot 的各種節點會使用後者來進行高階著色器程式設計。

屬性

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

""

方法

String

get_stage_source(stage: ShaderStage) const

void

set_stage_source(stage: ShaderStage, source: String)


屬性說明

ShaderLanguage language = 0 🔗

著色器的編寫語言。


String source_any_hit = "" 🔗

Source code for the shader's any hit stage.


String source_closest_hit = "" 🔗

Source code for the shader's closest hit stage.


String source_compute = "" 🔗

著色器計算階段的原始程式碼。


String source_fragment = "" 🔗

著色器片段階段的原始程式碼。


String source_intersection = "" 🔗

Source code for the shader's intersection stage.


String source_miss = "" 🔗

Source code for the shader's miss stage.


String source_raygen = "" 🔗

Source code for the shader's ray generation stage.


String source_tesselation_control = "" 🔗

著色器曲面細分控制階段的原始程式碼。


String source_tesselation_evaluation = "" 🔗

著色器曲面細分求值階段的原始程式碼。


String source_vertex = "" 🔗

著色器頂點階段的原始程式碼。


方法說明

String get_stage_source(stage: ShaderStage) const 🔗

返回指定著色器階段 stage 的原始程式碼。等價於獲取 source_computesource_fragmentsource_tesselation_controlsource_tesselation_evaluationsource_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 Godot-specific hint #[compute].