A lightweight C++ OpenGL middleware for 2D/3D graphics
|[Download] [Tutorials] [All Classes] [Grouped Classes]|
Visualization Library's architecture provides the programmer with a flexible and efficient framework to develop any kind of 3D graphics and visualization applications. In fact, even if Visualization Library was born with mainly scientific applications in mind, its modular architecture is perfectly suitable to develop high-performance applications such as next-generation games. It is not a surprise after all if we consider the fact that VL was designed to natively support technologies such as OpenGL Shading Language, geometry shaders, occlusion culling, framebuffer objects, vertex buffer objects, multiple render targets, multiple rendering, post processing etc. Not to mention more traditional features like hierachical frustum culling, geometry LOD, effect LOD, multipassing, hierachical transforms...
The paragraphs below briefly describe the interaction among the most important Visualization Library classes. This will give you a general idea of how VL works and how the main classes collaborate with each another.
Visualization Library once initialized allocates a few default objects to manage frequently used subsystems such as font management, file system access, resource loaders/writers and logging such default objects can be accessed using the following functions:
Note that you are not required to use such objects those are just the objects that VL uses by default. You can actually use any number of vl::FileSystem, vl::LoadWriterManager, vl::FontManager and logger at the same time or even install a different set of default objects for VL to use.
Funcitons such as vl::loadImage() and vl::loadResource() for example use the default FileSystem and LoadWriterManager to locate and load images and resources. Also the default logger is used basically everywhere by VL to report warnings and notifications to the user.
The vl::Actor class associates three kinds of information:
As shown in the picture, a vl::Actor can render different things for each level of detail.
The vl::ShaderNode class is a high-level service provided by Visualization Library to conveniently manage and arrange large hierachies of shaders. Each vl::ShaderNode manages and is bound to a single vl::Shader. This kind of service is similar to what a typical scene-graph-oriented engine provides but here you are not required to use it. You can use it for a subset of your shaders and not for others. Visualization Library gives you total control over when the shader hierarchy is updated, as opposed to most of the scene-graph-oriented engines that are forced to continuously traverse and update the whole hierarchy!
A vl::Transform defines a model transformation matrix. Transforms can be arranged in one or more hierachies to represent hierarchical transformations. Each vl::Actor can reference one vl::Transform (or none) and each vl::Transform can be referenced by multiple Actors. The vl::Rendering class defines a transform hierarchy that is updated before every rendering. This way if you have a set of animated objects you can put their transform in this hierarchy, while non animated objects can remain in an external hierarchy that is updated only when necessary.
Compared to a typical scene-graph-oriented architecture Visualization Library has the following advantages:
The vl::Rendering class collects all the information necessary to perform a single rendering:
As you can see Visualization Library can seamlessly use multiple scene managers, each of which can implement its own visibility and spatial organization algorithm. You can for example implement a PVS or portal-based scene manager and just drop it in the vl::Rendering! Visualization Library provides out-of-the-box the following scene managers: two BVH (bounding volume hierarchy) scene managers (a KdTree based scene manager that can efficiently replace quadtrees and octrees and a generic hierachical tree based scene manager) and a portal based scene manager especially useful for highly occluded environments.
Visualization Library allows you to combine multiple renderings by organizing them in a powerful and simple to use tree layout, for more information see vl::RenderingTree.
Below is a simplified view of Visualization Library internal rendering pipeline, from hidden surface removal to rendering.