:github_url: hide .. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the Shader.xml source instead. .. The source is found in doc/classes or modules//doc_classes. .. _class_Shader: Shader ====== **Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` **Inherited By:** :ref:`VisualShader` **Category:** Core Brief Description ----------------- A custom shader program. Properties ---------- +-----------------------------+-----------------------------------------+ | :ref:`String` | :ref:`code` | +-----------------------------+-----------------------------------------+ Methods ------- +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Texture` | :ref:`get_default_texture_param` **(** :ref:`String` param **)** const | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`Mode` | :ref:`get_mode` **(** **)** const | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`has_param` **(** :ref:`String` name **)** const | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_default_texture_param` **(** :ref:`String` param, :ref:`Texture` texture **)** | +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ Enumerations ------------ .. _enum_Shader_Mode: .. _class_Shader_constant_MODE_SPATIAL: .. _class_Shader_constant_MODE_CANVAS_ITEM: .. _class_Shader_constant_MODE_PARTICLES: enum **Mode**: - **MODE_SPATIAL** = **0** - **MODE_CANVAS_ITEM** = **1** - **MODE_PARTICLES** = **2** Description ----------- This class allows you to define a custom shader program that can be used for various materials to render objects. Tutorials --------- - :doc:`../tutorials/shading/index` Property Descriptions --------------------- .. _class_Shader_property_code: - :ref:`String` **code** +----------+-----------------+ | *Setter* | set_code(value) | +----------+-----------------+ | *Getter* | get_code() | +----------+-----------------+ Method Descriptions ------------------- .. _class_Shader_method_get_default_texture_param: - :ref:`Texture` **get_default_texture_param** **(** :ref:`String` param **)** const ---- .. _class_Shader_method_get_mode: - :ref:`Mode` **get_mode** **(** **)** const Returns the shader mode for the shader, either :ref:`MODE_CANVAS_ITEM`, :ref:`MODE_SPATIAL` or :ref:`MODE_PARTICLES` ---- .. _class_Shader_method_has_param: - :ref:`bool` **has_param** **(** :ref:`String` name **)** const ---- .. _class_Shader_method_set_default_texture_param: - void **set_default_texture_param** **(** :ref:`String` param, :ref:`Texture` texture **)**