123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- :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/<name>/doc_classes.
- .. _class_Shader:
- Shader
- ======
- **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
- **Inherited By:** :ref:`VisualShader<class_VisualShader>`
- **Category:** Core
- Brief Description
- -----------------
- A custom shader program.
- Properties
- ----------
- +-----------------------------+-----------------------------------------+
- | :ref:`String<class_String>` | :ref:`code<class_Shader_property_code>` |
- +-----------------------------+-----------------------------------------+
- Methods
- -------
- +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Texture<class_Texture>` | :ref:`get_default_texture_param<class_Shader_method_get_default_texture_param>` **(** :ref:`String<class_String>` param **)** const |
- +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`Mode<enum_Shader_Mode>` | :ref:`get_mode<class_Shader_method_get_mode>` **(** **)** const |
- +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | :ref:`bool<class_bool>` | :ref:`has_param<class_Shader_method_has_param>` **(** :ref:`String<class_String>` name **)** const |
- +-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
- | void | :ref:`set_default_texture_param<class_Shader_method_set_default_texture_param>` **(** :ref:`String<class_String>` param, :ref:`Texture<class_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<class_String>` **code**
- +----------+-----------------+
- | *Setter* | set_code(value) |
- +----------+-----------------+
- | *Getter* | get_code() |
- +----------+-----------------+
- Method Descriptions
- -------------------
- .. _class_Shader_method_get_default_texture_param:
- - :ref:`Texture<class_Texture>` **get_default_texture_param** **(** :ref:`String<class_String>` param **)** const
- ----
- .. _class_Shader_method_get_mode:
- - :ref:`Mode<enum_Shader_Mode>` **get_mode** **(** **)** const
- Returns the shader mode for the shader, either :ref:`MODE_CANVAS_ITEM<class_Shader_constant_MODE_CANVAS_ITEM>`, :ref:`MODE_SPATIAL<class_Shader_constant_MODE_SPATIAL>` or :ref:`MODE_PARTICLES<class_Shader_constant_MODE_PARTICLES>`
- ----
- .. _class_Shader_method_has_param:
- - :ref:`bool<class_bool>` **has_param** **(** :ref:`String<class_String>` name **)** const
- ----
- .. _class_Shader_method_set_default_texture_param:
- - void **set_default_texture_param** **(** :ref:`String<class_String>` param, :ref:`Texture<class_Texture>` texture **)**
|