Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics
[Home] [Tutorials] [All Classes] [Grouped Classes]

Visualization Library Features Overview

Intro
Below is a descriptive introduction to Visualization Library key features and functionalities. Take a couple of minutes to read this page as you will find a lot of useful information about how VL works, how to take full advantage of VL's power and why you should use VL rather than plain OpenGL or other libraries.

A Lightweight Modern OpenGL Middleware

The first and most important feature of Visualization Library is surely its simple and straightforward design. Every aspect of Visualization Library has been developed keeping in mind this few but important principles:

GUI Bindings

Even if Visualization Library can be used wherever there is an OpenGL context, several utility classes are available to facilitate even more the integration of VL into your applications. VL officially supports all the most popular C/C++ GUI frameworks such as Win32, MFC, Qt4, wxWidgets, GLUT, SDL and Cocoa (experimental). A "GUI binding" mainly consists of a window class that, using the framework-specific API, is capable of creating and setting up a vl::OpenGLContext, manages unicode keyboard input, mouse events, file drag and drop, OpenGL resource sharing, framebuffer swap, multiple OpenGL windows and many other things. Thanks to the many ready-to-use GUI bindings available, the developer can start using Visualization Library in just a few minutes and has only to concentrate on creating great 3D graphics applications!

Classes
vlWin32::Win32Window, vlMFC::MFCWindow, vlQt4::Qt4Widget, vlWX::vlWXGLCanvas, vlGLUT::GLUTWindow, vlSDL::SDLWindow

OpenGL Shading Language

There is no doubt that the OpenGL Shading Language is the present and the future of OpenGL. For this reason Visualization Library architecture has been carefully designed from the ground up to exploit the full power of the OpenGL Shading Language and to make it accessible to everyone. VL makes the OpenGL Shading Language so simple to use that setting up a complete GLSL program requires just a couple of lines of code! Advanced features such as geometry instancing, texture arrays, geometry shaders, multiple render targets etc. are fully supported as well.

Classes
vl::GLSLProgram, vl::GLSLVertexShader, vl::GLSLFragmentShader, vl::GLSLGeometryShader, vl::Uniform

Related Pages

Volume Rendering

Visualization Library also provides a set of simple and powerful classes to perform volume rendering, isosurface extraction and 3D plots from volume data. The vlVolume::SlicedVolume class implements all the functionalities needed to perform a direct volume rendering with and without OpenGL Shading Language. When the OpenGL Shading Language is used Blinn-Phong lighting and transfer function computations are performed in realtime. The vlVolume::MarchingCubes is a powerful class that uses an efficient implementation of the marching cubes algorithm to extract one or more isosurfaces from one or more volume data. The vlVolume::VolumePlot is an utility class that takes a volume data and automatically extracts the isosurface at the specified threshold and generates a plot with labels.

Classes
vlVolume::SlicedVolume, vlVolume::MarchingCubes, vlVolume::VolumePlot

Related Pages

Hardware Accelerated 2D Vector Graphics

The mission of Visualization Library is not only to provide cutting edge technology for 3D graphics application but also to open the world of hardware accelerated 2D graphics for applications like plotting, charting, data mining and many others. The lack of support for hardware accelerated 2D graphics is almost embarrassing and even when such support is claimed, very few times the performances come close to the full potential of modern GPUs. Since Alpha 3.0 Visualization Library enables true hardware accelerated 2D vector graphics via the following simple and intuitive classes: vlVG::VectorGraphics and vlVG::SceneManagerVectorGraphics. Using such classes the developer has full access to standard functionalities like boxes, lines, ellipses, tansforms, clipping etc. but also to advanced features like texturing, point sprites, stencil operations, antialiasing, high quality text rendering and all the blending modes supported by OpenGL! All this using an intuitive interface that optimally generates vl::Actor, vl::Geometry, vl::Shader etc. objects and commands that are rendered at full speed!

Classes
vlVG::VectorGraphics, vlVG::SceneManagerVectorGraphics

Related Pages

High Performances

In order to maximize the rendering performances Visualization Library employs several techniques:

Classes and Functions
vl::Actor, vl::Effect, vl::LODEvaluator, vl::DistanceLODEvaluator, vl::Actor::setLODEvaluator(), vl::Effect::setLODEvaluator(), vl::Renderable::setDisplayListEnabled(), vl::Geometry::setVertexBufferObjectsEnabled()

Related Pages

Flexible Scene Management

Visualization Library uses a simple and extensible scene management system and provides several ready-to-use scene managers:

Scene managers using other techniques like PVS (potentially visible set) etc. can be also used implementing an appropriate vl::SceneManager subclass.

Note that Visualization Library allows you to seamlessly use multiple scene managers at the same time!

Classes
vl::SceneManager, vl::SceneManagerActorTree, vl::SceneManagerActorKdTree, vl::SceneManagerPortals, vl::Rendering

Related Pages

Automatic Transparency Management

Visualization Library automatically sorts transparent objects in order to perform a correct rendering. The user is not required to setup any special "transparent bin" or to define any explicit rendering order as Visualization Library automatically detects and manages transparent objects. However, the developer retains full control over the object rendering order via the vl::Actor::setRenderRank(), vl::Actor::setRenderBlock() and vl::Effect::setRenderRank() methods. The developer can also install a custom vl::RenderQueueSorter using the vl::Rendering::setRenderQueueSorter() method.

In case you need to render a convex transparent object then you have to ensure that its polygons are properly depth-sorted. You can do this by simply installing a vl::DepthSortCallback to your vl::Actor.

Classes
vl::DepthSortCallback, vl::Actor, vl::Effect, vl::Rendering, vl::RenderQueueSorter

Related Pages

Shader and Geometry: LOD, Multipassing and Animation

Visualization Library can naturally manage complex scenarios where Effects and/or Actors define several LODs with possibly multiple rendering passes each and with animations defined for each pass and LOD. Visualization Library not only manages naturally such scenarios but also ensures that the animations are computed only once per frame, for only the visible LODs, for each pass, for both Shaders and Actors.

Classes
vl::Actor, vl::Effect, vl::Shader

OpenGL Shading Language Based C++ Math Library

Visualization Library features a complete vector and matrix math library designed to replicate as closely as possible in C++ the OpenGL Shading Language types and functons. VL's math library provides the developer with 2, 3, and 4 components vector (float, double, int, unsigned int etc.), 2x2, 3x3, 4x4 float and double matrices, vector/vector, vector/matrix and matrix/matrix operations, a quaternion class to conveniently represent and manipulate rotations and orientations and much more. The GLSLmath.hpp module also provides C++ implementations of the most important OpenGL Shading Language scalar and vector functions.

Classes
vl::dvec4, vl::dvec3, vl::dvec2, vl::fvec4, vl::fvec3, vl::fvec2, vl::ivec4, vl::ivec3, vl::ivec2, vl::uvec4, vl::uvec3, vl::uvec2, vl::dmat4, vl::dmat3, vl::dmat2, vl::fmat4, vl::fmat3, vl::fmat2, vl::quat, vl::AABB, vl::Sphere, vl::RectI, vl::RectF.

Related Pages

Framebuffer Objects

Modern OpenGL applications make heavy use of framebuffer objects (EXT_framebuffer_object extension) to implement efficient render to texture, offscreen rendering and post processing effects. Visualization Library has been designed to take full advantage of framebuffer objects where available and makes rendering to a framebuffer objects as easy as using the standard OpenGL framebuffer. Besides providing the standard framebuffer object functionalities, Visualization Library goes the extra mile, delivering first-class support for framebuffer objects also in conjuction with many other extensions like EXT_texture_array, EXT_framebuffer_blit, EXT_framebuffer_multisample, EXT_packed_depth_stencil, ARB_geometry_shader4, ARB_texture_rectangle, ARB_texture_cube_map, 3D textures and so on.

Classes
vl::FBORenderTarget, vl::FBOAttachmentAbstract, vl::FBORenderbufferAttachment, vl::FBOColorBufferAttachment, vl::FBODepthBufferAttachment, vl::FBODepthStencilBufferAttachment, vl::FBOStencilBufferAttachment, vl::FBOTexture1DAttachment, vl::FBOTexture2DAttachment, vl::FBOTexture3DAttachment, vl::FBOTextureAttachment, vl::FBOTextureLayerAttachment, vl::BlitFramebuffer

Automatic Progressive OpenGL Extension Management

The extension mechanism provided by OpenGL has proved to be one of the key factors for the success and longevity of this elegant API. However, exploiting effectively all the possible hardware configurations and all the available extensions can easily become an overwhelming task. For this reason Visualization Library tackles this task for you, querying the available extensions in an automatic manner (via GLEW) and selecting and using the most appropriate ones to deliver maximum performance and stability. We refer to this intelligent selection mechanism as "Progressive OpenGL Extension Management". The principle is very simple, wherever an OpenGL feature is requested not only Visualization Library looks for an extension to support it but looks for the best implementation of that functionality, checking first among the functions which are directly supported by the current OpenGL implementation, then looking among the ARB extensions, then looking among the EXT extensions, then among the vendor specific extensions if necessary.

Advanced Texturing

Taking advantage of the latest and most advanced texturing techniques is a breeze with Visualization Library. The vl::Texture class provides out of the box and transparent support for all the texture formats supported by OpenGL 3.x! This includes multitexturing support, 1D, 2D and 3D textures, cubemap textures, texture rectangles, 1D and 2D texture arrays, automatic mipmaps generation (hardware-accelerated where available), anisotropic filtering, compressed textures, depth textures, integer textures, non normalized floating point textures, and much more! You can also easily manipulate texture parameters, texture matrices, automatic texture coordinate generation and texture environment settings using a few intuitive classes!

Classes
vl::Image, vl::Texture, vl::TexParameter, vl::TexEnv, vl::TexGen, vl::TextureMatrix, vl::TextureUnit, vl::CopyTexSubImage1D, vl::CopyTexSubImage2D, vl::CopyTexSubImage3D, vl::Shader

Related Pages

Unicode support, Text Manipulation and Rendering

Text rendering and manipulation (not to mention Unicode support) has always been the Achilles' heel of many 3D graphics applications. Visualization Library inverts this situation and brings to VL developers first class Unicode support, high-quality text rendering, and feature-rich text manipulation classes. Visualization Library not only provides high-quality Unicode text rendering (based on FreeType) but also a set of powerful text manipulation classes that can be considered a library on their own. In particular the vl::String class implements a feature-rich Unicode text manipulation engine that can be used not only to load, parse, split, trim, search and replace text but that can interoperate with std::string and std::wstring, can encode to/from Latin1, UTF8 and UTF16BE/LE, can perform Unicode-aware case transformations and much more!

Classes
vl::Text, vl::Font, vl::String, vl::TextStream, vl::Say

Related Pages

Virtual File System

In order to load and write resources VL uses an extensible system called "Virtual File System". Anything that can be written to or read from can be implemented as vl::VirtualFile. Anything that is capable of containing or enumerating VirtualFiles can be implemented as a vl::VirtualDirectory. Using this mechanism VL can read and write files that are stored in the RAM, on a disk, that are compressed in an archive or that are transparently downloaded from an HTTP connection. VL provides out of the box support for memory files and directories, disk files and directories, zipped files and directories, and a codec to read and write gz compressed files. This mechanism can be easily extended to implement VirtualFiles and VirtualDirectories that operate over Internet or that encode, compress or encrypt stream of data on the fly, in a manner that is completely transparent to Visualization Library's resource IO functions!

Classes
vl::GZipCodec, vl::VirtualFile, vl::VirtualDirectory, vl::DiskFile, vl::DiskDirectory, vl::MemoryFile, vl::MemoryDirectory, vl::ZippedFile, vl::ZippedDirectory, vl::FileSystem.

Related Pages

Image IO and Manipulation

Visualization Library provides support to all the most common image file formats like PNG, JPG, DDS, DICOM, TIFF, TGA and BMP. Not only vl::Image is capable of storing any kind of texture (2D, 3D, cubemaps, arrays, compressed images etc.) supported by OpenGL, but can also load and write them on a variety of virtual devices (even custom defined) using the Virtual File System mechanism. vl::Image can also store its data on a local memory buffer or directly on the GPU memory, taking full advantage of the ARB_pixel_buffer_object extension. Moreover, vl::Image allows you to perform operations like sampling the pixel of an image regardless of it's data format and type, and convert among several image formats and types, like converting a GL_RGBA/GL_FLOAT image into a GL_LUMINANCE/GL_UNSIGNED_BYTE one (automatically performing a color to grayscale conversion)!

Classes and Functions
vl::Image, vl::Image::convertType(), vl::Image::convertFormat(), vl::Image::sample(), vl::Image::sampleLinear(), vl::Image::readPixels()

Extensible Resource I/O System

Visualization Library implements an intuitive and extensible mechanism to load and write a broad range of resource types such as images, 3d file formats like 3DS, OBJ, PLY, STL, AC3D etc. This mechanism is centered around three simple concepts: 1) a resource database (vl::ResourceDatabase) that stores the information loaded or to be written, 2) a set of resource load-writers (vl::ResourceLoadWriter) that implement the specific algorithm which reads and/or writes a specific resource type from/to a resource database, 3) a manager class (vl::LoadWriterManager) that coordinates the resource load-writers. This way not only it is possible to load and write resources in a simplified and centralized way, regardless of the resource type, but the resource types supported can be extended by the user implementing a new vl::ResourceLoadWriter and registering it to the vl::LoadWriterManager. Futhermore, the user can also provide a customized vl::ResourceLoadWriter to override the ones shipped with Visualization Library if it is needed. When, for example, an application requests an image using the vl::loadImage() function, the appropriate vl::ResourceLoadWriter is picked by the vl::LoadWriterManager, and the resource is loaded from the specified path or vl::VirtualFile.

Classes
vl::ResourceDatabase, vl::ResourceLoadWriter, vl::LoadWriterManager

vl::LoadWriterDICOM, vl::LoadWriterPNG, vl::LoadWriterJPG, vl::LoadWriterTIFF, vl::LoadWriterDDS, vl::LoadWriterTGA, vl::LoadWriterBMP, vl::LoadWriterDAT, vl::LoadWriter3DS, vl::LoadWriterOBJ, vl::LoadWriterAC3D, vl::LoadWriterPLY, vl::LoadWriterSTL, vl::LoadWriterMD2

Related Pages

Terrain Scene Manager

Some applications do not need complex LOD or CLOD management algorithms to display height fields or terrains, either because the data displayed has a limited size or because particular constraints are applied to the camera (like in RTS games for example) for which only a limited portion of the terrain is visible at a given time. This applications can greatly benefit from the vl::Terrain scene manager which implements a fool-proof, high-precision (8, 16 and 32 bits heightmaps) and efficient terrain/heightfield generation and management system. All the user has to provide is a texture for the terrain, a heightfield image and a detail texture following very simple and precise guidelines. The vl::Terrain class takes care of all the rest, like dividing the provided images into chunks, generating the geometry, generating the kd-tree, computing the appropriate texture coordinates in order to prevent seams and so on. If the OpenGL Shading Language is available, the vl::Terrain class can also store the heightmap directly on the GPU and can generate the geometry on the fly using a technique called "vertex texture fetch" (http://developer.nvidia.com/object/using_vertex_textures.html). This technique allows the application to save GPU memory and to manage even greater terrain databases at a higher speed.

Classes
vl::Terrain

Related Pages

Memory Management

Visualization Library memory management has been designed following three main principles:

Related Pages

Geometrical Primitives

Visualization Library provides the developer with several ready-to-use and configurable geometrical primitives like bicubic bezier surfaces, extrusions, cubes, spheres, toruses, grids, pyramids, circles, point clouds etc.

classes

Functions

Related Pages

Visualization Library v2010.06 Reference Documentation
Copyright 2005-2009 Michele Bosi. All rights reserved.
Updated on Tue Jun 1 00:57:09 2010.
Permission is granted to use this page to write and publish articles regarding Visualization Library.