shader_set_uniform_matrix

Set a shader constant to the current transform matrix.

Syntax:

GML Code Example

shader_set_uniform_matrix(handle);


Argument Description
handle The handle of the shader constant to set.


Returns: N/A


Description

With this function you can set the value (or values) of a shader constant to the current transform matrix (as set using the D3D Transform Functions). You must previously have gotten the "handle" of the constant using the function shader_get_uniform.

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


Example:

GML Code Example

shader_set(shader_Glass);
 shader_matrix = shader_get_uniform(shader_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.





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