Table of Contents

Class RDShaderSource

Shader source code (used by RenderingDevice).

Inheritance
RDShaderSource

Remarks

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 Godot's own Shader resource, which is what Godot's various nodes use for high-level shader programming.

Properties

language

The language the shader is written in.

var language : int = 0

Property Value

int

Remarks

  • void set_language(int value)
  • int get_language

source_compute

Source code for the shader's compute stage.

var source_compute : String = ""

Property Value

String

Remarks

source_fragment

Source code for the shader's fragment stage.

var source_fragment : String = ""

Property Value

String

Remarks

source_tesselation_control

Source code for the shader's tessellation control stage.

var source_tesselation_control : String = ""

Property Value

String

Remarks

source_tesselation_evaluation

Source code for the shader's tessellation evaluation stage.

var source_tesselation_evaluation : String = ""

Property Value

String

Remarks

source_vertex

Source code for the shader's vertex stage.

var source_vertex : String = ""

Property Value

String

Remarks

Methods

get_stage_source(int)

Qualifiers: 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.

String get_stage_source(int stage)

Parameters

stage int

set_stage_source(int, 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].

void set_stage_source(int stage, String source)

Parameters

stage int
source String