Răsfoiți Sursa

Merge pull request #3080 from Chaosus/shader_array_construct2

A little bit better shader array construction example
Yuri Roubinsky 5 ani în urmă
părinte
comite
0cc8a3971e

+ 4 - 4
tutorials/shading/shading_reference/shading_language.rst

@@ -209,13 +209,13 @@ They can be initialized at the beginning like:
 
 .. code-block:: glsl
 
-      float arr[3] = float[3] (1.0, 0.5, 0.0); // first constructor
+      float float_arr[3] = float[3] ( 1.0, 0.5, 0.0 ); // first constructor
 
-      float arr_v2[3] = float[] (1.0, 0.5, 0.0); // second constructor
+      int int_arr[3] = int[] ( 2, 1, 0 ); // second constructor
 
-      vec2 arr_v3[2] = { vec2(0.0, 0.0), vec2(1.0, 1.0) }; // third constructor
+      vec2 vec2_arr[3] = { vec2(1.0, 1.0), vec2(0.5, 0.5), vec2(0.0, 0.0) }; // third constructor
 
-      bool bvec_arr[] = { false, false, true, true }; // fourth constructor - size is defined automatically from the argument count
+      bool bool_arr[] = { true, true, false }; // fourth constructor - size is defined automatically from the element count
 
 You can declare multiple arrays (even with different sizes) in one expression: