Shader:send
Sends one or more values to a special (''uniform'') variable inside the shader. Uniform variables have to be marked using the ''uniform'' or ''extern'' keyword, e.g.

uniform float time; // 'float' is the typical number type used in GLSL shaders.

uniform float varsvec2 light_pos;

uniform vec4 colors[4;

The corresponding send calls would be

shader:send('time', t)

shader:send('vars',a,b)

shader:send('light_pos', {light_x, light_y})

shader:send('colors', {r1, g1, b1, a1}, {r2, g2, b2, a2}, {r3, g3, b3, a3}, {r4, g4, b4, a4})

Uniform / extern variables are read-only in the shader code and remain constant until modified by a Shader:send call. Uniform variables can be accessed in both the Vertex and Pixel components of a shader, as long as the variable is declared in each.
Shader:send( name, number, ... )
name string Name of the number to send to the shader.
number number Number to send to store in the uniform variable.
... number Additional numbers to send if the uniform variable is an array.
Shader:send( name, vector, ... )
name string Name of the vector to send to the shader.
vector table Numbers to send to the uniform variable as a vector. The number of elements in the table determines the type of the vector (e.g. two numbers -> vec2). At least two and at most four numbers can be used.
... table Additional vectors to send if the uniform variable is an array. All vectors need to be of the same size (e.g. only vec3's).
Shader:send( name, matrix, ... )
name string Name of the matrix to send to the shader.
matrix table 2x2, 3x3, or 4x4 matrix to send to the uniform variable. Using table form: {{a,b,c,d}, {e,f,g,h}, ... } or (since version 0.10.2) {a,b,c,d, e,f,g,h, ...}. The order in 0.10.2 is column-major; starting in 11.0 it's row-major instead.
... table Additional matrices of the same type as ''matrix'' to store in a uniform array.
Shader:send( name, texture )
name string Name of the Texture to send to the shader.
texture Texture Texture (Image or Canvas) to send to the uniform variable.
Shader:send( name, boolean, ... )
name string Name of the boolean to send to the shader.
boolean boolean Boolean to send to store in the uniform variable.
... boolean Additional booleans to send if the uniform variable is an array.
Shader:send( name, matrixlayout, matrix, ... )
name string Name of the matrix to send to the shader.
matrixlayout MatrixLayout The layout (row- or column-major) of the matrix.
matrix table 2x2, 3x3, or 4x4 matrix to send to the uniform variable. Using table form: {{a,b,c,d}, {e,f,g,h}, ... } or {a,b,c,d, e,f,g,h, ...}.
... table Additional matrices of the same type as ''matrix'' to store in a uniform array.
Shader:send( name, data, offset, size )
name string Name of the uniform to send to the shader.
data Data Data object containing the values to send.
offset (0) number Offset in bytes from the start of the Data object.
size (all) number Size in bytes of the data to send. If nil, as many bytes as the specified uniform uses will be copied.
Shader:send( name, data, matrixlayout, offset, size )
name string Name of the uniform matrix to send to the shader.
data Data Data object containing the values to send.
matrixlayout MatrixLayout The layout (row- or column-major) of the matrix in memory.
offset (0) number Offset in bytes from the start of the Data object.
size (all) number Size in bytes of the data to send. If nil, as many bytes as the specified uniform uses will be copied.
Shader:send( name, matrixlayout, data, offset, size )
name string Name of the uniform matrix to send to the shader.
matrixlayout MatrixLayout The layout (row- or column-major) of the matrix in memory.
data Data Data object containing the values to send.
offset (0) number Offset in bytes from the start of the Data object.
size (all) number Size in bytes of the data to send. If nil, as many bytes as the specified uniform uses will be copied.