natiny_material_set_matrix
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
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
values16must point to 16 column-major floats and the named member must be amat4.- The same name is updated in every compatible block and stage. Unknown names
and non-
mat4members are reported and left unchanged.