![]() |
DI-Guy SDK Documentation
13.6
|
This is an example implementation of a diguyUniformBufferUpdater it's responsible for translating api independent calls into OpenGL functionality. More...
#include <diguyOglUniformBuffer.h>
Public Member Functions | |
| diguyOglUniformBufferUpdater () | |
| virtual | ~diguyOglUniformBufferUpdater () |
| virtual void | initialize () override |
| virtual void | update () override |
| called before any drawing calls. More... | |
| virtual void | set_model_matrix (const float *matrix) override |
| Called as part of diguy scene traversing code. More... | |
| virtual void | set_view_matrix (const float *matrix) override |
| Called as part of diguy camera apply function. More... | |
| virtual void | get_view_matrix (float *matrix, int transpose) override |
| Needed by particle systems. More... | |
| virtual void | get_projection_matrix (float *matrix, int transpose) override |
| helper function if neede More... | |
| virtual void | set_projection_matrix (const float *matrix) override |
| Called as part of diguy camera apply function. More... | |
| virtual void | set_texture_matrix (const float *matrix) override |
| Needed for shadow casting. More... | |
| virtual void | set_material (const diguyGraphicsMaterial *material) override |
| This uniform material updater effectively replaces a subclassed graphics material in immediate mode, since that class just communicates old style OpenGL state values down to the shader. More... | |
| virtual void | set_material_color (float r, float g, float b, float a) override |
| needed for drawing helper objects More... | |
| virtual void | set_material_spec (float r, float g, float b, float shine) override |
| virtual void | set_fog (const diguyViewFog *fog) override |
| indicates the current diguy fog to use for rendering. Probably only relevant to DI-Guy Scenario More... | |
| virtual void | set_global_ambient_light (float r, float g, float b) override |
| Replacement for gl light model. More... | |
| virtual void | set_eye_position (float x, float y, float z) override |
| virtual void | set_use_global_ambient_material (int val) override |
| Indicates that when material bind happens the ambient value of the material should be ignored and the value from set_global_ambient_material() should be used. More... | |
| virtual int | get_use_global_ambient_material () override |
| virtual void | set_global_ambient_material (float r, float g, float b) override |
| virtual void | get_global_ambient_material (float **\return, float *g, float **< b >) override |
| </b > virtual void | set_light (int index, const diguyLightRenderDesc *light) override |
| See diguyOglUtils::update_lighting for an example of using this function to fill out uniform buffer. More... | |
| virtual void | set_num_active_lights (int num_lights) override |
| Called so shaders know how many lights to iterate through. More... | |
| virtual void | set_shadow_map_params (const diguyShadowMapParams *shadow_params) override |
| Used by DI-Guy Scenario to communicate shadow params to video card. More... | |
Public Member Functions inherited from diguyUniformBufferUpdater | |
| diguyUniformBufferUpdater () | |
| virtual | ~diguyUniformBufferUpdater () |
Public Attributes | |
| diguyOglPerFrameUniformBuffer | m_per_frame_ubo |
| data that will change infrequently, lights, fog, shadows, etc More... | |
| diguyOglTransformUniformBuffer | m_transform_stack_ubo |
| the equivalent of the OpenGL matrix stack More... | |
| diguyOglMaterialUniformBuffer | m_material_ubo |
| the equivalent of the OpenGL material structures More... | |
| GLhandleARB | m_uniform_transform_buffer_object |
| handles to Uniform buffers. More... | |
| GLhandleARB | m_uniform_material_buffer_object |
| GLhandleARB | m_uniform_per_frame_buffer_object |
Private Attributes | |
| int | m_per_frame_uniforms_needs_update |
| int | m_transform_stack_needs_update |
| const diguyGraphicsMaterial * | m_last_material |
| int | m_use_global_ambient_material |
| glm::vec4 | m_global_ambient_material |
This is an example implementation of a diguyUniformBufferUpdater it's responsible for translating api independent calls into OpenGL functionality.
With OpenGL 3.2 the fixed function pipeline is deprecated and the only way to communicate information to the video card is via uniforms. diguyOglUniformBufferUpdater is responsible for wrapping a number of uniform buffer objects that can be shared between shaders eliminating the need to resend the information for every shader.
| diguyOglUniformBufferUpdater::diguyOglUniformBufferUpdater | ( | ) |
|
virtual |
|
overridevirtual |
Implements diguyUniformBufferUpdater.
|
overridevirtual |
called before any drawing calls.
Implements diguyUniformBufferUpdater.
|
overridevirtual |
Called as part of diguy scene traversing code.
Typically called once per character draw Potentially called many times for scene objects.
Implements diguyUniformBufferUpdater.
|
overridevirtual |
Called as part of diguy camera apply function.
Presumably end users will want to call it themselves to setup the uniform buffer data.
Implements diguyUniformBufferUpdater.
|
overridevirtual |
Needed by particle systems.
Implements diguyUniformBufferUpdater.
|
overridevirtual |
helper function if neede
Implements diguyUniformBufferUpdater.
|
overridevirtual |
Called as part of diguy camera apply function.
Presumably end users will want to call it themselves to setup the uniform buffer data.
Implements diguyUniformBufferUpdater.
|
overridevirtual |
Needed for shadow casting.
This matrix will only be used for projecting light coordinates Probably only relevant to DI-Guy Scenario and shadowing examples.
Implements diguyUniformBufferUpdater.
|
overridevirtual |
This uniform material updater effectively replaces a subclassed graphics material in immediate mode, since that class just communicates old style OpenGL state values down to the shader.
Implements diguyUniformBufferUpdater.
|
overridevirtual |
needed for drawing helper objects
Implements diguyUniformBufferUpdater.
|
overridevirtual |
Implements diguyUniformBufferUpdater.
|
overridevirtual |
indicates the current diguy fog to use for rendering. Probably only relevant to DI-Guy Scenario
Implements diguyUniformBufferUpdater.
|
overridevirtual |
Replacement for gl light model.
Implements diguyUniformBufferUpdater.
|
overridevirtual |
Implements diguyUniformBufferUpdater.
|
inlineoverridevirtual |
Indicates that when material bind happens the ambient value of the material should be ignored and the value from set_global_ambient_material() should be used.
Implements diguyUniformBufferUpdater.
|
inlineoverridevirtual |
Implements diguyUniformBufferUpdater.
|
overridevirtual |
Implements diguyUniformBufferUpdater.
|
overridevirtual |
Implements diguyUniformBufferUpdater.
|
overridevirtual |
See diguyOglUtils::update_lighting for an example of using this function to fill out uniform buffer.
Light sources can be diguy global directional light in addition to particle systems and weapon effects.
Implements diguyUniformBufferUpdater.
|
overridevirtual |
Called so shaders know how many lights to iterate through.
Implements diguyUniformBufferUpdater.
|
overridevirtual |
Used by DI-Guy Scenario to communicate shadow params to video card.
Implements diguyUniformBufferUpdater.
| diguyOglPerFrameUniformBuffer diguyOglUniformBufferUpdater::m_per_frame_ubo |
data that will change infrequently, lights, fog, shadows, etc
| diguyOglTransformUniformBuffer diguyOglUniformBufferUpdater::m_transform_stack_ubo |
the equivalent of the OpenGL matrix stack
| diguyOglMaterialUniformBuffer diguyOglUniformBufferUpdater::m_material_ubo |
the equivalent of the OpenGL material structures
| GLhandleARB diguyOglUniformBufferUpdater::m_uniform_transform_buffer_object |
handles to Uniform buffers.
| GLhandleARB diguyOglUniformBufferUpdater::m_uniform_material_buffer_object |
| GLhandleARB diguyOglUniformBufferUpdater::m_uniform_per_frame_buffer_object |
|
private |
|
private |
|
private |
|
private |
|
private |