Răsfoiți Sursa

Mark shader TIME as global built-in

Yuri Roubinsky 5 ani în urmă
părinte
comite
f2f8c00909

+ 11 - 4
tutorials/shading/shading_reference/canvas_item_shader.rst

@@ -35,6 +35,17 @@ Render modes
 | **skip_vertex_transform**       | VERTEX/NORMAL/etc need to be transformed manually in vertex function.|
 +---------------------------------+----------------------------------------------------------------------+
 
+Global built-ins
+^^^^^^^^^^^^^^^^
+
+Global built-ins are available everywhere, including custom functions.
+
++--------------------------------+-------------------------+
+| Built-in                       | Description             |
++================================+=========================+
+| in float **TIME**              | Global time, in seconds.|
++--------------------------------+-------------------------+
+
 Vertex built-ins
 ^^^^^^^^^^^^^^^^
 
@@ -100,8 +111,6 @@ is usually:
 +--------------------------------+----------------------------------------------------------------+
 | in mat4 **PROJECTION_MATRIX**  | View space to clip space transform.                            |
 +--------------------------------+----------------------------------------------------------------+
-| in float **TIME**              | Global time, in seconds.                                       |
-+--------------------------------+----------------------------------------------------------------+
 | in vec4 **INSTANCE_CUSTOM**    | Instance custom data.                                          |
 +--------------------------------+----------------------------------------------------------------+
 | in bool **AT_LIGHT_PASS**      | ``true`` if this is a light pass.                              |
@@ -173,8 +182,6 @@ it to the ``NORMALMAP`` property. Godot will handle converting it for use in 2D
 +----------------------------------+----------------------------------------------------------------+
 | in vec2 **POINT_COORD**          | Coordinate for drawing points.                                 |
 +----------------------------------+----------------------------------------------------------------+
-| in float **TIME**                | Global time in seconds.                                        |
-+----------------------------------+----------------------------------------------------------------+
 | in bool **AT_LIGHT_PASS**        | ``true`` if this is a light pass.                              |
 +----------------------------------+----------------------------------------------------------------+
 | in sampler2D **SCREEN_TEXTURE**  | Screen texture, mipmaps contain gaussian blurred versions.     |

+ 11 - 2
tutorials/shading/shading_reference/particle_shader.rst

@@ -36,6 +36,17 @@ Render modes
 | **disable_velocity**            | Ignore **VELOCITY** value.                                           |
 +---------------------------------+----------------------------------------------------------------------+
 
+Global built-ins
+^^^^^^^^^^^^^^^^
+
+Global built-ins are available everywhere, including custom functions.
+
++--------------------------------+-------------------------+
+| Built-in                       | Description             |
++================================+=========================+
+| in float **TIME**              | Global time, in seconds.|
++--------------------------------+-------------------------+
+
 Vertex built-ins
 ^^^^^^^^^^^^^^^^
 
@@ -64,8 +75,6 @@ to ``true``. In a ShaderMaterial, access it with the ``COLOR`` variable.
 +---------------------------------+-------------------------------------------------------------------------------------+
 | inout mat4 **TRANSFORM**        | Particle transform.                                                                 |
 +---------------------------------+-------------------------------------------------------------------------------------+
-| in float **TIME**               | Global time in seconds.                                                             |
-+---------------------------------+-------------------------------------------------------------------------------------+
 | in float **LIFETIME**           | Particle lifetime.                                                                  |
 +---------------------------------+-------------------------------------------------------------------------------------+
 | in float **DELTA**              | Delta process time.                                                                 |

+ 11 - 4
tutorials/shading/shading_reference/spatial_shader.rst

@@ -77,6 +77,17 @@ Render modes
 |                                 | a camera feed in AR.                                                  |
 +---------------------------------+-----------------------------------------------------------------------+
 
+Global built-ins
+^^^^^^^^^^^^^^^^
+
+Global built-ins are available everywhere, including custom functions.
+
++--------------------------------+-------------------------+
+| Built-in                       | Description             |
++================================+=========================+
+| in float **TIME**              | Global time, in seconds.|
++--------------------------------+-------------------------+
+
 Vertex built-ins
 ^^^^^^^^^^^^^^^^
 
@@ -124,8 +135,6 @@ shader, this value can be used as desired.
 +--------------------------------------+-------------------------------------------------------+
 | Built-in                             | Description                                           |
 +======================================+=======================================================+
-| in float **TIME**                    | Elapsed total time in seconds.                        |
-+--------------------------------------+-------------------------------------------------------+
 | in vec2 **VIEWPORT_SIZE**            | Size of viewport (in pixels).                         |
 +--------------------------------------+-------------------------------------------------------+
 | inout mat4 **WORLD_MATRIX**          | Model space to world space transform.                 |
@@ -178,8 +187,6 @@ these properties, and if you don't write to them, Godot will optimize away the c
 +-----------------------------------+--------------------------------------------------------------------------------------------------+
 | Built-in                          | Description                                                                                      |
 +===================================+==================================================================================================+
-| in float **TIME**                 | Elapsed total time in seconds.                                                                   |
-+-----------------------------------+--------------------------------------------------------------------------------------------------+
 | in vec2 **VIEWPORT_SIZE**         | Size of viewport (in pixels).                                                                    |
 +-----------------------------------+--------------------------------------------------------------------------------------------------+
 | in vec4 **FRAGCOORD**             | Coordinate of pixel center in screen space. ``xy`` specifies  position in window, ``z``          |