CGPdocs

environment_generic_structure

Environment shared by all draw calls (camera, projection, light, uniforms).

module 16_drawablesource: environment.hpp
environment_generic_structure is an empty base class; the environment_structure of the project template derives from it and holds the camera matrices, the light and the generic uniforms sent to every shader.
environment_generic_structure is an empty base class; the environment_structure of the project template derives from it and holds the camera matrices, the light and the generic uniforms sent to every shader. Tap to enlarge.
What draw(drawable, environment) sends to the shader: some uniforms come from the drawable, the others from the environment.
What draw(drawable, environment) sends to the shader: some uniforms come from the drawable, the others from the environment. Tap to enlarge.

Fields and methods

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

Fields

bool default_expected_uniform = trueStatic flag, true by default, used as the default value of expected in send_opengl_uniform; mesh_drawable combines it with its own flag, and false silences the warning for a uniform that the shader does not use.

Methods

Sends the uniform variables of the environment to the shader; does nothing in this base class and is meant to be overridden by a derived environment. src

Functions taking a environment_generic_structure

Draw 10

Documented on another page

  • drawDraw a curve_drawable as a line strip or as separate segments, limited to the first N_points points if N_points is not -1.on curve_drawable
  • drawDraw the N_valid_points points currently stored in a curve_drawable_dynamic_extend.on curve_drawable_dynamic_extend
  • 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 the skybox; call it first with depth writing disabled (glDepthMask(GL_FALSE)).on skybox_drawable
  • drawDraw the recorded positions of a trajectory_drawable as a polyline, if any.on trajectory_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 environment_generic_structure

None.

Operators

None.

CGP - Computer Graphics Programming.