:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/RDShaderSource.xml. .. _class_RDShaderSource: RDShaderSource ============== **Inherits:** :ref:`RefCounted` **<** :ref:`Object` Shader source code (used by :ref:`RenderingDevice`). .. rst-class:: classref-introduction-group Description ----------- Shader source code in text form. See also :ref:`RDShaderFile`. **RDShaderSource** is only meant to be used with the :ref:`RenderingDevice` API. It should not be confused with Godot's own :ref:`Shader` resource, which is what Godot's various nodes use for high-level shader programming. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+ | :ref:`ShaderLanguage` | :ref:`language` | ``0`` | +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+ | :ref:`String` | :ref:`source_compute` | ``""`` | +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+ | :ref:`String` | :ref:`source_fragment` | ``""`` | +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+ | :ref:`String` | :ref:`source_tesselation_control` | ``""`` | +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+ | :ref:`String` | :ref:`source_tesselation_evaluation` | ``""`` | +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+ | :ref:`String` | :ref:`source_vertex` | ``""`` | +------------------------------------------------------------+---------------------------------------------------------------------------------------------------+--------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`String` | :ref:`get_stage_source` **(** :ref:`ShaderStage` stage **)** |const| | +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_stage_source` **(** :ref:`ShaderStage` stage, :ref:`String` source **)** | +-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_RDShaderSource_property_language: .. rst-class:: classref-property :ref:`ShaderLanguage` **language** = ``0`` .. rst-class:: classref-property-setget - void **set_language** **(** :ref:`ShaderLanguage` value **)** - :ref:`ShaderLanguage` **get_language** **(** **)** The language the shader is written in. .. rst-class:: classref-item-separator ---- .. _class_RDShaderSource_property_source_compute: .. rst-class:: classref-property :ref:`String` **source_compute** = ``""`` .. rst-class:: classref-property-setget - void **set_stage_source** **(** :ref:`ShaderStage` stage, :ref:`String` source **)** - :ref:`String` **get_stage_source** **(** :ref:`ShaderStage` stage **)** |const| Source code for the shader's compute stage. .. rst-class:: classref-item-separator ---- .. _class_RDShaderSource_property_source_fragment: .. rst-class:: classref-property :ref:`String` **source_fragment** = ``""`` .. rst-class:: classref-property-setget - void **set_stage_source** **(** :ref:`ShaderStage` stage, :ref:`String` source **)** - :ref:`String` **get_stage_source** **(** :ref:`ShaderStage` stage **)** |const| Source code for the shader's fragment stage. .. rst-class:: classref-item-separator ---- .. _class_RDShaderSource_property_source_tesselation_control: .. rst-class:: classref-property :ref:`String` **source_tesselation_control** = ``""`` .. rst-class:: classref-property-setget - void **set_stage_source** **(** :ref:`ShaderStage` stage, :ref:`String` source **)** - :ref:`String` **get_stage_source** **(** :ref:`ShaderStage` stage **)** |const| Source code for the shader's tessellation control stage. .. rst-class:: classref-item-separator ---- .. _class_RDShaderSource_property_source_tesselation_evaluation: .. rst-class:: classref-property :ref:`String` **source_tesselation_evaluation** = ``""`` .. rst-class:: classref-property-setget - void **set_stage_source** **(** :ref:`ShaderStage` stage, :ref:`String` source **)** - :ref:`String` **get_stage_source** **(** :ref:`ShaderStage` stage **)** |const| Source code for the shader's tessellation evaluation stage. .. rst-class:: classref-item-separator ---- .. _class_RDShaderSource_property_source_vertex: .. rst-class:: classref-property :ref:`String` **source_vertex** = ``""`` .. rst-class:: classref-property-setget - void **set_stage_source** **(** :ref:`ShaderStage` stage, :ref:`String` source **)** - :ref:`String` **get_stage_source** **(** :ref:`ShaderStage` stage **)** |const| Source code for the shader's vertex stage. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_RDShaderSource_method_get_stage_source: .. rst-class:: classref-method :ref:`String` **get_stage_source** **(** :ref:`ShaderStage` stage **)** |const| Returns source code for the specified shader ``stage``. Equivalent to getting one of :ref:`source_compute`, :ref:`source_fragment`, :ref:`source_tesselation_control`, :ref:`source_tesselation_evaluation` or :ref:`source_vertex`. .. rst-class:: classref-item-separator ---- .. _class_RDShaderSource_method_set_stage_source: .. rst-class:: classref-method void **set_stage_source** **(** :ref:`ShaderStage` stage, :ref:`String` source **)** Sets ``source`` code for the specified shader ``stage``. Equivalent to setting one of :ref:`source_compute`, :ref:`source_fragment`, :ref:`source_tesselation_control`, :ref:`source_tesselation_evaluation` or :ref:`source_vertex`. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)` .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)` .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`