Graphics Core
Currently the complete implementation of all 3d graphics routines in Magnum sit on top of OpenGL. This allows an easy migration to another platform, because OpenGL probably is the graphics API available on the broadest range of computer systems.
Magnum offers the following features for creating rich 3d graphics applications:
- Vertex Buffer Objects and Index Buffer Objects. These are the modern alternative to OpenGL display lists and help to increase the performance by storing all the geometry directly in graphics card memory.
- Abstract Shaders. In order to establish an unified
approach to the fixed function pipeline and the new programmable pipeline,
Project Magnum uses abstract shader classes to perform transformation
and rasterisation. Currently the following shaders are implemented:
- Simple shader without texturing.
- Single- and Multitexturing
- Environment mapping
- Bump Mapping
- Model Loaders. Currently the following formats are
supported for loading geometry:
- 3DS - 3D Studio
- PLY - Stanford Polygon file format
- OBJ - Maya object files
- LWO - Lightwave Object file format
- IFS - Indexed Face Set format
- OFF - 3D Object File format
- MD2 - Quake2 Models (with frame animations)
- MD3 - Quake3 Models (with frame animations)
- MDS - Return to Castle Wolfenstein Models (with bone animations)
- Animations. Both simple frame based vertex animations and complex bone animations with skinning are supported.
- User Interface. In order to simplify the creation of user interfaces, a basic set of widgets for OpenGL is provided in an additional module. You can easily create buttons, switch boxes or simply render text using freetype. The user interface uses a simple but powerful messaging mechanism in order to inform about user input.
- Triangle Striper. For optimal performance, meshes should only contain triangles and these should be organised as so called triangle strips for maximum throughput on the graphics card. Magnum contains a triangle stripr that takes care of the details.
- Optimiser. One key component of the graphics module is the optimiser which can speed up rendering of static models by a magnitude. It uses an advanced multi-pass algorithm that does not only minimize state-changes but also generates a complete assembler program containg all OpenGL calls for best results. This helps to reduce the overhead introduced by virtual calls needed for abstraction.