فهرست منبع

update FRAGCOORD descriptions

clayjohn 6 سال پیش
والد
کامیت
d66aed8cd9

+ 1 - 1
tutorials/shading/migrating_to_godot_shader_language.rst

@@ -159,7 +159,7 @@ uniform themself. The description gives the reader a hint about what they can pa
 +=====================+=========+========================+=====================================================+
 |fragColor            |out vec4 |COLOR                   |Output color for each pixel.                         |
 +---------------------+---------+------------------------+-----------------------------------------------------+
-|fragCoord            |vec2     |FRAGCOORD               |For full screen quads. For smaller quads, use UV.    |
+|fragCoord            |vec2     |FRAGCOORD.xy            |For full screen quads. For smaller quads, use UV.    |
 +---------------------+---------+------------------------+-----------------------------------------------------+
 |iResolution          |vec3     |1.0 / SCREEN_PIXEL_SIZE |Can also pass in manually.                           |
 +---------------------+---------+------------------------+-----------------------------------------------------+

+ 6 - 2
tutorials/shading/shading_reference/canvas_item_shader.rst

@@ -143,7 +143,9 @@ it to the ``NORMALMAP`` property. Godot will handle converting it for use in 2D
 +----------------------------------+----------------------------------------------------------------+
 | Built-in                         | Description                                                    |
 +==================================+================================================================+
-| in vec4 **FRAGCOORD**            | Fragment coordinate, pixel adjusted.                           |
+| in vec4 **FRAGCOORD**            | Coordinate of pixel center. In screen space. ``xy`` specifies  |
+|                                  | position in window, ``z`` specifies fragment depth if          |
+|                                  | ``DEPTH`` is not used. Origin is lower-left.                   |
 +----------------------------------+----------------------------------------------------------------+
 | inout vec3 **NORMAL**            | Normal read from **NORMAL_TEXTURE**. Writable.                 |
 +----------------------------------+----------------------------------------------------------------+
@@ -192,7 +194,9 @@ When the shader is on a light pass, the ``AT_LIGHT_PASS`` variable will be ``tru
 +-------------------------------------+-------------------------------------------------------------------------------+
 | Built-in                            | Description                                                                   |
 +=====================================+===============================================================================+
-| in vec4 **FRAGCOORD**               | Fragment coordinate of pixel center. Origin at lower left.                    |
+| in vec4 **FRAGCOORD**               | Coordinate of pixel center. In screen space. ``xy`` specifies                 |
+|                                     | position in window, ``z`` specifies fragment depth if                         |
+|                                     | ``DEPTH`` is not used. Origin is lower-left.                                  |
 +-------------------------------------+-------------------------------------------------------------------------------+
 | in vec3 **NORMAL**                  | Input Normal. Although this value is passed in,                               |
 |                                     | **normal calculation still happens outside of this function**.                |

+ 6 - 2
tutorials/shading/shading_reference/spatial_shader.rst

@@ -174,7 +174,8 @@ these properties, and if you don't write to them, Godot will optimize away the c
 +-----------------------------------+--------------------------------------------------------------------------------------------------+
 | Built-in                          | Description                                                                                      |
 +===================================+==================================================================================================+
-| in vec4 **FRAGCOORD**             | Fragment coordinate, pixel adjusted. In screen space.                                            |
+| in vec4 **FRAGCOORD**             | Coordinate of pixel center. In screen space. ``xy`` specifies  position in window, ``z``         |
+|                                   | specifies fragment depth if ``DEPTH`` is not used. Origin is lower-left.                         |
 +-----------------------------------+--------------------------------------------------------------------------------------------------+
 | in mat4 **WORLD_MATRIX**          | Model space to world space transform.                                                            |
 +-----------------------------------+--------------------------------------------------------------------------------------------------+
@@ -287,7 +288,10 @@ If you want the lights to add together, add the light contribution to ``DIFFUSE_
 +-----------------------------------+---------------------------------------------+
 | Built-in                          | Description                                 |
 +===================================+=============================================+
-| in vec4 **FRAGCOORD**             | Fragment coordinate, pixel adjusted.        |
+| in vec4 **FRAGCOORD**             | Coordinate of pixel center. In screen space.|
+|                                   | ``xy`` specifies  position in window, ``z`` |
+|                                   | specifies fragment depth if ``DEPTH`` is    |
+|                                   | not used. Origin is lower-left.             |
 +-----------------------------------+---------------------------------------------+
 | in mat4 **WORLD_MATRIX**          | Model space to world space transform.       |
 +-----------------------------------+---------------------------------------------+