URL: https://graphicscomputing.fr/cgp/reference/uniform_generic_structure/
Description: Named uniform values (int, float, vec3, mat4...) sent to every shader.

# uniform_generic_structure

Named uniform values (int, float, vec3, mat4...) sent to every shader.

Fields:

- `std::map<std::string,int> uniform_int` - Integer uniforms to send, keyed by uniform name.
- `std::map<std::string,float> uniform_float` - Float uniforms to send, keyed by uniform name.
- `std::map<std::string,vec2> uniform_vec2` - vec2 uniforms to send, keyed by uniform name.
- `std::map<std::string,vec3> uniform_vec3` - vec3 uniforms to send, keyed by uniform name.
- `std::map<std::string,vec4> uniform_vec4` - vec4 uniforms to send, keyed by uniform name.
- `std::map<std::string,mat2> uniform_mat2` - mat2 uniforms to send, keyed by uniform name.
- `std::map<std::string,mat3> uniform_mat3` - mat3 uniforms to send, keyed by uniform name.
- `std::map<std::string,mat4> uniform_mat4` - mat4 uniforms to send, keyed by uniform name.

Functions taking it:

- `void draw(hierarchy_mesh_drawable const& drawable, environment_generic_structure const& environment = environment_generic_structure(), int instance_count = 1, bool expected_uniforms = true, uniform_generic_structure const& additional_uniforms = uniform_generic_structure())` - Draw every node of the hierarchy with draw(mesh_drawable); call update_local_to_global_coordinates() beforehand.
- `void draw_wireframe(hierarchy_mesh_drawable const& drawable, environment_generic_structure const& environment = environment_generic_structure(), vec3 const& color = { 0,0,1 }, int instance_count = 1, bool expected_uniforms = true, uniform_generic_structure const& additional_uniforms = uniform_generic_structure())` - Draw the triangle edges of every node of the hierarchy in a flat color (no effect with Emscripten/WebGL).
- `void draw(mesh_drawable const& drawable, environment_generic_structure const& environment = environment_generic_structure(), int instance_count = 1, bool expected_uniforms = true, uniform_generic_structure const& additional_uniforms = uniform_generic_structure(), GLenum draw_mode = GL_TRIANGLES, material_mesh_drawable_phong const* material_override = nullptr)` - Draw a mesh_drawable with its shader, textures, model and material, plus the environment and optional additional uniforms, possibly instanced or with an overriding material.
- `void draw_wireframe(mesh_drawable const& drawable, environment_generic_structure const& environment = environment_generic_structure(), vec3 const& color = {0,0,1}, int instance_count = 1, bool expected_uniforms = true, uniform_generic_structure const& additional_uniforms = uniform_generic_structure())` - Draw the triangle edges of a mesh_drawable in a flat color, slightly offset toward the camera (no effect with Emscripten/WebGL).
- `void draw(triangles_drawable const& drawable, environment_generic_structure const& environment = environment_generic_structure(), uniform_generic_structure const& additional_uniforms = uniform_generic_structure(), material_mesh_drawable_phong const* material_override = nullptr)` - Draw a non-indexed triangles_drawable (triangle soup) with its shader, texture, model and material, plus the environment and optional additional uniforms.
- `void draw_wireframe(triangles_drawable const& drawable, environment_generic_structure const& environment = environment_generic_structure(), vec3 const& color = {0,0,1}, uniform_generic_structure const& additional_uniforms = uniform_generic_structure())` - Draw the triangle edges of a triangles_drawable in a flat color, slightly offset toward the camera (no effect with Emscripten/WebGL).
