From d66aed8cd99313680faea2e2bec8d36207a06126 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Fri, 12 Jul 2019 10:33:22 -0700 Subject: [PATCH] update FRAGCOORD descriptions --- tutorials/shading/migrating_to_godot_shader_language.rst | 2 +- .../shading/shading_reference/canvas_item_shader.rst | 8 ++++++-- tutorials/shading/shading_reference/spatial_shader.rst | 8 ++++++-- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tutorials/shading/migrating_to_godot_shader_language.rst b/tutorials/shading/migrating_to_godot_shader_language.rst index 7e03a7a2b..3dcd96c2c 100644 --- a/tutorials/shading/migrating_to_godot_shader_language.rst +++ b/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. | +---------------------+---------+------------------------+-----------------------------------------------------+ diff --git a/tutorials/shading/shading_reference/canvas_item_shader.rst b/tutorials/shading/shading_reference/canvas_item_shader.rst index 75def2c90..d88a01513 100644 --- a/tutorials/shading/shading_reference/canvas_item_shader.rst +++ b/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**. | diff --git a/tutorials/shading/shading_reference/spatial_shader.rst b/tutorials/shading/shading_reference/spatial_shader.rst index 5e3ef5378..967b0ca4f 100644 --- a/tutorials/shading/shading_reference/spatial_shader.rst +++ b/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. | +-----------------------------------+---------------------------------------------+