General Overview of NL3D
Introduction
The NeL 3D library includes 3D audio and video rendering modules.
The objective of the 3D library is to provide an architecture framework for housing the code modules required for representing a virtual universe, and its contents, in 3D.
Nevrax is developing the code modules required to represent the universe that their product is based around. This universe includes animated characters, objects and special effects in a variety of environments including undulating terrain, towns and the insides of buildings.
Portability
NeL 3D library is structured in layers built on top of a common driver layer. The Nevrax team developed the OpenGL and DirectX implementation of the driver layer. Of course, only the OpenGL implementation works on GNU/Linux.
NeL 3D is currently tested on Microsoft Windows platforms but compiled on GNU/Linux
Target Platforms
There are background loading and dynamic level of detail systems that apply to all components of the 3D library, allowing the software to be adapted to run efficiently on different specifications of hardware.
The target test machine specification is as follows:
- Intel Pentium 3 1GHz
- Graphics card comprising Nvidia NV20 chipset
- 128MBytes RAM
Nevrax expect their product to run at 30fps at 1024x768 resolution on a machine of this specification.
Features
Undulating Landscapes
- Bezier patch landscape modeling gives NeL enormously more flexibility than traditional height fields. NeL supports vertical faces, overhangs, and so on.
- The ROAM algorithm is used to provide adaptive subdivision of the landscape based on distance from the camera, steepness, etc.
- Geomorphing is used between LODs (levels of detail) to eliminate popping.
- Landscape coloring effects include vertex coloring and application of pre-calculated shadow maps. Pre-calculated shadows can have soft edges while real-time shadows obviously can not. Shadows can be colored and faded at run time
- Lightmaps are used for landscape lighting to avoid lighting changing with LOD transitions
- Landscape texture mapping at a constant 1.5cm/ texel, with the possibility of a second complete additive texture layer. Texture continuity breaks due to bilinear filtering have been eliminated.
- Landscape is dynamically streamed into memory with background loading
- 'Snap To Ground' functionality allows objects that are on the ground to remain attached to the surface as it geomorphs
- Displacement maps (also known as geometric noise) - these are taken into account during lightmap generation which means that they can still be 'seen' at low levels of detail
- Dynamic lighting
Portal-based Streets and Interiors
- Static light maps: up to 3 layers of light map simultaneously - each layer can be enabled, disabled, faded or colored in real time
- Tools: light map generation: max plugin: support for different lamp types, ray tracing for shadows, projected images (like a slide projector), support for colored translucent objects influencing light color (eg colored glass), support for saturation (with lighting at > 100%), mixing of vertex colors into light map calculation
- Use of portal algorithm for view determination
Characters and objects
- Component based object construction, which allows the assembly of multiple "parts" of objects into a single mesh around a single skeleton
- Multi-Resolution Meshes, to provide a smooth reduction in polygon count as objects retreat into the distance. Full implementation of the technique presented by Hope, in a recent paper, with geomorphing. This implementation provides superior results for low detail LODs and smooth transitions between LODs.
- Optimized management of extremely low detail 'billboard' versions of objects
- The LOD system is capable of working with a subset of the LODs. This means that the high detail LODs don't have to be loaded if there is insufficient memory or if the client machine is not sufficiently powerful to make use of them.
Animation
- Skinning: support for skinning with up to 4 matrices per vertex
- Smooth transitions between animations
- Controllable blending of multiple animations (eg 70% walk + 30% limp)
- Application of different animations to different parts of skeleton (eg run + punch)
- Animation types (so far): bones, material & light parameters
- Animation export plugins for 3DStudio Max: feature more or less complete set of 3DStudio animation controllers (bezier, TCB, linear, etc) and support for biped (Character Studio) skeleton
- Skinning export plugins for 3DStudio Max: support both physique (character studio) & com_skin2 skinning data
- Blended Shape animation, to provide morphing and lip-sync style animations
Materials
- Support for environment mapping, multi-texturing, texture-coloration.
- Tools: more or less complete support for 3ds max materials
- Vertex and pixel shader implementations for GeForce3 and above
Particle System
- Support for various particles representations, including dot, line, triangles fans, bitmaps, shockwave, ripples, meshes.
- A variety of emitters are available : mesh, cone, plane, points and sphere emitters.
- Forces can be applied to particles
- Support for simple collision shapes for particles
- Support for LOD with distance
- Tools: custom WYSIWYG editor in the ObjectViewer
- Particle systems can cast light into the scene and be lit by scene lights
- Integration of tools with Max and with animation exporters
Other Special Effects
- Screen distortion effects
- Real time shadow casting
- Water rendering effects
Technical Features
- Exploitation of 3D graphic accelerator cards' TNL, pixel shader and vertex shader capabilities.
- Adaptive memory management with background hard disk data streaming.
- Adaptive texture and polygon detail to manage CPU load, GPU load and video memory constraints.
Architecture
The rendering process is composed of several traversals. Each traversal acts on their models using virtual methods. The rendering process is done following this pipeline:
- Transform animation traversal
- Transform traversal
- View determination and culling traversal
- Detail animation traversal
- Load balancing traversal
- Lighting traversal
- Render traversal
Transform Animation Traversal
This traversal must evaluate the transforms animated value to get the final parent relative world matrix of each model. We must do this pass to know where each model is.
Transform Traversal
This traversal composes each transforms matrix with the parent one to get the final world matrix. This pass is used to perform hierarchical animation of models.
View Determination and Culling Traversal
This traversal clips models that are not visible. It uses clusters/portals for interiors and a frustrum clipping for exteriors.
Load Balancing Traversal
For each model traversed this traversal evaluates what rendering resources the model requires. It counts the number of primitives that it needs to have rendered and amount of vram used by their textures.
Detail Animation Traversal
This traversal computes the animation for all values not animated in the first pass (transform animation). Animation is done in 2 passes because the first must be done to get models' world bounding box used in view determination. The second pass is done only on visible objects.
Lighting Traversal
This traversal computes dynamic lighting for each visible model with non-clipped lights.
Render Traversal
Render is the most complex traversal.
- If the model uses skinning, it will compute bones world matrices. Matrices have been set by second animation pass but they need to be combined with their parents.
- If the model has an inverse kinematics solver attached, it is evaluated next.
- If the model supports resource load balancing, the final count of rendering primitives is adjusted in function of the distance from the camera.
- The primitives to send to the driver are built.
- The primitives are rendered by the driver.