Graphite
Version 3
An experimental 3D geometry processing program
|
GLUP context stores a Uniform Buffer Object with state variables similar to OpenGL's fixed functionality pipeline, and a set of Vertex Buffer Objects to emulate OpenGL's immediate mode. More...
#include <geogram_gfx/GLUP/GLUP_context.h>
Public Member Functions | |
Context () | |
Context constructor. | |
~Context () override | |
Context destructor. | |
virtual const char * | profile_name () const =0 |
Gets the profile name associated with this context. | |
virtual bool | primitive_supports_array_mode (GLUPprimitive prim) const |
Tests whether a given GLUP primitive supports array mode. More... | |
virtual void | setup () |
Creates the uniform state and GLSL programs. More... | |
virtual void | bind_uniform_state (GLuint program) |
Binds GLUP uniform state to a program. More... | |
void | load_matrix (const GLfloat m[16]) |
Replaces the top of the current matrix stack with the specified matrix. More... | |
void | load_matrix (const GLdouble m[16]) |
Replaces the top of the current matrix stack with the specified matrix. More... | |
void | load_identity () |
Replaces the top of the current matrix stack with the identity matrix. | |
void | mult_matrix (const GLdouble m[16]) |
Post-multiplies the top of the current matrix stack with the specified matrix. More... | |
void | push_matrix () |
Pushes a copy of the top of the current stack matrix onto the current stack matrix. More... | |
void | pop_matrix () |
Pops the top of the current stack matrix. | |
void | set_matrix_mode (GLUPmatrix matrix) |
Sets the current matrix stack. More... | |
GLUPmatrix | get_matrix_mode () const |
Gets the current matrix stack. More... | |
void | immediate_vertex (GLfloat x, GLfloat y, GLfloat z=0.0f, GLfloat w=1.0f) |
Creates a new vertex in the immediate mode buffers. More... | |
void | immediate_color (GLfloat r, GLfloat g, GLfloat b, GLfloat a=1.0f) |
Specifies the current color for the immediate mode buffers. More... | |
void | immediate_tex_coord (GLfloat s, GLfloat t=0.0f, GLfloat u=0.0f, GLfloat v=1.0f) |
Specifies the current texture coordinates for the immediate mode buffers. More... | |
void | immediate_normal (GLfloat x, GLfloat y, GLfloat z) |
Specifies the current normal vector for the immediate mode buffers. More... | |
void | set_user_program (GLuint program) |
Sets the user program, to be used instead of the default GLUP programs for drawing the primitives. | |
virtual void | begin (GLUPprimitive primitive) |
Begins rendering in immediate mode. More... | |
virtual void | end () |
Ends rendering in immediate mode. More... | |
virtual void | draw_arrays (GLUPprimitive primitive, GLUPint first, GLUPsizei count) |
Draws primitives using current OpenGL array bindings. More... | |
virtual void | draw_elements (GLUPprimitive primitive, GLUPsizei count, GLUPenum type, const GLUPvoid *indices) |
Draws primitives using current OpenGL array bindings. More... | |
virtual Memory::pointer | get_state_variable_address (const char *name) |
Gets a pointer to the representation of a uniform state variable in host memory from its (unqualified) name. More... | |
UniformState & | uniform_state () |
Gets the uniform state. More... | |
const UniformState & | uniform_state () const |
Gets the uniform state. More... | |
void | flag_uniform_buffer_as_dirty () |
Indicates that the OpenGL representation of the uniform state is no longer in sync with the local copy. | |
void | flag_lighting_as_dirty () |
Indicates that cached lighting information needs to be recomputed. | |
void | flag_matrices_as_dirty () |
Indicates that cached matrix information needs to be recomputed. | |
GLUPdouble * | get_matrix (GLUPmatrix matrix) |
Gets a pointer to the values of the matrix at the top of a given stack. More... | |
virtual void | get_vertex_shader_preamble_pseudo_file (std::vector< GLSL::Source > &sources) |
Gets the content of the virtual file GLUP/current_profile/vertex_shader_preamble.h. More... | |
virtual void | get_fragment_shader_preamble_pseudo_file (std::vector< GLSL::Source > &sources) |
Gets the content of the virtual file GLUP/current_profile/fragment_shader_preamble.h. More... | |
virtual void | get_geometry_shader_preamble_pseudo_file (std::vector< GLSL::Source > &sources) |
Gets the content of the virtual file GLUP/current_profile/geometry_shader_preamble.h. More... | |
virtual void | get_tess_control_shader_preamble_pseudo_file (std::vector< GLSL::Source > &sources) |
Gets the content of the virtual file GLUP/current_profile/tess_control_shader_preamble.h. More... | |
virtual void | get_tess_evaluation_shader_preamble_pseudo_file (std::vector< GLSL::Source > &sources) |
Gets the content of the virtual file GLUP/current_profile/tess_evaluation_shader_preamble.h. More... | |
virtual void | get_toggles_pseudo_file (std::vector< GLSL::Source > &sources) |
Gets the content of the virtual file GLUP/current_profile/toggles.h. More... | |
virtual void | get_primitive_pseudo_file (std::vector< GLSL::Source > &sources) |
Gets the content of the virtual file GLUP/current_profile/primitive.h. More... | |
virtual void | get_marching_cells_pseudo_file (std::vector< GLSL::Source > &sources) |
Gets the content of the virtual file GLUP/current_profile/marching_cells.h. More... | |
void | setup_shaders_source_for_toggles (GLUPbitfield toggles_state, GLUPbitfield toggles_undetermined=0) |
Sets the string that describes the settings of the toggles for a given configuration. More... | |
virtual void | setup_shaders_source_for_primitive (GLUPprimitive primitive) |
Sets the configurable GLSL sources for a given primitive type. More... | |
ImmediateState & | immediate_state () |
Gets the immediate state. More... | |
virtual void | flush_immediate_buffers () |
Flushes the immediate mode buffers. | |
Public Member Functions inherited from GEO::GLSL::PseudoFileProvider | |
virtual | ~PseudoFileProvider () |
PseudoFileProvider destructor. | |
Static Public Member Functions | |
static const char * | uniform_state_declaration () |
Gets the GLSL declaration of GLUP uniform state. More... | |
static const char * | glup_primitive_name (GLUPprimitive prim) |
Gets the name of a primitive by GLUPprimitive. More... | |
Protected Member Functions | |
const MarchingCell & | get_marching_cell () const |
Gets the MarchingCell that corresponds to the current primitive. More... | |
bool | extension_is_supported (const std::string &extension) |
Tests whether an OpenGL extension is supported. More... | |
virtual void | prepare_to_draw (GLUPprimitive primitive) |
This function is called before starting to render primitives. It is called by begin(), draw_arrays() and draw_elements(). More... | |
virtual void | done_draw (GLUPprimitive primitive) |
This function is called right after rendering primitives. It is called by end(), draw_arrays() and draw_elements(). More... | |
virtual void | setup_state_variables () |
Initializes the representation of the uniform state. | |
virtual void | setup_immediate_buffers () |
Set-ups the buffers for immediate rendering. More... | |
virtual void | stream_immediate_buffers () |
Sends all the active immediate buffers to the GPU. More... | |
virtual void | setup_primitives () |
Setups the programs and VAOs used for each primitive. | |
virtual void | setup_GLUP_POINTS () |
Setups GLSL programs for points. | |
virtual void | setup_GLUP_LINES () |
Setups GLSL programs for lines. | |
virtual void | setup_GLUP_THICK_LINES () |
Setups GLSL programs for lines with width > 1. | |
virtual void | setup_GLUP_TRIANGLES () |
Setups GLSL programs for triangles. | |
virtual void | setup_GLUP_QUADS () |
Setups GLSL programs for quads. | |
virtual void | setup_GLUP_TETRAHEDRA () |
Setups GLSL programs for tetrahedra. | |
virtual void | setup_GLUP_HEXAHEDRA () |
Setups GLSL programs for hexahedra. | |
virtual void | setup_GLUP_PRISMS () |
Setups GLSL programs for prisms. | |
virtual void | setup_GLUP_PYRAMIDS () |
Setups GLSL programs for pyramids. | |
virtual void | setup_GLUP_CONNECTORS () |
Setups GLSL programs for connectors. | |
virtual void | setup_GLUP_SPHERES () |
Setups GLSL programs for spheres. | |
virtual void | set_primitive_info (GLUPprimitive glup_primitive, GLenum gl_primitive, GLuint program, bool bind_attrib_loc_and_link=true) |
Initializes the PrimitiveInfo associated with a given GLUP primitive. More... | |
virtual void | set_primitive_info_vertex_gather_mode (GLUPprimitive glup_primitive, GLenum gl_primitive, GLuint program) |
Initializes the PrimitiveInfo associated with a given GLUP primitive in vertex-gather mode. More... | |
virtual void | set_primitive_info_immediate_index_mode (GLUPprimitive glup_primitive, GLenum gl_primitive, GLuint program, index_t nb_elements_per_glup_primitive, index_t *element_indices) |
Initializes the PrimitiveInfo associated with a given GLUP primitive in immediate mode when an element index buffer is required. More... | |
void | update_uniform_buffer () |
Copies GLUP uniform state to OpenGL if required. | |
virtual void | do_update_uniform_buffer () |
Copies GLUP uniform state to OpenGL. More... | |
virtual void | update_matrices () |
Updates the matrices in the uniform state from the matrices in the stacks. | |
virtual void | update_lighting () |
Updates the lighting in the uniform state. More... | |
virtual void | update_base_picking_id (GLint new_value) |
Updates the base picking id and sends it to OpenGL. | |
std::string | primitive_declaration (GLUPprimitive prim) const |
Gets the GLSL declaration of the constant that indicates the current primitive. More... | |
void | setup_shaders_source_for_toggles_config (PrimitiveInfo::ShaderKey toggles_config) |
Sets the string that describes the settings of the toggles for a given configuration. More... | |
void | update_toggles_config () |
Updates the toggles_config_ state variable from the individual state of each toggle. | |
void | create_program_if_needed (GLUPprimitive primitive) |
Creates the GLSL shader that corresponds to the specified primitive and current toggles configuration if not already initialized. More... | |
void | shrink_cells_in_immediate_buffers () |
Shrinks the cells in the immediate buffer. More... | |
void | create_CPU_side_uniform_buffer () |
Creates a buffer for uniform variables for implementations that do not support uniform buffer objects. More... | |
void | bind_immediate_state_buffers_to_VAO () |
Binds the VBOs associated with the immediate state buffers to the currently bound VAO. | |
void | classify_vertices_in_immediate_buffers () |
Updates v_is_visible_[] according to current clipping plane. More... | |
bool | cell_is_clipped (index_t first_v) |
Tests whether the cell starting at a given vertex in the immediate buffer is clipped, according to current clipping mode and current primitive type. More... | |
index_t | get_config (index_t first_v, index_t nb_v) |
Assemble the configuration code of a primitive relative to the clipping plane. More... | |
void | compute_intersection (index_t v1, index_t v2, index_t vi) |
Computes the intersection between the clipping plane and a segment. More... | |
virtual void | copy_uniform_state_to_current_program () |
Copies the uniform state from client-side memory into the currently bound program, or does nothing if uniform buffer objects are supported. | |
void | use_program (GLuint program) |
A wrapper around glUseProgram that tests whether uniform state needs to be sent to the program. More... | |
void | create_vertex_id_VBO () |
Creates a vertex buffer object with 16 bits integers between 0 and 65535. More... | |
Static Protected Member Functions | |
static void | initialize () |
Protected Attributes | |
GLuint | default_program_ |
GLuint | uniform_buffer_ |
GLuint | uniform_binding_point_ |
GLint | uniform_buffer_size_ |
bool | uniform_buffer_dirty_ |
Memory::byte * | uniform_buffer_data_ |
UniformState | uniform_state_ |
bool | lighting_dirty_ |
GLUPmatrix | matrix_mode_ |
MatrixStack | matrix_stack_ [3] |
bool | matrices_dirty_ |
index_t | nb_vertices_per_primitive_ [GLUP_NB_PRIMITIVES] |
Number of vertices per primitive (3 for GLUP_TRIANGLES, 4 for GLUP_QUADS etc...) More... | |
ImmediateState | immediate_state_ |
vector< PrimitiveInfo > | primitive_info_ |
MarchingCell | marching_tet_ |
MarchingCell | marching_hex_ |
MarchingCell | marching_prism_ |
MarchingCell | marching_pyramid_ |
MarchingCell | marching_connector_ |
GLuint | user_program_ |
PrimitiveInfo::ShaderKey | toggles_config_ |
GLUPprimitive | primitive_source_ |
GLUPbitfield | toggles_source_state_ |
GLUPbitfield | toggles_source_undetermined_ |
bool | precompile_shaders_ |
bool | use_core_profile_ |
bool | use_ES_profile_ |
GLUPfloat * | world_clip_plane_ |
Cached pointer to uniform state variable. More... | |
std::map< std::string, GLsizei > | variable_to_offset_ |
Used by GPU-side uniform buffer. More... | |
bool | v_is_visible_ [IMMEDIATE_BUFFER_SIZE] |
Indicates for a given vertex whether it is clipped or is visible, according to the current clipping plane. More... | |
GLUPfloat | isect_vertex_attribute_ [3][12 *4] |
computed intersections. More... | |
GLuint | latest_program_ |
Latest used GLSL program. More... | |
GLuint | vertex_id_VBO_ |
A vertex buffer object with 65536 16 bits integers. More... | |
GLUP context stores a Uniform Buffer Object with state variables similar to OpenGL's fixed functionality pipeline, and a set of Vertex Buffer Objects to emulate OpenGL's immediate mode.
Definition at line 1093 of file GLUP_context.h.
|
virtual |
Begins rendering in immediate mode.
[in] | primitive | the primitive to be rendered. |
|
virtual |
Binds GLUP uniform state to a program.
[in] | program | the id of the GLSL program |
If the program uses GLUP, then it binds the program to GLUP uniform state, else this function does nothing.
|
protected |
Tests whether the cell starting at a given vertex in the immediate buffer is clipped, according to current clipping mode and current primitive type.
[in] | first_v | index of the first vertex of the cell in the immediate buffer |
true | if the cell starting at first_v in the immediate buffer is clipped-out |
false | otherwise |
|
protected |
Updates v_is_visible_[] according to current clipping plane.
Used by implementations of Context that do not support clipping by shaders (ES2).
Computes the intersection between the clipping plane and a segment.
[in] | v1 | index of the first extremity of the segment in the immediate buffer |
[in] | v2 | index of the second extremity of the segment in the immediate buffer |
[in] | vi | index of where to wrote the intersection in the isect_xxx arrays |
Definition at line 1867 of file GLUP_context.h.
|
protected |
Creates a buffer for uniform variables for implementations that do not support uniform buffer objects.
This function is used by ES2.
|
protected |
Creates the GLSL shader that corresponds to the specified primitive and current toggles configuration if not already initialized.
[in] | primitive | the primitive to be displayed |
|
protected |
Creates a vertex buffer object with 16 bits integers between 0 and 65535.
It is used to emulate gl_VertexID if GLSL does not support it.
|
protectedvirtual |
Copies GLUP uniform state to OpenGL.
This is the implementation of update_uniform_buffer().
|
protectedvirtual |
This function is called right after rendering primitives. It is called by end(), draw_arrays() and draw_elements().
Default implementation does nothing. This function is meant to be overloaded by derived Context classes.
|
virtual |
Draws primitives using current OpenGL array bindings.
This function operates just like glDrawArrays(), except that its primitive
argument is a GLUPprimitive instead of regular OpenGL primitive. Internally it uses a (possibly different) OpenGL primitive, as well as a GLSL program to reinterpret it.
[in] | primitive | the GLUP primitive type |
[in] | first | first index to be rendered |
[in] | count | number of vertices to be rendered |
|
virtual |
Draws primitives using current OpenGL array bindings.
This function operates just like glDrawElements(), except that its primitive
argument is a GLUPprimitive instead of regular OpenGL primitive. Internally it uses a (possibly different) OpenGL primitive, as well as a GLSL program to reinterpret it.
[in] | primitive | the GLUP primitive type |
[in] | count | number of vertices to be rendered |
[in] | type | type of element indices, as one of GL_UNSIGNED_BYTE, GL_UNSIGNED_SHORT, or GL_UNSIGNED_INT |
[in] | indices | a pointer to where the indices are stored. |
|
virtual |
Ends rendering in immediate mode.
|
protected |
Tests whether an OpenGL extension is supported.
[in] | extension | the name fo the extension to be tested. |
This function needs to be called before starting using the extension, even if you are sure that it is supported. In particular, WebGL specification requires that.
true | if the extension is supported. |
false | otherwise. |
Assemble the configuration code of a primitive relative to the clipping plane.
[in] | first_v | index of the first vertex of the primitive in the immediate buffer |
[in] | nb_v | number of vertices of the primitive |
Definition at line 1847 of file GLUP_context.h.
|
virtual |
Gets the content of the virtual file GLUP/current_profile/fragment_shader_preamble.h.
[in,out] | sources | where the content of the virtual file should be appended |
|
virtual |
Gets the content of the virtual file GLUP/current_profile/geometry_shader_preamble.h.
[in,out] | sources | where the content of the virtual file should be appended |
|
protected |
Gets the MarchingCell that corresponds to the current primitive.
The current primitive is defined by the argument of the previous call of setup_shaders_source_for_primitive().
|
virtual |
Gets the content of the virtual file GLUP/current_profile/marching_cells.h.
The current primitive is defined by the argument of the previous call of setup_shaders_source_for_primitive().
[in,out] | sources | where the content of the virtual file should be appended |
|
inline |
Gets a pointer to the values of the matrix at the top of a given stack.
[in] | matrix | name of the stack, one of GLUP_MODELVIEW_MATRIX, GLUP_PROJECTION_MATRIX, GLUP_TEXTURE_MATRIX |
Definition at line 1394 of file GLUP_context.h.
|
inline |
Gets the current matrix stack.
Definition at line 1223 of file GLUP_context.h.
|
virtual |
Gets the content of the virtual file GLUP/current_profile/primitive.h.
The current primitive is defined by the argument of the previous call of setup_shaders_source_for_primitive().
[in,out] | sources | where the content of the virtual file should be appended |
|
virtual |
Gets a pointer to the representation of a uniform state variable in host memory from its (unqualified) name.
[in] | name | the name of the variable, without the suffix "GLUPStateBlock." |
|
virtual |
Gets the content of the virtual file GLUP/current_profile/tess_control_shader_preamble.h.
[in,out] | sources | where the content of the virtual file should be appended |
|
virtual |
Gets the content of the virtual file GLUP/current_profile/tess_evaluation_shader_preamble.h.
[in,out] | sources | where the content of the virtual file should be appended |
|
virtual |
Gets the content of the virtual file GLUP/current_profile/toggles.h.
The toggles are generated in function of the parameters of the previous call to setup_shaders_source_for_toggles() current configuration defined by prepare_sources_for_toggles()
[in,out] | sources | where the content of the virtual file should be appended |
|
virtual |
Gets the content of the virtual file GLUP/current_profile/vertex_shader_preamble.h.
[in,out] | sources | where the content of the virtual file should be appended |
|
static |
Gets the name of a primitive by GLUPprimitive.
[in] | prim | a GLUPprimitive |
|
inline |
Specifies the current color for the immediate mode buffers.
[in] | r,g,b,a | the components of the current color. |
Definition at line 1250 of file GLUP_context.h.
|
inline |
Specifies the current normal vector for the immediate mode buffers.
[in] | x,y,z | the current normal vector coordinates. |
Definition at line 1274 of file GLUP_context.h.
|
inline |
Gets the immediate state.
Definition at line 1516 of file GLUP_context.h.
|
inline |
Specifies the current texture coordinates for the immediate mode buffers.
[in] | s,t,u,v | the current texture coordinates. |
Definition at line 1261 of file GLUP_context.h.
|
inline |
Creates a new vertex in the immediate mode buffers.
[in] | x,y,z,w | the coordinates of the vertex |
The color and texture coordinates of the new vertex are initialized from the current color and current texture coordinates.
Definition at line 1235 of file GLUP_context.h.
|
inline |
Replaces the top of the current matrix stack with the specified matrix.
[in] | m | the matrix that will replace the top of the current matrix stack |
Definition at line 1164 of file GLUP_context.h.
|
inline |
Replaces the top of the current matrix stack with the specified matrix.
[in] | m | the matrix that will replace the top of the current matrix stack |
Definition at line 1153 of file GLUP_context.h.
|
inline |
Post-multiplies the top of the current matrix stack with the specified matrix.
[in] | m | the matrix that will post-multiply the top of the current matrix stack. |
Definition at line 1185 of file GLUP_context.h.
|
protectedvirtual |
This function is called before starting to render primitives. It is called by begin(), draw_arrays() and draw_elements().
Some primitives require to change some parameters in OpenGL. For instance, when we use GL_PATCH to gather the vertices of hexahedra and tetrahedra, the number of vertices per patch needs to be specified to OpenGL.
|
protected |
Gets the GLSL declaration of the constant that indicates the current primitive.
|
virtual |
Tests whether a given GLUP primitive supports array mode.
If array mode is supported, then one can use glupDrawArray() and glupDrawElements() with the specified primitive.
[in] | prim | the primitive to be tested. |
true | if array mode is supported with prim |
false | otherwise |
|
inline |
Pushes a copy of the top of the current stack matrix onto the current stack matrix.
Definition at line 1196 of file GLUP_context.h.
|
inline |
Sets the current matrix stack.
[in] | matrix | one of GLUP_MODELVIEW, GLUP_PROJECT |
This determines on which matrix stack set_matrix(), mult_matrix(), push_matrix() and pop_matrix() operate.
Definition at line 1214 of file GLUP_context.h.
|
protectedvirtual |
Initializes the PrimitiveInfo associated with a given GLUP primitive.
[in] | glup_primitive | the GLUP primitive. |
[in] | gl_primitive | the GL primitive used by the implementation |
[in] | program | the GLSL program used by the implementation |
[in] | bind_attrib_loc_and_link | if true, binds attribute location and links the shader |
|
protectedvirtual |
Initializes the PrimitiveInfo associated with a given GLUP primitive in immediate mode when an element index buffer is required.
An element index buffer is required when geometry shaders are not supported, for instance when using OpenGL ES in webGL.
[in] | glup_primitive | the GLUP primitive. |
[in] | gl_primitive | the GL primitive used to display the GLUP primitive. |
[in] | program | the GLSL program used by the implementation. |
[in] | nb_elements_per_glup_primitive | the number of element indices for each glup primitive. For instance, when drawing GLUP tetrahedra using OpenGL triangles, there are 4*3 = 12 elements per primitive. |
[in] | element_indices | a pointer to an array of nb_elements_per_glup_primitive integers that encode the indexing of one element. This array is replicated and shifted to generate the element index buffer. |
|
protectedvirtual |
Initializes the PrimitiveInfo associated with a given GLUP primitive in vertex-gather mode.
In vertex-gather mode, all the coordinates of all vertices and all attributes of the primitive are gathered into a small number of vertices. This is required by primitives that have a number of vertices that corresponds to no existing OpenGL primitive (i.e., hexahedron and pyramid).
[in] | glup_primitive | the GLUP primitive. |
[in] | gl_primitive | the GL primitive used to display the GLUP primitive. The number of vertices of the GL primitive needs to be a divisor of the number of vertices of the GLUP primitive. |
[in] | program | the GLSL program used by the implementation |
|
virtual |
Creates the uniform state and GLSL programs.
This function may throw exceptions if GLSL functionalities are not implemented in the OpenGL driver.
|
protectedvirtual |
Set-ups the buffers for immediate rendering.
This creates VBOs and the VAO.
|
virtual |
Sets the configurable GLSL sources for a given primitive type.
This function needs to be called before compiling the GLSL program.
[in] | primitive | the GLUP primitive |
void GLUP::Context::setup_shaders_source_for_toggles | ( | GLUPbitfield | toggles_state, |
GLUPbitfield | toggles_undetermined = 0 |
||
) |
Sets the string that describes the settings of the toggles for a given configuration.
[in] | toggles_state | an unsigned integer, with its bits corresponding to the state of each toggle |
[in] | toggles_undetermined | an unsigned integer, with its bits set if the corresponding toggle state needs to be determined dynamically from GLUP state |
|
inlineprotected |
Sets the string that describes the settings of the toggles for a given configuration.
[in] | toggles_config | the identifier of the toggles configurations, used to index the GLSL program in the PrimitiveInfo class |
Definition at line 1764 of file GLUP_context.h.
|
protected |
Shrinks the cells in the immediate buffer.
Applies the shrinking factor (state variable "cells_shrink") to all the cells stored in the current immediate buffer. Since there is no function to query the content of the current buffer, modidying it is acceptable. This function is used by derived classes (VanillaGL and ES2) that cannot shrink the cells with a shader.
|
protectedvirtual |
Sends all the active immediate buffers to the GPU.
Overwrites the VBOs with the contents of the buffers.
|
inline |
Gets the uniform state.
Definition at line 1348 of file GLUP_context.h.
|
inline |
Gets the uniform state.
Definition at line 1356 of file GLUP_context.h.
|
static |
Gets the GLSL declaration of GLUP uniform state.
Can be used by client-code shaders that need to have access to the GLUP uniform state. This corresponds to the contents of GLUPGLSL/state.h
|
protectedvirtual |
Updates the lighting in the uniform state.
Computes the half vector from the lighting vector.
|
inlineprotected |
A wrapper around glUseProgram that tests whether uniform state needs to be sent to the program.
Each time a different program is used, the uniform state can be sent to it through the virtual function update_program_state(). If UBOs are supported, update_program_state() does nothing.
Definition at line 1925 of file GLUP_context.h.
|
protected |
computed intersections.
Used when clipping mode is GLUP_CLIP_SLICE_CELLS and clipping is done by software.
Definition at line 2030 of file GLUP_context.h.
|
protected |
Latest used GLSL program.
Used to check whether it changed and whether some uniform variables need to be sent to it.
Definition at line 2037 of file GLUP_context.h.
|
protected |
Number of vertices per primitive (3 for GLUP_TRIANGLES, 4 for GLUP_QUADS etc...)
It is stored as a class member array rather than a static array so that particular implementations can change it according to the needs (for instance, GLUPES profile temporarily uses quads with for vertices to render GLUP_THICK_LINES).
Definition at line 1973 of file GLUP_context.h.
|
protected |
Indicates for a given vertex whether it is clipped or is visible, according to the current clipping plane.
Used when clipping is done by software.
Definition at line 2023 of file GLUP_context.h.
|
protected |
Used by GPU-side uniform buffer.
It is initialized by create_GPU_side_uniform_buffer(), used only by VanillaGL and ES2 implementations.
Definition at line 2016 of file GLUP_context.h.
|
protected |
A vertex buffer object with 65536 16 bits integers.
It is used to emulate gl_VertexID in shaders.
Definition at line 2043 of file GLUP_context.h.
|
protected |
Cached pointer to uniform state variable.
It is initialized by create_GPU_side_uniform_buffer(), used only by VanillaGL and ES2 implementations.
Definition at line 2009 of file GLUP_context.h.