ソースを参照

Merge pull request #9846 from Flarkk/shader_matrix_convention

Fix shader language matrix row/col convention
Max Hilbrunner 9 ヶ月 前
コミット
7061a2aa92
1 ファイル変更3 行追加3 行削除
  1. 3 3
      tutorials/shaders/shader_reference/shading_language.rst

+ 3 - 3
tutorials/shaders/shader_reference/shading_language.rst

@@ -163,8 +163,8 @@ Individual scalar members of vector types are accessed via the "x", "y", "z" and
 equivalent. Use whatever fits best for your needs.
 equivalent. Use whatever fits best for your needs.
 
 
 For matrices, use the ``m[column][row]`` indexing syntax to access each scalar,
 For matrices, use the ``m[column][row]`` indexing syntax to access each scalar,
-or ``m[idx]`` to access a vector by row index. For example, for accessing the y
-position of an object in a mat4 you use ``m[3][1]``.
+or ``m[column]`` to access a vector by column index. For example, for accessing the
+y-component of the translation from a mat4 transform matrix (4th column, 2nd line) you use ``m[3][1]`` or ``m[3].y``.
 
 
 Constructing
 Constructing
 ~~~~~~~~~~~~
 ~~~~~~~~~~~~
@@ -182,7 +182,7 @@ Construction of vector types must always pass:
     vec4 a = vec4(0.0);
     vec4 a = vec4(0.0);
 
 
 Construction of matrix types requires vectors of the same dimension as the
 Construction of matrix types requires vectors of the same dimension as the
-matrix. You can also build a diagonal matrix using ``matx(float)`` syntax.
+matrix, interpreted as columns. You can also build a diagonal matrix using ``matx(float)`` syntax.
 Accordingly, ``mat4(1.0)`` is an identity matrix.
 Accordingly, ``mat4(1.0)`` is an identity matrix.
 
 
 .. code-block:: glsl
 .. code-block:: glsl