Ver código fonte

Merge pull request #10129 from Chaosus/shader_clip_space_far

Add `CLIP_SPACE_FAR` built-in description to spatial shaders
Yuri Rubinsky 9 meses atrás
pai
commit
bb40500d11
1 arquivos alterados com 26 adições e 30 exclusões
  1. 26 30
      tutorials/shaders/shader_reference/spatial_shader.rst

+ 26 - 30
tutorials/shaders/shader_reference/spatial_shader.rst

@@ -96,25 +96,32 @@ Global built-ins
 
 Global built-ins are available everywhere, including custom functions.
 
-+-------------------+-----------------------------------------------------------------------------------------+
-| Built-in          | Description                                                                             |
-+===================+=========================================================================================+
-| in float **TIME** | Global time since the engine has started, in seconds. It repeats after every ``3,600``  |
-|                   | seconds (which can  be changed with the                                                 |
-|                   | :ref:`rollover<class_ProjectSettings_property_rendering/limits/time/time_rollover_secs>`|
-|                   | setting). It's not affected by :ref:`time_scale<class_Engine_property_time_scale>` or   |
-|                   | pausing. If you need  a ``TIME`` variable that can be scaled or paused, add your own    |
-|                   | :ref:`global shader uniform<doc_shading_language_global_uniforms>` and update it each   |
-|                   | frame.                                                                                  | 
-+-------------------+-----------------------------------------------------------------------------------------+
-| in float **PI**   | A ``PI`` constant (``3.141592``).                                                       |
-|                   | A ratio of a circle's circumference to its diameter and amount of radians in half turn. |
-+-------------------+-----------------------------------------------------------------------------------------+
-| in float **TAU**  | A ``TAU`` constant (``6.283185``).                                                      |
-|                   | An equivalent of ``PI * 2`` and amount of radians in full turn.                         |
-+-------------------+-----------------------------------------------------------------------------------------+
-| in float **E**    | An ``E`` constant (``2.718281``). Euler's number and a base of the natural logarithm.   |
-+-------------------+-----------------------------------------------------------------------------------------+
++-----------------------------+------------------------------------------------------------------------------------------+
+| Built-in                    | Description                                                                              |
++=============================+==========================================================================================+
+| in float **TIME**           | Global time since the engine has started, in seconds. It repeats after every ``3,600``   |
+|                             | seconds (which can  be changed with the                                                  |
+|                             | :ref:`rollover<class_ProjectSettings_property_rendering/limits/time/time_rollover_secs>` |
+|                             | setting). It's not affected by :ref:`time_scale<class_Engine_property_time_scale>` or    |
+|                             | pausing. If you need  a ``TIME`` variable that can be scaled or paused, add your own     |
+|                             | :ref:`global shader uniform<doc_shading_language_global_uniforms>` and update it each    |
+|                             | frame.                                                                                   | 
++-----------------------------+------------------------------------------------------------------------------------------+
+| in float **PI**             | A ``PI`` constant (``3.141592``).                                                        |
+|                             | A ratio of a circle's circumference to its diameter and amount of radians in half turn.  |
++-----------------------------+------------------------------------------------------------------------------------------+
+| in float **TAU**            | A ``TAU`` constant (``6.283185``).                                                       |
+|                             | An equivalent of ``PI * 2`` and amount of radians in full turn.                          |
++-----------------------------+------------------------------------------------------------------------------------------+
+| in float **E**              | An ``E`` constant (``2.718281``). Euler's number and a base of the natural logarithm.    |
++-----------------------------+------------------------------------------------------------------------------------------+
+| in bool **OUTPUT_IS_SRGB**  | ``true`` when output is in sRGB color space (this is ``true`` in the Compatibility       |
+|                             | renderer, ``false`` in Forward+ and Forward Mobile).                                     |
++----------------------------------------+-------------------------------------------------------------------------------+
+| in float **CLIP_SPACE_FAR** | Clip space far ``z`` value.                                                              |
+|                             | In the Forward+ or Mobile renderers, it's ``0.0``.                                       |
+|                             | In the Compatibility renderer, it's ``-1.0``.                                            |
++-----------------------------+------------------------------------------------------------------------------------------+
 
 Vertex built-ins
 ^^^^^^^^^^^^^^^^
@@ -181,10 +188,6 @@ shader, this value can be used as desired.
 +----------------------------------------+--------------------------------------------------------+
 | in uint **CAMERA_VISIBLE_LAYERS**      | Cull layers of the camera rendering the current pass.  |
 +----------------------------------------+--------------------------------------------------------+
-| in bool **OUTPUT_IS_SRGB**             | ``true`` when output is in sRGB color space            |
-|                                        | (this is ``true`` in the Compatibility renderer,       |
-|                                        | ``false`` in Forward+ and Forward Mobile).             |
-+----------------------------------------+--------------------------------------------------------+
 | in int **INSTANCE_ID**                 | Instance ID for instancing.                            |
 +----------------------------------------+--------------------------------------------------------+
 | in vec4 **INSTANCE_CUSTOM**            | Instance custom data (for particles, mostly).          |
@@ -285,9 +288,6 @@ these properties, and if you don't write to them, Godot will optimize away the c
 +----------------------------------------+--------------------------------------------------------------------------------------------------+
 | in vec2 **POINT_COORD**                | Point coordinate for drawing points with ``POINT_SIZE``.                                         |
 +----------------------------------------+--------------------------------------------------------------------------------------------------+
-| in bool **OUTPUT_IS_SRGB**             | ``true`` when output is in sRGB color space (this is ``true`` in the Compatibility renderer,     |
-|                                        | ``false`` in Forward+ and Forward Mobile).                                                       |
-+----------------------------------------+--------------------------------------------------------------------------------------------------+
 | in mat4 **MODEL_MATRIX**               | Model/local space to world space transform.                                                      |
 +----------------------------------------+--------------------------------------------------------------------------------------------------+
 | in mat3 **MODEL_NORMAL_MATRIX**        |                                                                                                  |
@@ -484,10 +484,6 @@ If you want the lights to add together, add the light contribution to ``DIFFUSE_
 +-----------------------------------+------------------------------------------------------------------------+
 | in float **ROUGHNESS**            | Roughness.                                                             |
 +-----------------------------------+------------------------------------------------------------------------+
-| in bool **OUTPUT_IS_SRGB**        | ``true`` when output is in sRGB color space.                           |
-|                                   | This is ``true`` in the Compatibility renderer,                        |
-|                                   | ``false`` in Forward+ and Forward Mobile.                              |
-+-----------------------------------+------------------------------------------------------------------------+
 | out vec3 **DIFFUSE_LIGHT**        | Diffuse light result.                                                  |
 +-----------------------------------+------------------------------------------------------------------------+
 | out vec3 **SPECULAR_LIGHT**       | Specular light result.                                                 |