Skip to content

Commit fabd885

Browse files
authored
Merge pull request godotengine#8459 from ShlomiRex/visual_shaders_interface
Add visual shader node interface explanation
2 parents d82940e + ee9e10e commit fabd885

File tree

7 files changed

+50
-0
lines changed

7 files changed

+50
-0
lines changed
1.32 KB
Loading

tutorials/shaders/img/vs_node.webp

14 KB
Loading
6.04 KB
Loading
1.25 KB
Loading
3.06 KB
Loading
1.86 KB
Loading

tutorials/shaders/visual_shaders.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,56 @@ the vector will take the value of the scalar.
9292
When connecting any ``vector`` output to a ``scalar`` input, the value of the
9393
scalar will be the average of the vector's components.
9494

95+
Visual Shader node interface
96+
------------------------------
97+
98+
Visual shader nodes have input and output ports. The input ports are located on the left side of the node, and output ports are located on the right side of the node.
99+
100+
.. figure:: img/vs_node.webp
101+
102+
These ports are colored to differentiate type of port:
103+
104+
.. |scalar| image:: img/vs_scalar.webp
105+
.. |vector| image:: img/vs_vector.webp
106+
.. |boolean| image:: img/vs_boolean.webp
107+
.. |transform| image:: img/vs_transform.webp
108+
.. |sampler| image:: img/vs_sampler.webp
109+
110+
111+
.. list-table:: Port types
112+
:widths: auto
113+
:header-rows: 1
114+
115+
* - Type
116+
- Color
117+
- Description
118+
- Example
119+
* - Scalar
120+
- Cyan
121+
- Scalar is a single value.
122+
- |scalar|
123+
* - Vector
124+
- Purple
125+
- Vector is a set of values.
126+
- |vector|
127+
* - Boolean
128+
- Blue
129+
- On or off, true or false.
130+
- |boolean|
131+
* - Transform
132+
- Orange
133+
- A matrix, usually used to transform vertices.
134+
- |transform|
135+
* - Sampler
136+
- Yellow
137+
- A texture sampler. It can be used to sample textures.
138+
- |sampler|
139+
140+
All of the types are used in the calculations of vertices, fragments, and lights in the shader. For example: matrix multiplication,
141+
vector addition, or scalar division.
142+
143+
There are other types but these are the main ones.
144+
95145
Visual Shader nodes
96146
-------------------
97147

0 commit comments

Comments
 (0)