URL: https://graphicscomputing.fr/cgp/reference/triangles_drawable/
Description: Triangle soup stored on the GPU, without connectivity, ready to be drawn.

# triangles_drawable

Triangle soup stored on the GPU, without connectivity, ready to be drawn.

Fields:

- `opengl_shader_structure default_shader` - Static shader shared by all triangles_drawable and used by default in initialize_data_on_gpu, loaded from shaders/mesh by the application.
- `opengl_texture_image_structure default_texture` - Static 1x1 white RGBA texture shared by all triangles_drawable and used by default in initialize_data_on_gpu.
- `opengl_shader_structure shader` - Shader program used to draw the triangles, which must be valid (non-zero id) at draw time.
- `opengl_texture_image_structure texture` - Main texture bound to texture unit 0 and sent to the uniform image_texture at draw time.
- `opengl_vbo_structure vbo_position` - VBO storing the vertex positions, three consecutive vertices per triangle, bound to shader location 0.
- `opengl_vbo_structure vbo_normal` - VBO storing the vertex normals, bound to shader location 1.
- `opengl_vbo_structure vbo_color` - VBO storing the vertex colors, bound to shader location 2.
- `opengl_vbo_structure vbo_uv` - VBO storing the vertex texture coordinates, bound to shader location 3.
- `GLuint vao` - OpenGL id of the Vertex Array Object describing the VBO layout, 0 when not initialized.
- `affine model` - Model transform of the drawable, reset to identity by initialize_data_on_gpu and clear.
- `affine_rts hierarchy_transform_model` - Additional transform applied before model in the model matrix sent to the shader.
- `material_mesh_drawable_phong material` - Phong material sent to the uniform struct material at draw time.
- `int vertex_number` - Number of vertices drawn with glDrawArrays (three per triangle).
- `std::map<std::string,opengl_texture_image_structure> supplementary_texture` - Additional textures keyed by uniform name and bound to texture units 1, 2, ... in the order of the map at draw time.

Functions taking it:

- `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).
