File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
tutorials/shaders/shader_reference Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -322,22 +322,24 @@ return the array's size.
322322Global arrays
323323~~~~~~~~~~~~~
324324
325- You can declare arrays at global space like :
325+ You can declare arrays in global space as either `` const `` or `` uniform `` :
326326
327327.. code-block :: glsl
328328
329329 shader_type spatial;
330330
331331 const lowp vec3 v[1] = lowp vec3[1] ( vec3(0, 0, 1) );
332+ uniform lowp vec3 w[1];
332333
333334 void fragment() {
334- ALBEDO = v[0];
335+ ALBEDO = v[0] + w[0] ;
335336 }
336337
337338 .. note ::
338339
339- Global arrays have to be declared as global constants, otherwise they can be
340- declared the same as local arrays.
340+ Global arrays use the same syntax as local arrays, except with a ``const ``
341+ or ``uniform `` added to their declaration. Note that uniform arrays can't
342+ have a default value.
341343
342344Constants
343345---------
You can’t perform that action at this time.
0 commit comments