From 3df0d90eefa1d97316c8cf6bce0215bb628bf439 Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Mon, 20 Jan 2020 09:00:37 +0300 Subject: [PATCH] A little bit better shader array construction example --- tutorials/shading/shading_reference/shading_language.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorials/shading/shading_reference/shading_language.rst b/tutorials/shading/shading_reference/shading_language.rst index 17e8a4221..3f26517b1 100644 --- a/tutorials/shading/shading_reference/shading_language.rst +++ b/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: