natiny_render_tag

C
void natiny_render_tag(const char* tag, uint32_t sort);
void natiny_render_tags(const char* const* tags, uint32_t count, uint32_t sort);

Draws every visible model and particle system whose own material has the requested tag. natiny_render_tags requires the material to have every requested tag. Per-part materials and a material bound with natiny_material_bind do not affect selection.

Parameters

Name Type Description
tag const char* One tag name
tags const char* const* Array of distinct tag names
count uint32_t Number of entries in tags; maximum 8
sort uint32_t Draw order; one of the NATINY_SORT_* constants below

Constants

Constant Value Description
NATINY_SORT_MATERIAL 0 Group by model material, then mesh
NATINY_SORT_NONE 1 Keep model storage order without sorting
NATINY_SORT_BACK_TO_FRONT 2 Sort model bounds centers from farthest to nearest
NATINY_SORT_FRONT_TO_BACK 3 Sort model bounds centers from nearest to farthest

Example

C
const char* tags[] = { "world", "transparent" };
natiny_render_tags(tags, 2, NATINY_SORT_BACK_TO_FRONT);