mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
104 lines
4.0 KiB
ReStructuredText
104 lines
4.0 KiB
ReStructuredText
.. 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 ``MODE_CANVAS_ITEM``, ``MODE_SPATIAL`` or ``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 **)**
|
|
|