Skip to content

Commit

Permalink
Merge pull request #10605 from tetrapod00/builtin-varying-note
Browse files Browse the repository at this point in the history
Add note to use varyings to access builtins in shader pages
  • Loading branch information
mhilbrunner authored Feb 3, 2025
2 parents 6e75669 + 858c663 commit 091a449
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tutorials/shaders/shader_reference/canvas_item_shader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------

Expand Down
4 changes: 4 additions & 0 deletions tutorials/shaders/shader_reference/spatial_shader.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
----------------

Expand Down

0 comments on commit 091a449

Please sign in to comment.