Skip to content

Commit 54f368c

Browse files
committed
Fix shader language matrix row/col convention
1 parent 7628f87 commit 54f368c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tutorials/shaders/shader_reference/shading_language.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ Individual scalar members of vector types are accessed via the "x", "y", "z" and
155155
equivalent. Use whatever fits best for your needs.
156156

157157
For matrices, use the ``m[column][row]`` indexing syntax to access each scalar,
158-
or ``m[idx]`` to access a vector by row index. For example, for accessing the y
159-
position of an object in a mat4 you use ``m[3][1]``.
158+
or ``m[column]`` to access a vector by column index. For example, for accessing the
159+
y-component of the translation from a mat4 transform matrix (4th column, 2nd line) you use ``m[3][1]`` or ``m[3].y``.
160160

161161
Constructing
162162
~~~~~~~~~~~~
@@ -174,7 +174,7 @@ Construction of vector types must always pass:
174174
vec4 a = vec4(0.0);
175175
176176
Construction of matrix types requires vectors of the same dimension as the
177-
matrix. You can also build a diagonal matrix using ``matx(float)`` syntax.
177+
matrix, interpreted as columns. You can also build a diagonal matrix using ``matx(float)`` syntax.
178178
Accordingly, ``mat4(1.0)`` is an identity matrix.
179179

180180
.. code-block:: glsl

0 commit comments

Comments
 (0)