shader_set_uniform_matrix

This function sets the value (or values) of a shader constant to the current transform matrix (as set using the Matrix Functions).

You must previously have gotten the "handle" of the constant using the function shader_get_uniform.

 

Syntax:

shader_set_uniform_matrix(handle);

Argument Type Description
handle Shader Uniform Handle The handle of the shader constant to set.

 

Returns:

N/A

 

Example:

shader_set(sh_glass);
shader_matrix = shader_get_uniform(sh_glass, "u_vMatrix");
shader_set_uniform_matrix(shader_matrix);
draw_self();
shader_reset();

The above code will get the handle of the shader constant u_vMatrix then set that constant to the current transform matrix.