Add note to use varyings to access builtins in shader pages

This commit is contained in:
tetrapod00
2025-02-02 13:00:12 -08:00
parent 9abcbd707e
commit 858c663ab1
2 changed files with 8 additions and 0 deletions

View File

@@ -45,6 +45,10 @@ Values marked as ``in`` are read-only. Values marked as ``out`` can optionally b
not necessarily contain sensible values. Values marked as ``inout`` provide a sensible default
value, and can optionally be written to. Samplers cannot be written to so they are not marked.
Not all built-ins are available in all processing functions. To access a vertex
built-in from the ``fragment()`` function, you can use a :ref:`varying <doc_shading_language_varyings>`.
The same applies for accessing fragment built-ins from the ``light()`` function.
Global built-ins
----------------

View File

@@ -97,6 +97,10 @@ Values marked as ``in`` are read-only. Values marked as ``out`` can optionally b
not necessarily contain sensible values. Values marked as ``inout`` provide a sensible default
value, and can optionally be written to. Samplers cannot be written to so they are not marked.
Not all built-ins are available in all processing functions. To access a vertex
built-in from the ``fragment()`` function, you can use a :ref:`varying <doc_shading_language_varyings>`.
The same applies for accessing fragment built-ins from the ``light()`` function.
Global built-ins
----------------