Visualization Library v1.0.3

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

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Public Member Functions | Protected Member Functions | Protected Attributes

vl::OcclusionCullRenderer Class Reference

Wraps a Renderer performing occlusion culling acceleration. More...

#include <OcclusionCullRenderer.hpp>

Inheritance diagram for vl::OcclusionCullRenderer:
vl::Renderer vl::RendererAbstract vl::Object

List of all members.

Public Member Functions

 OcclusionCullRenderer ()
 Constructor.
virtual const RenderQueuerender (const RenderQueue *in_render_queue, Camera *camera, real frame_clock)
 Renders using the wrapped renderer but also performing occlusion culling.
void setWrappedRenderer (Renderer *renderer)
 The renderer to be wrapped by this occlusion culling renderer.
const RendererwrappedRenderer () const
 The renderer to be wrapped by this occlusion culling renderer.
RendererwrappedRenderer ()
 The renderer to we wrapped by this occlusion culling renderer.
void setOcclusionThreshold (int threshold)
 The number of pixels visible for an actor to be considered occluded (default = 0)
int occlusionThreshold () const
 The number of pixels visible for an actor to be considered occluded (default = 0)
const Framebufferframebuffer () const
 Returns the wrapped Renderer's Framebuffer.
Framebufferframebuffer ()
 Returns the wrapped Renderer's Framebuffer.
int statsTotalObjects () const
 Returns the total number or objects candidate for rendering before occlusion culling.
int statsOccludedObjects () const
 Returns the number or objects not rendered due to the occlusion culling.
ShaderocclusionShader ()
 The Shader used to render the bounding boxes during the occlusion culling query.
const ShaderocclusionShader () const
 The Shader used to render the bounding boxes during the occlusion culling query.
void setOcclusionShader (Shader *occ_sh)
 The Shader used to render the bounding boxes during the occlusion culling query.

Protected Member Functions

void render_pass1 (const RenderQueue *in_render_queue)
 Retrieves the occlusion culling query results from the previous rendering frame.
void render_pass2 (const RenderQueue *in_render_queue, Camera *camera)
 Performs a new set of occlusion culling queries to be tested the next frame.

Protected Attributes

vl::ref< RenderermWrappedRenderer
ref< ShadermOcclusionShader
ref< RenderQueuemCulledRenderQueue
int mOcclusionThreshold
RenderermPrevWrapRenderer
int mStatsTotalObjects
int mStatsOccludedObjects

Detailed Description

Wraps a Renderer performing occlusion culling acceleration.

For more information see OpenGL-Accelerated Occlusion Culling Tutorial

Definition at line 44 of file OcclusionCullRenderer.hpp.


Constructor & Destructor Documentation

OcclusionCullRenderer::OcclusionCullRenderer (  )

Member Function Documentation

const RenderQueue * OcclusionCullRenderer::render ( const RenderQueue in_render_queue,
Camera camera,
real  frame_clock 
) [virtual]

Renders using the wrapped renderer but also performing occlusion culling.

Reimplemented from vl::Renderer.

Definition at line 68 of file OcclusionCullRenderer.cpp.

References vl::RendererAbstract::enableMask(), vl::Log::error(), vl::ref< T >::get(), mCulledRenderQueue, mWrappedRenderer, render_pass1(), render_pass2(), VL_CHECK_OGL, and VL_TRAP.

void OcclusionCullRenderer::setWrappedRenderer ( Renderer renderer )

The renderer to be wrapped by this occlusion culling renderer.

Definition at line 128 of file OcclusionCullRenderer.cpp.

References mWrappedRenderer.

const Renderer* vl::OcclusionCullRenderer::wrappedRenderer (  ) const [inline]

The renderer to be wrapped by this occlusion culling renderer.

Definition at line 59 of file OcclusionCullRenderer.hpp.

Renderer* vl::OcclusionCullRenderer::wrappedRenderer (  ) [inline]

The renderer to we wrapped by this occlusion culling renderer.

Definition at line 62 of file OcclusionCullRenderer.hpp.

void vl::OcclusionCullRenderer::setOcclusionThreshold ( int  threshold ) [inline]

The number of pixels visible for an actor to be considered occluded (default = 0)

Definition at line 65 of file OcclusionCullRenderer.hpp.

int vl::OcclusionCullRenderer::occlusionThreshold (  ) const [inline]

The number of pixels visible for an actor to be considered occluded (default = 0)

Definition at line 68 of file OcclusionCullRenderer.hpp.

Referenced by render_pass1().

const Framebuffer * OcclusionCullRenderer::framebuffer (  ) const [virtual]

Returns the wrapped Renderer's Framebuffer.

Reimplemented from vl::Renderer.

Definition at line 133 of file OcclusionCullRenderer.cpp.

References mWrappedRenderer, and NULL.

Referenced by render_pass2().

Framebuffer * OcclusionCullRenderer::framebuffer (  ) [virtual]

Returns the wrapped Renderer's Framebuffer.

Reimplemented from vl::Renderer.

Definition at line 141 of file OcclusionCullRenderer.cpp.

References mWrappedRenderer, and NULL.

int vl::OcclusionCullRenderer::statsTotalObjects (  ) const [inline]

Returns the total number or objects candidate for rendering before occlusion culling.

Definition at line 77 of file OcclusionCullRenderer.hpp.

int vl::OcclusionCullRenderer::statsOccludedObjects (  ) const [inline]

Returns the number or objects not rendered due to the occlusion culling.

Definition at line 80 of file OcclusionCullRenderer.hpp.

Shader* vl::OcclusionCullRenderer::occlusionShader (  ) [inline]

The Shader used to render the bounding boxes during the occlusion culling query.

For example if you have problems with the zbuffer percision you can access the Shader to modify the polygon offset settings.

Definition at line 85 of file OcclusionCullRenderer.hpp.

const Shader* vl::OcclusionCullRenderer::occlusionShader (  ) const [inline]

The Shader used to render the bounding boxes during the occlusion culling query.

For example if you have problems with the zbuffer percision you can access the Shader to modify the polygon offset settings.

Definition at line 90 of file OcclusionCullRenderer.hpp.

void vl::OcclusionCullRenderer::setOcclusionShader ( Shader occ_sh ) [inline]

The Shader used to render the bounding boxes during the occlusion culling query.

For example if you have problems with the zbuffer percision you can access the Shader to modify the polygon offset settings.

Definition at line 95 of file OcclusionCullRenderer.hpp.

void OcclusionCullRenderer::render_pass1 ( const RenderQueue in_render_queue ) [protected]
void OcclusionCullRenderer::render_pass2 ( const RenderQueue in_render_queue,
Camera camera 
) [protected]

Member Data Documentation

Definition at line 106 of file OcclusionCullRenderer.hpp.

Referenced by OcclusionCullRenderer(), and render_pass2().

Definition at line 107 of file OcclusionCullRenderer.hpp.

Referenced by OcclusionCullRenderer(), render(), and render_pass1().

Definition at line 108 of file OcclusionCullRenderer.hpp.

Referenced by OcclusionCullRenderer().

Definition at line 109 of file OcclusionCullRenderer.hpp.

Referenced by OcclusionCullRenderer(), and render_pass1().

Definition at line 110 of file OcclusionCullRenderer.hpp.

Referenced by OcclusionCullRenderer(), and render_pass1().

Definition at line 111 of file OcclusionCullRenderer.hpp.

Referenced by OcclusionCullRenderer(), and render_pass1().


The documentation for this class was generated from the following files:

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:10.
Permission is granted to use this page to write and publish articles regarding Visualization Library.