Set a shader constant to an array of floating point values.


GML Code Example

shader_set_uniform_f_array(handle, array);

Argument Description
handle The handle of the shader constant to set.
array A previously initialised array of floating point values.

Returns: N/A


With this function you can set a shader constant to hold an array of values. You must previously have gotten the "handle" of the constant using the function shader_get_uniform, and you will have to have previously initialised the array.

NOTE: All uniforms must be set after calling the function shader_set(), and before calling shader_reset.


GML Code Example

 tex_array[0] = 0.5;
 tex_array[1] = 0.1;
 tex_array[2] = 0.25;
 shader_params = shader_get_uniform(shader_glass, "u_vParams");
 shader_set_uniform_f_array(shader_params, tex_array);

The above code will get the handle of the shader constant "u_vParams" then set that constant to the given array.

No Examples Submitted

Does this page need better examples? Be the first to Submit

No Edits Suggested

Is this page unclear or not descriptive enough? Suggest an edit to the page and with enough upvotes your changes will be made.

No Questions Have Been Ask

Do you have a question about this page? Ask it Here