natiny_model_set_color
void natiny_model_set_color(NatinyModel model, float r, float g, float b, float a);
Sets this model's tint - the per-model form of natiny_render_set_color, which a bulk draw has no way to set per object.
Parameters
| Name | Type | Description |
|---|---|---|
model |
NatinyModel |
Model handle |
r |
float |
Red, 0..1 |
g |
float |
Green, 0..1 |
b |
float |
Blue, 0..1 |
a |
float |
Alpha, 0..1 |
Example
natiny_model_set_color(buoy, 1.0f, 0.55f, 0.15f, 1.0f);
Notes
- Three tints multiply: the vertex colors the geometry carries, this model's, and the draw color. The draw color still modulates a whole pass while models differ inside it.
- A model starts white, which leaves the geometry and the draw color to themselves.
- With a custom material the tint reaches the shader only if the material reads the vertex color; the built-in material always does.