natiny_material_set_matrix

C
void natiny_material_set_matrix(NatinyMaterial material, const char* name,
                                const float* values16);

Sets a mat4 constant by name. values16 is 16 floats in column-major order, the order GLSL uses.

Parameters

Name Type Description
material NatinyMaterial Material handle
name const char* Member name inside one of the shader's uniform blocks
values16 const float* 16 floats, column-major

Example

C
float m[16] = { 1,0,0,0,  0,1,0,0,  0,0,1,0,  0,0,0,1 };
natiny_material_set_matrix(material, "mtx_custom", m);

Notes

  • values16 must point to 16 column-major floats and the named member must be a mat4.
  • The same name is updated in every compatible block and stage. Unknown names and non-mat4 members are reported and left unchanged.