What’s New in VES?

Pat Marion recently posted VES: Development in Iterations, which included a demo of VES using KiwiViewer. This post will discuss some of the back-end features that enabled the demo.

The VES library is the backbone of the KiwiViewer. It provides a framework for developing visualizations on mobile platforms using OpenGL ES 2.0. Recent developments in VES were made with two important considerations in mind:

Performance

Having a nice API

Since VES uses OpenGL ES 2.0, it forced us to implement features a bit differently than if we had developed them for desktops. This is so because OpenGL ES 2.0 is a subset of OpenGL for desktops. Still, OpenGL ES 2.0 provides enough capabilities to create a very usable visualization running at interactive frame rates.

So, what’s new in VES?

1. New Rendering Pipeline:

VES adopted scene graph early on. Scene graph provides two important features: it allows objects to be put together in relation to each other and provides opportunities for optimizations. In this new version of VES, implementation has been changed to achieve both of these desired features of scene graph. Instead of rendering while traversing earlier, drawable entities are now placed in a render stage. The render stage makes sure to minimize state changes to achieve performance. This particular approach also allowed us to provide a framework for features such as render-to-texture and other multipass rendering techniques.

2. Generalized Uniform and Vertex Attribute Support:

Since OpenGL ES 2.0 follows the core profile of OpenGL, glLoadMatrix, glBegin()/End(), and other GL commands are gone (for better). Now, all matrices (model view, projection, etc) and vertex data (position, normal, color), etc. have to go through shaders via uniform and vertex attributes. We have provided an extensible framework using VES uniform and vertex attribute objects to make it easier to deal with this change. It also allows dynamic updates to uniforms, which can be used for animations.

3. Use of VBOs for Performance:

If you want performance, Vertex Buffer Object (VBO) is the way to go and that’s exactly what we are doing now. Thanks to Brad Davis, we split our VBO data into smaller chunks to achieve higher rendering performance.

4. Multiple Shader Support:

The framework now allows for switching shaders, as shown below in a test program (Gouraud shading, Blinn-phong shading, Toon shading).

5. Generalized Texture Support:

VES now allows the creation of generalized texture objects (textures are material attributes in VES) and use of them wherever required. There is work-in-progress to support different texture environments.

6. Render-to-Texture:

This feature was recently added to allow for rendering a scene to a texture and for later use of the texture for other purposes in the same scene or a different one. We wanted to show this as a part of the demo found in the Iterations post, but didn’t get enough time.

7. Color by Scalars:

Using generalized texture support, it is possible now to create a one-dimensional texture and use it to look-up a table in the shaders. This test uses default values for vtkLookupTable.

8. Support for Rendering Overlay Objects:

Using the new VES framework made it quite easy to add support for rendering overlay objects such as screen texts. Thanks Pat!

9. Support for Rendering Transparent Objects:

The framework sorts objects based on their bin property, which natively adds supports for rendering transparent objects. In the future, we will add support for order independent transparency.

10. Clip Planes and Two-sided Lighting:

This is all done in shaders.

11. Gradient Background:

Actual algorithm-to-render for gradient backgrounds is straightforward, but supporting different backgrounds for each camera (there could be more than one and or in parent / child relationship) so that we can provide a generalized support for backgrounds (skydome, plane, textured, and gradient) is bit tricky. We implemented this feature based on the work done for the render-to-texture feature.

12. Testing:

We added few tests to ensure software quality and plan to add more in near future.

We are working towards making a release, but would like to handle one or more issues, add couple of new features, and provide documentation (there is none right now) before then.