CGPdocs

uniform_generic_structure

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

module 13_openglsource: uniform.hpp

Fields and methods

Members of the struct uniform_generic_structure. Most of what you do with a CGP type goes through the free functions listed below.

Fields

std::map<std::string,int> uniform_intInteger uniforms to send, keyed by uniform name.
std::map<std::string,float> uniform_floatFloat uniforms to send, keyed by uniform name.
std::map<std::string,vec2> uniform_vec2vec2 uniforms to send, keyed by uniform name.
std::map<std::string,vec3> uniform_vec3vec3 uniforms to send, keyed by uniform name.
std::map<std::string,vec4> uniform_vec4vec4 uniforms to send, keyed by uniform name.
std::map<std::string,mat2> uniform_mat2mat2 uniforms to send, keyed by uniform name.
std::map<std::string,mat3> uniform_mat3mat3 uniforms to send, keyed by uniform name.
std::map<std::string,mat4> uniform_mat4mat4 uniforms to send, keyed by uniform name.

Methods

Sends every stored uniform to the shader, which must be in use, warning for a name absent from the shader when expected is true. src

Functions taking a uniform_generic_structure

Draw 6

Documented on another page

  • drawDraw every node of the hierarchy with draw(mesh_drawable); call update_local_to_global_coordinates() beforehand.on hierarchy_mesh_drawable
  • drawDraw a mesh_drawable with its shader, textures, model and material, plus the environment and optional additional uniforms, possibly instanced or with an overriding material.on mesh_drawable
  • drawDraw a non-indexed triangles_drawable (triangle soup) with its shader, texture, model and material, plus the environment and optional additional uniforms.on triangles_drawable
  • draw_wireframeDraw the triangle edges of every node of the hierarchy in a flat color (no effect with Emscripten/WebGL).on hierarchy_mesh_drawable
  • draw_wireframeDraw the triangle edges of a mesh_drawable in a flat color, slightly offset toward the camera (no effect with Emscripten/WebGL).on mesh_drawable
  • draw_wireframeDraw the triangle edges of a triangles_drawable in a flat color, slightly offset toward the camera (no effect with Emscripten/WebGL).on triangles_drawable

Functions returning a uniform_generic_structure

None.

Operators

None.

CGP - Computer Graphics Programming.