From 2d7aee19505a3aef5d74153623176118964c3836 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Wed, 6 Apr 2022 19:39:47 +0200 Subject: [PATCH] Link to transparency sorting limitations page in Spatial shaders (#5740) Co-authored-by: Clay John --- tutorials/3d/3d_rendering_limitations.rst | 2 ++ .../shaders/shader_reference/spatial_shader.rst | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/tutorials/3d/3d_rendering_limitations.rst b/tutorials/3d/3d_rendering_limitations.rst index 8b495ccfd114..1d010676cec9 100644 --- a/tutorials/3d/3d_rendering_limitations.rst +++ b/tutorials/3d/3d_rendering_limitations.rst @@ -76,6 +76,8 @@ Depending on the scene and viewing conditions, you may also be able to move the Z-fighting objects further apart without the difference being visible to the player. +.. _doc_3d_rendering_limitations_transparency_sorting: + Transparency sorting -------------------- diff --git a/tutorials/shaders/shader_reference/spatial_shader.rst b/tutorials/shaders/shader_reference/spatial_shader.rst index 5643c2565ea7..c5ca0e9bda2e 100644 --- a/tutorials/shaders/shader_reference/spatial_shader.rst +++ b/tutorials/shaders/shader_reference/spatial_shader.rst @@ -340,6 +340,13 @@ these properties, and if you don't write to them, Godot will optimize away the c | out vec4 **IRRADIANCE** | If written to, blends environment map IRRADIANCE with IRRADIANCE.rgb based on IRRADIANCE.a. | +----------------------------------------+--------------------------------------------------------------------------------------------------+ +.. note:: + + Shaders going through the transparent pipeline when ``ALPHA`` is written to + may exhibit transparency sorting issues. Read the + :ref:`transparency sorting section in the 3D rendering limitations page ` + for more information and ways to avoid issues. + Light built-ins ^^^^^^^^^^^^^^^ @@ -423,3 +430,10 @@ If you want the lights to add together, add the light contribution to ``DIFFUSE_ | out float **ALPHA** | Alpha (0..1); if written to, the material will go | | | to the transparent pipeline. | +-----------------------------------+----------------------------------------------------+ + +.. note:: + + Shaders going through the transparent pipeline when ``ALPHA`` is written to + may exhibit transparency sorting issues. Read the + :ref:`transparency sorting section in the 3D rendering limitations page ` + for more information and ways to avoid issues.