Skip to content

Commit 091a449

Browse files
authored
Merge pull request #10605 from tetrapod00/builtin-varying-note
Add note to use varyings to access builtins in shader pages
2 parents 6e75669 + 858c663 commit 091a449

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tutorials/shaders/shader_reference/canvas_item_shader.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ Values marked as ``in`` are read-only. Values marked as ``out`` can optionally b
4545
not necessarily contain sensible values. Values marked as ``inout`` provide a sensible default
4646
value, and can optionally be written to. Samplers cannot be written to so they are not marked.
4747

48+
Not all built-ins are available in all processing functions. To access a vertex
49+
built-in from the ``fragment()`` function, you can use a :ref:`varying <doc_shading_language_varyings>`.
50+
The same applies for accessing fragment built-ins from the ``light()`` function.
51+
4852
Global built-ins
4953
----------------
5054

tutorials/shaders/shader_reference/spatial_shader.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ Values marked as ``in`` are read-only. Values marked as ``out`` can optionally b
9797
not necessarily contain sensible values. Values marked as ``inout`` provide a sensible default
9898
value, and can optionally be written to. Samplers cannot be written to so they are not marked.
9999

100+
Not all built-ins are available in all processing functions. To access a vertex
101+
built-in from the ``fragment()`` function, you can use a :ref:`varying <doc_shading_language_varyings>`.
102+
The same applies for accessing fragment built-ins from the ``light()`` function.
103+
100104
Global built-ins
101105
----------------
102106

0 commit comments

Comments
 (0)