Skip to content

Commit

Permalink
Merge pull request godotengine#9352 from jsjtxietian/shader-position
Browse files Browse the repository at this point in the history
Mention that user is responsible for POSITION value when it's written to anywhere in the shader
  • Loading branch information
AThousandShips authored May 15, 2024
2 parents 7e67f8c + f6ddd71 commit 547d701
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tutorials/shaders/shader_reference/spatial_shader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 547d701

Please sign in to comment.