From f6ddd71040b0d853ad68345d5add0ba98aa15284 Mon Sep 17 00:00:00 2001 From: jsjtxietian Date: Fri, 10 May 2024 15:26:25 +0800 Subject: [PATCH] Mention that user is responsible for POSITION value when it's written to anywhere in the shader --- tutorials/shaders/shader_reference/spatial_shader.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tutorials/shaders/shader_reference/spatial_shader.rst b/tutorials/shaders/shader_reference/spatial_shader.rst index 40e1bca5b5a..c56ea5cc2bd 100644 --- a/tutorials/shaders/shader_reference/spatial_shader.rst +++ b/tutorials/shaders/shader_reference/spatial_shader.rst @@ -136,9 +136,10 @@ it manually with the following code: Other built-ins, such as UV, UV2 and COLOR, are also passed through to the fragment function if not modified. -Users can override the modelview and projection transforms using the ``POSITION`` built-in. When ``POSITION`` is used, -the value from ``VERTEX`` is ignored and projection does not happen. However, the value passed to the fragment shader -still comes from ``VERTEX``. +Users can override the modelview and projection transforms using the ``POSITION`` built-in. If ``POSITION`` is written +to anywhere in the shader, it will always be used, so the user becomes responsible for ensuring that it always has +an acceptable value. When ``POSITION`` is used, the value from ``VERTEX`` is ignored and projection does not happen. +However, the value passed to the fragment shader still comes from ``VERTEX``. For instancing, the INSTANCE_CUSTOM variable contains the instance custom data. When using particles, this information is usually: