Visualization Library 2.1.0

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Renderer.cpp
Go to the documentation of this file.
1 /**************************************************************************************/
2 /* */
3 /* Visualization Library */
4 /* http://visualizationlibrary.org */
5 /* */
6 /* Copyright (c) 2005-2020, Michele Bosi */
7 /* All rights reserved. */
8 /* */
9 /* Redistribution and use in source and binary forms, with or without modification, */
10 /* are permitted provided that the following conditions are met: */
11 /* */
12 /* - Redistributions of source code must retain the above copyright notice, this */
13 /* list of conditions and the following disclaimer. */
14 /* */
15 /* - Redistributions in binary form must reproduce the above copyright notice, this */
16 /* list of conditions and the following disclaimer in the documentation and/or */
17 /* other materials provided with the distribution. */
18 /* */
19 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND */
20 /* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED */
21 /* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE */
22 /* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR */
23 /* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES */
24 /* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; */
25 /* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON */
26 /* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT */
27 /* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
28 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
29 /* */
30 /**************************************************************************************/
31 
33 #include <vlCore/Say.hpp>
35 #include <vlGraphics/Renderer.hpp>
37 #include <vlGraphics/GLSL.hpp>
39 #include <vlCore/Log.hpp>
40 
41 using namespace vl;
42 
43 //------------------------------------------------------------------------------
44 // Renderer
45 //------------------------------------------------------------------------------
47 {
48  VL_DEBUG_SET_OBJECT_NAME()
49 
51 
54 }
55 //------------------------------------------------------------------------------
56 namespace
57 {
58  struct GLSLProgState
59  {
60  public:
61  GLSLProgState(): mCamera(NULL), mTransform(NULL), mGLSLProgUniformSet(NULL), mShaderUniformSet(NULL), mActorUniformSet(NULL) {}
62 
63  bool operator<(const GLSLProgState& other) const
64  {
65  if ( mCamera != other.mCamera )
66  return mCamera < other.mCamera;
67  else
68  if ( mTransform != other.mTransform )
69  return mTransform < other.mTransform;
70  else
71  if ( mGLSLProgUniformSet != other.mGLSLProgUniformSet )
72  return mGLSLProgUniformSet < other.mGLSLProgUniformSet;
73  else
74  if ( mShaderUniformSet != other.mShaderUniformSet )
75  return mShaderUniformSet < other.mShaderUniformSet;
76  else
77  return mActorUniformSet < other.mActorUniformSet;
78  }
79 
80  const Camera* mCamera;
81  const Transform* mTransform;
82  const UniformSet* mGLSLProgUniformSet;
83  const UniformSet* mShaderUniformSet;
84  const UniformSet* mActorUniformSet;
85  };
86 }
87 //------------------------------------------------------------------------------
88 const RenderQueue* Renderer::renderRaw(const RenderQueue* render_queue, Camera* camera, real frame_clock) {
89 
90  // FIXME: use a small & simple hash-map<int, GLSLProgState> allocated on the stack
91  // mapping the GLSL program ID to the corresponding GLSLProgState.
92  std::map<const GLSLProgram*, GLSLProgState> glslprogram_map;
93 
94  OpenGLContext* opengl_context = framebuffer()->openglContext();
95 
96  // --------------- default scissor ---------------
97 
98  // non GLSLProgram state sets
99  const RenderStateSet* cur_render_state_set = NULL;
100  const EnableSet* cur_enable_set = NULL;
101  const Scissor* cur_scissor = NULL;
102 
103  // scissor the viewport by default: needed for points and lines since they are not clipped against the viewport
104  // this is already setup by the Viewport
105  /*
106  glEnable(GL_SCISSOR_TEST);
107  glScissor(camera->viewport()->x(), camera->viewport()->y(), camera->viewport()->width(), camera->viewport()->height());
108  */
109 
110  // --------------- rendering ---------------
111 
112  for(int itok=0; itok < render_queue->size(); ++itok)
113  {
114  const RenderToken* tok = render_queue->at(itok); VL_CHECK(tok);
115  Actor* actor = tok->mActor; VL_CHECK(actor);
116 
117  if ( ! isEnabled( actor ) ) {
118  continue;
119  }
120 
121  // --------------- Actor's scissor ---------------
122 
123  // MIC FIXME:
124  // this kind of scissor management is not particularly elegant.
125  // It is required mainly for convenience for the vector graphics that allow the specification of a clipping
126  // rectangular area at any point in the rendering. We must also find a good general solution to support
127  // indexed scissoring and viewport.
128 
129  const Scissor* scissor = actor->scissor() ? actor->scissor() : tok->mShader->scissor();
130  if (cur_scissor != scissor)
131  {
132  cur_scissor = scissor;
133  if (cur_scissor)
134  {
135  cur_scissor->enable(camera->viewport());
136  }
137  else
138  {
139  // scissor the viewport by default: needed for points and lines with size > 1.0 as they are not clipped against the viewport.
140  VL_CHECK(glIsEnabled(GL_SCISSOR_TEST))
141  glScissor(camera->viewport()->x(), camera->viewport()->y(), camera->viewport()->width(), camera->viewport()->height());
142  }
143  }
144 
145  // multipassing
146  for( int ipass=0; tok != NULL; tok = tok->mNextPass, ++ipass )
147  {
148  VL_CHECK_OGL()
149 
150  // --------------- shader setup ---------------
151 
152  const Shader* shader = tok->mShader;
153 
154  // shader override: select the first that matches
155 
156  for( std::map< unsigned int, ref<Shader> >::const_iterator eom_it = mShaderOverrideMask.begin();
157  eom_it != mShaderOverrideMask.end();
158  ++eom_it )
159  {
160  if ( eom_it->first & actor->enableMask() )
161  {
162  shader = eom_it->second.get();
163  break;
164  }
165  }
166 
167  // shader's render states
168 
169  if ( cur_render_state_set != shader->getRenderStateSet() )
170  {
171  opengl_context->applyRenderStates( shader->getRenderStateSet(), camera );
172  cur_render_state_set = shader->getRenderStateSet();
173  }
174 
175  VL_CHECK_OGL()
176 
177  // shader's enables
178 
179  if ( cur_enable_set != shader->getEnableSet() )
180  {
181  opengl_context->applyEnables( shader->getEnableSet() );
182  cur_enable_set = shader->getEnableSet();
183  }
184 
185  #ifndef NDEBUG
186  if (glGetError() != GL_NO_ERROR)
187  {
188  Log::error("An unsupported OpenGL glEnable/glDisable capability has been enabled!\n");
189  VL_TRAP()
190  }
191  #endif
192 
193  // --------------- Actor pre-render callback ---------------
194 
195  // here the user has still the possibility to modify the Actor's uniforms
196 
197  actor->dispatchOnActorRenderStarted( frame_clock, camera, tok->mRenderable, shader, ipass );
198 
199  VL_CHECK_OGL()
200 
201  // --------------- GLSLProgram setup ---------------
202 
203  VL_CHECK_OGL()
204 
205  // current transform
206  const Transform* cur_transform = actor->transform();
207  const GLSLProgram* cur_glsl_program = NULL; // NULL == fixed function pipeline
208  const UniformSet* cur_glsl_prog_uniform_set = NULL;
209  const UniformSet* cur_shader_uniform_set = NULL;
210  const UniformSet* cur_actor_uniform_set = NULL;
211 
212  // make sure we update these things only if there is a valid GLSLProgram
213  if ( shader->glslProgram() && shader->glslProgram()->handle() && shader->glslProgram()->linked() )
214  {
215  cur_glsl_program = shader->glslProgram();
216 
217  // consider them NULL if they are empty
218  if (cur_glsl_program->getUniformSet() && !cur_glsl_program->getUniformSet()->uniforms().empty())
219  cur_glsl_prog_uniform_set = cur_glsl_program->getUniformSet();
220 
221  if (shader->getUniformSet() && !shader->getUniformSet()->uniforms().empty())
222  cur_shader_uniform_set = shader->getUniformSet();
223 
224  if (actor->getUniformSet() && !actor->getUniformSet()->uniforms().empty())
225  cur_actor_uniform_set = actor->getUniformSet();
226  }
227 
228  bool update_cm = false; // update camera
229  bool update_tr = false; // update transform
230  bool update_pu = false; // update glsl-program uniforms
231  bool update_su = false; // update shader uniforms
232  bool update_au = false; // update actor uniforms
233  GLSLProgState* glsl_state = NULL;
234 
235  // retrieve the state of this GLSLProgram (including the NULL one)
236  std::map<const GLSLProgram*, GLSLProgState>::iterator glsl_state_it = glslprogram_map.find(cur_glsl_program);
237 
238  if ( glsl_state_it == glslprogram_map.end() )
239  {
240  //
241  // this is the first time we see this GLSL program so we update everything we can
242  //
243 
244  // create a new glsl-state entry
245  glsl_state = &glslprogram_map[cur_glsl_program];
246  update_cm = true;
247  update_tr = true;
248  update_pu = cur_glsl_prog_uniform_set != NULL;
249  update_su = cur_shader_uniform_set != NULL;
250  update_au = cur_actor_uniform_set != NULL;
251  }
252  else
253  {
254  //
255  // we already know this GLSLProgram so we update only what has changed since last time
256  //
257 
258  glsl_state = &glsl_state_it->second;
259  // check for differences
260  update_cm = glsl_state->mCamera != camera;
261  update_tr = glsl_state->mTransform != cur_transform;
262  update_pu = glsl_state->mGLSLProgUniformSet != cur_glsl_prog_uniform_set && cur_glsl_prog_uniform_set != NULL;
263  update_su = glsl_state->mShaderUniformSet != cur_shader_uniform_set && cur_shader_uniform_set != NULL;
264  update_au = glsl_state->mActorUniformSet != cur_actor_uniform_set && cur_actor_uniform_set != NULL;
265  }
266 
267  // update glsl-state structure
268  glsl_state->mCamera = camera;
269  glsl_state->mTransform = cur_transform;
270  glsl_state->mGLSLProgUniformSet = cur_glsl_prog_uniform_set;
271  glsl_state->mShaderUniformSet = cur_shader_uniform_set;
272  glsl_state->mActorUniformSet = cur_actor_uniform_set;
273 
274  // --- update proj, view and transform matrices ---
275 
276  VL_CHECK_OGL()
277 
278  if (update_cm || update_tr) {
279  projViewTransfCallback()->updateMatrices( update_cm, update_tr, cur_glsl_program, camera, cur_transform );
280  }
281 
282  VL_CHECK_OGL()
283 
284  // --- uniforms ---
285 
286  // note: the user must not make the glslprogram's, shader's and actor's uniforms collide!
287  VL_CHECK( !opengl_context->areUniformsColliding(cur_shader_uniform_set, cur_actor_uniform_set) );
288  VL_CHECK( !opengl_context->areUniformsColliding(cur_shader_uniform_set, cur_glsl_prog_uniform_set ) );
289  VL_CHECK( !opengl_context->areUniformsColliding(cur_actor_uniform_set, cur_glsl_prog_uniform_set ) );
290 
291  VL_CHECK_OGL()
292 
293  // glsl program uniform set
294  if ( update_pu )
295  {
296  VL_CHECK( cur_glsl_prog_uniform_set && cur_glsl_prog_uniform_set->uniforms().size() );
297  VL_CHECK( shader->getRenderStateSet()->glslProgram() && shader->getRenderStateSet()->glslProgram()->handle() )
298  cur_glsl_program->applyUniformSet( cur_glsl_prog_uniform_set );
299  }
300 
301  VL_CHECK_OGL()
302 
303  // shader uniform set
304  if ( update_su )
305  {
306  VL_CHECK( cur_shader_uniform_set && cur_shader_uniform_set->uniforms().size() );
307  VL_CHECK( shader->getRenderStateSet()->glslProgram() && shader->getRenderStateSet()->glslProgram()->handle() )
308  cur_glsl_program->applyUniformSet( cur_shader_uniform_set );
309  }
310 
311  VL_CHECK_OGL()
312 
313  // actor uniform set
314  if ( update_au )
315  {
316  VL_CHECK( cur_actor_uniform_set && cur_actor_uniform_set->uniforms().size() );
317  VL_CHECK( shader->getRenderStateSet()->glslProgram() && shader->getRenderStateSet()->glslProgram()->handle() )
318  cur_glsl_program->applyUniformSet( cur_actor_uniform_set );
319  }
320 
321  VL_CHECK_OGL()
322 
323  #ifndef NDEBUG
324  if ( cur_glsl_program && ! cur_glsl_program->validateProgram() ) {
325  Log::bug( "GLSLProgram::useProgram() failed validation (" + String(objectName()) + ")\n");
326  Log::bug( Say("Info log:\n%s\n") << cur_glsl_program->infoLog() );
327  VL_TRAP();
328  }
329  #endif
330 
331  // --------------- Actor rendering ---------------
332 
333  // also compiles display lists and updates BufferObjects if necessary
334  tok->mRenderable->render( actor, shader, camera, opengl_context );
335 
336  VL_CHECK_OGL()
337 
338  // if shader is overridden it does not make sense to perform multipassing so we break the loop here.
339  if (shader != tok->mShader)
340  break;
341  }
342  }
343 
344  // clear enables
345  opengl_context->applyEnables( mDummyEnables.get() ); VL_CHECK_OGL();
346 
347  // clear render states
348  opengl_context->applyRenderStates( mDummyStateSet.get(), NULL ); VL_CHECK_OGL();
349 
350  // enabled texture unit #0
351  VL_glActiveTexture( GL_TEXTURE0 ); VL_CHECK_OGL();
353  VL_glClientActiveTexture( GL_TEXTURE0 ); VL_CHECK_OGL();
354  }
355 
356  // disable scissor test
357  glDisable( GL_SCISSOR_TEST ); VL_CHECK_OGL();
358 
359  // disable all vertex arrays, note this also calls "glBindBuffer(GL_ARRAY_BUFFER, 0)"
360  opengl_context->bindVAS( NULL, false, false ); VL_CHECK_OGL();
361 
362  return render_queue;
363 }
364 //------------------------------------------------------------------------------
365 const RenderQueue* Renderer::render(const RenderQueue* render_queue, Camera* camera, real frame_clock)
366 {
367  VL_CHECK_OGL()
368  // FIXME: make this work, we got a linking error atm.
369  //VL_CHECK( vl::VisualizationLibrary::isGraphicsInitialized() )
370 
371  // skip if renderer is disabled
372 
373  if ( enableMask() == 0 ) {
374  return render_queue;
375  }
376 
377  // enter/exit behavior contract
378 
379  class InOutContract
380  {
381  Renderer* mRenderer;
382  std::vector<RenderStateSlot> mOriginalDefaultRS;
383  public:
384  InOutContract(Renderer* renderer, Camera* camera): mRenderer(renderer)
385  {
386  // increment the render tick.
387  mRenderer->mRenderTick++;
388 
389  // render-target activation.
390  // note: an OpenGL context can have multiple rendering targets!
391  mRenderer->framebuffer()->activate();
392 
393  // viewport setup.
394  camera->viewport()->setClearFlags( mRenderer->clearFlags() );
395  camera->viewport()->activate();
396 
397  OpenGLContext* gl_context = renderer->framebuffer()->openglContext();
398 
399  // default render states override
400  for(size_t i=0; i<renderer->overriddenDefaultRenderStates().size(); ++i)
401  {
402  // save overridden default render state to be restored later
403  ERenderState type = renderer->overriddenDefaultRenderStates()[i].type();
404  mOriginalDefaultRS.push_back(gl_context->defaultRenderState(type));
405  // set new default render state
406  gl_context->setDefaultRenderState(renderer->overriddenDefaultRenderStates()[i]);
407  }
408 
409  // dispatch the renderer-started event.
410  mRenderer->dispatchOnRendererStarted();
411 
412  // check user-generated errors.
413  VL_CHECK_OGL()
414  }
415 
416  ~InOutContract()
417  {
418  // dispatch the renderer-finished event
419  mRenderer->dispatchOnRendererFinished();
420 
421  OpenGLContext* gl_context = mRenderer->framebuffer()->openglContext();
422 
423  // restore default render states
424  for(size_t i=0; i<mOriginalDefaultRS.size(); ++i)
425  {
426  gl_context->setDefaultRenderState(mOriginalDefaultRS[i]);
427  }
428 
429  VL_CHECK( !globalSettings()->checkOpenGLStates() || mRenderer->framebuffer()->openglContext()->isCleanState(true) );
430 
431  // check user-generated errors.
432  VL_CHECK_OGL()
433 
434  // note: we don't reset the render target here
435  }
436  } contract(this, camera);
437 
438  return renderRaw( render_queue, camera, frame_clock );
439 }
440 //-----------------------------------------------------------------------------
Associates a Renderable object to an Effect and Transform.
Definition: Actor.hpp:130
int y() const
Definition: Viewport.hpp:67
Callback class to update the state of the projection, view, transform and normal matrices of a GLSLPr...
const ProjViewTransfCallback * projViewTransfCallback() const
Definition: Renderer.hpp:69
Transform * transform()
Returns the Transform bound tho an Actor.
Definition: Actor.hpp:190
Implements a 4x4 matrix transform used to define the position and orientation of an Actor...
Definition: Transform.hpp:72
ERenderState
The Renderer class executes the actual rendering on the given RenderQueue.
Definition: Renderer.hpp:49
A simple String formatting class.
Definition: Say.hpp:124
void applyEnables(const EnableSet *cur)
Applies an EnableSet to an OpenGLContext - Typically for internal use only.
The String class implements an advanced UTF16 (Unicode BMP) string manipulation engine.
Definition: String.hpp:62
ref< ProjViewTransfCallback > mProjViewTransfCallback
Definition: Renderer.hpp:116
int size() const
Definition: RenderQueue.hpp:90
vl::ref< EnableSet > mDummyEnables
Definition: Renderer.hpp:109
EnableSet * getEnableSet()
Definition: Shader.hpp:2229
bool linked() const
Returns true if the program has been succesfully linked.
Definition: GLSL.hpp:288
Renderable * mRenderable
Definition: RenderToken.hpp:59
Represents an OpenGL context, possibly a widget or a pbuffer, which can also respond to keyboard...
OpenGLContext * openglContext()
The OpenGLContext bound to a render target.
const FramebufferObject * framebuffer() const
The Framebuffer on which the rendering is performed.
Definition: Renderer.hpp:100
static void error(const String &message)
Use this function to provide information about run-time errors: file not found, out of memory...
Definition: Log.cpp:165
Wraps a GLSL program to which you can bind vertex, fragment and geometry shaders. ...
Definition: GLSL.hpp:233
bool validateProgram() const
Returns true if the validation of this GLSL program is succesful, see also http://www.opengl.org/sdk/docs/man/xhtml/glValidateProgram.xml for more information.
Definition: GLSL.cpp:615
std::map< unsigned int, ref< Shader > > mShaderOverrideMask
Definition: Renderer.hpp:112
void setDefaultRenderState(const RenderStateSlot &rs_slot)
Defines the default render state slot to be used by the opengl context.
const UniformSet * getUniformSet() const
Returns the installed UniformSet.
Definition: Actor.hpp:345
bool applyUniformSet(const UniformSet *uniforms=NULL) const
Applies a set of uniforms to the currently bound GLSL program.
Definition: GLSL.cpp:652
const std::vector< ref< Uniform > > & uniforms() const
Definition: UniformSet.hpp:68
const GLSLProgram * glslProgram() const
Returns the GLSLProgram associated to a RenderStateSet (if any)
Internally used by the rendering engine.
Definition: RenderToken.hpp:47
void dispatchOnRendererFinished()
Dispatches the onRendererFinished() event to the registered RenderEventCallback objects.
unsigned int enableMask() const
The enable mask of an Actor is usually used to defines whether the actor should be rendered or not de...
Definition: Actor.hpp:270
Viewport * viewport()
The viewport bound to a camera.
Definition: Camera.hpp:140
Visualization Library main namespace.
void activate() const
Definition: Viewport.cpp:72
static void bug(const String &message)
Use this function to provide information about programming errors: wrong parameter initialization...
Definition: Log.cpp:175
int height() const
Definition: Viewport.hpp:71
const Scissor * scissor() const
Returns the Scissor used when rendering an Actor.
Definition: Actor.hpp:411
std::vector< RenderStateSlot > & overriddenDefaultRenderStates()
Render states that will be used as default by the opengl context by this renderer.
Definition: Renderer.hpp:87
#define VL_TRAP()
Definition: checks.hpp:70
int width() const
Definition: Viewport.hpp:69
const RenderQueue * renderRaw(const RenderQueue *in_render_queue, Camera *camera, real frame_clock)
Used by render() to loop through the render queue.
Definition: Renderer.cpp:88
UniformSet * getUniformSet()
Returns a GLSLProgram&#39;s static UniformSet. Static uniforms are those uniforms whose value is constant...
Definition: GLSL.hpp:470
const Shader * mShader
Definition: RenderToken.hpp:60
vl::ref< RenderStateSet > mDummyStateSet
Definition: Renderer.hpp:110
int x() const
Definition: Viewport.hpp:65
void activate(EFramebufferBind target=FBB_FRAMEBUFFER)
Activates the FramebufferObject by calling bindFramebuffer() and bindDrawBuffers() ...
void dispatchOnActorRenderStarted(real frame_clock, const Camera *camera, Renderable *renderable, const Shader *shader, int pass)
Calls all the onActorRenderStarted() of all the ActorEventCallback installed on this Actor...
Definition: Actor.hpp:376
String infoLog() const
Returns the info log of this GLSL program using the OpenGL function glGetProgramInfoLog(), see also http://www.opengl.org/sdk/docs/man/xhtml/glGetProgramInfoLog.xml for more information.
Definition: GLSL.cpp:593
void applyRenderStates(const RenderStateSet *cur, const Camera *camera)
Applies a RenderStateSet to an OpenGLContext - Typically for internal use only.
#define NULL
Definition: OpenGLDefs.hpp:81
bool isEnabled(unsigned int mask)
Definition: Renderer.hpp:93
Manages most of the OpenGL rendering states responsible of the final aspect of the rendered objects...
Definition: Shader.hpp:1830
void render(const Actor *actor, const Shader *shader, const Camera *camera, OpenGLContext *gl_context)
Renders the Renderable and if necessary compiles the display list and updates the BufferObjects...
Definition: Renderable.hpp:80
A set of RenderState objects managed by a Shader.
const Scissor * scissor() const
Returns the Scissor to be used when rendering an Actor.
Definition: Shader.hpp:2309
The RenderQueue class collects a list of RenderToken objects to be sorted and rendered.
Definition: RenderQueue.hpp:45
virtual const RenderQueue * render(const RenderQueue *in_render_queue, Camera *camera, real frame_clock)
Takes as input the render queue to render and returns a possibly filtered render queue for further pr...
Definition: Renderer.cpp:365
void bindVAS(const IVertexAttribSet *vas, bool use_vbo, bool force)
Activates the specified vertex attribute set - For internal use only.
bool isCleanState(bool verbose)
Checks whether the OpenGL state is clean or not.
#define VL_CHECK_OGL()
Definition: OpenGL.hpp:156
const std::string & objectName() const
The name of the object, by default set to the object&#39;s class name.
Definition: Object.hpp:217
virtual void updateMatrices(bool cam_changed, bool transf_changed, const GLSLProgram *glsl_program, const Camera *camera, const Transform *transform)
Update matrices of the current GLSLProgram, if glsl_program == NULL then fixed function pipeline is a...
UniformSet * getUniformSet()
Returns the UniformSet installed.
Definition: Shader.hpp:2261
RenderStateSet * getRenderStateSet()
Definition: Shader.hpp:2235
const RenderToken * at(int i) const
Definition: RenderQueue.hpp:57
A set of Uniform objects managed by a Shader.
Definition: UniformSet.hpp:50
bool Has_Fixed_Function_Pipeline
OpenGL: true if !Is_OpenGL_Forward_Compatible && !Is_OpenGL_Core_Profile OpenGL ES 1: always true Ope...
Definition: OpenGL.cpp:63
Represents a virtual camera defining, among other things, the point of view from which scenes can be ...
Definition: Camera.hpp:49
The Scissor class wraps the OpenGL function glScissor(), see http://www.opengl.org/sdk/docs/man/xhtml...
Definition: Scissor.hpp:47
unsigned int handle() const
The handle of the GLSL program as returned by glCreateProgram()
Definition: GLSL.hpp:273
const GLSLProgram * glslProgram() const
Returns the GLSLProgram associated to a Shader (if any)
Definition: Shader.hpp:2194
void enable(const Viewport *viewport) const
Enables the scissor test on the area specified by scissorRect() clipped against the given Viewport...
Definition: Scissor.hpp:61
const RenderToken * mNextPass
Definition: RenderToken.hpp:56
#define VL_CHECK(expr)
Definition: checks.hpp:73
unsigned int enableMask() const
Enable mask used to enable/disable the rendering of matching Actors.
EClearFlags clearFlags() const
The clear flags used to clear the viewport.
static bool areUniformsColliding(const UniformSet *u1, const UniformSet *u2)
Returns true if the two UniformSet contain at least one Uniform variable with the same name...
void dispatchOnRendererStarted()
Dispatches the onRendererStarted() event to the registered RenderEventCallback objects.
const RenderStateSlot & defaultRenderState(ERenderState rs)
Returns the default render state slot used by VL when a specific render state type is left undefined...
VLCORE_EXPORT GlobalSettings * globalSettings()
Returns VisulizationLibrary&#39;s global settings.
Definition: pimpl.cpp:52
A set of enables managed by Shader.
Definition: EnableSet.hpp:47
void setClearFlags(EClearFlags clear_flags)
Usually you want to use rather RendererAbstract::setClearFlags()
Definition: Viewport.hpp:98