Final docs

This commit is contained in:
2026-06-16 13:07:21 -05:00
parent c0a2ae234f
commit 43d0593872
4 changed files with 127 additions and 22 deletions
+15 -2
View File
@@ -43,8 +43,21 @@ typedef union shadermaterial_u {
} shadermaterial_t;
```
`shaderunlitmaterial_t` typically holds a `texture_t *` and a
tint colour. Check `shaderunlitmaterial.h` for the exact fields.
`shaderunlitmaterial_t` fields:
```c
typedef struct {
color_t color; // tint colour (multiplied with the texture sample)
texture_t *texture; // NULL uses TEXTURE_WHITE (solid colour draw)
} shaderunlitmaterial_t;
```
The shader exposes uniforms `u_Proj`, `u_View`, `u_Model` (mat4),
`u_Texture` (sampler), and `u_Color` (vec4). They are uploaded via
`shaderUnlitSetMaterial(shader, material)`.
A global singleton `SHADER_UNLIT` is the live shader object;
`SHADER_UNLIT_DEFINITION` is its platform definition descriptor.
To use a shader material on a renderable entity: