From 203c5d7b3e3c1842e323d9a696bbf057a795ed33 Mon Sep 17 00:00:00 2001 From: Flarkk <49606622+Flarkk@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:36:48 +0100 Subject: [PATCH] Clarify when fragcoord z is used as depth output --- tutorials/shaders/shader_reference/spatial_shader.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tutorials/shaders/shader_reference/spatial_shader.rst b/tutorials/shaders/shader_reference/spatial_shader.rst index 4e14ad78a..fb0d09eef 100644 --- a/tutorials/shaders/shader_reference/spatial_shader.rst +++ b/tutorials/shaders/shader_reference/spatial_shader.rst @@ -268,8 +268,9 @@ these properties, and if you don't write to them, Godot will optimize away the c +========================================+==================================================================================================+ | 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`` | -| | specifies fragment depth if ``DEPTH`` is not used. Origin is lower-left. | +| in vec4 **FRAGCOORD** | Coordinate of pixel center in screen space. ``xy`` specifies position in window. Origin is lower | +| | left. ``z`` specifies fragment depth. It is also used as the output value for the fragment depth | +| | unless ``DEPTH`` is written to. | +----------------------------------------+--------------------------------------------------------------------------------------------------+ | in bool **FRONT_FACING** | ``true`` if current face is front facing. | +----------------------------------------+--------------------------------------------------------------------------------------------------+