natiny_material_set_texture
C
void natiny_material_set_texture(NatinyMaterial material, const char* texture_name, NatinyTexture texture, uint32_t min_filter, uint32_t mag_filter);
Assigns a texture to a named texture slot and configures its filtering. The
assigned texture overrides one supplied by a model or draw for the same slot.
Parameters
| Name |
Type |
Description |
material |
NatinyMaterial |
Material handle |
texture_name |
const char* |
Texture name declared in the shader |
texture |
NatinyTexture |
Texture handle; 0 selects the built-in white texture |
min_filter |
uint32_t |
Filter used when the texture is minified |
mag_filter |
uint32_t |
Filter used when the texture is magnified |
Filtering
| Constant |
Description |
NATINY_FILTER_LINEAR |
Blends neighbouring texels; minification also blends mip levels |
NATINY_FILTER_NEAREST |
Selects the nearest texel and mip level |
Example
C
natiny_material_set_texture(material, "albedo", texture, NATINY_FILTER_LINEAR, NATINY_FILTER_LINEAR);