scene_traversal - ryzom/ryzomcore GitHub Wiki


title: Scene Traversal Pipeline description: published: true date: 2023-03-01T05:20:00.457Z tags: editor: markdown dateCreated: 2022-03-10T12:05:21.592Z

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

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.
⚠️ **GitHub.com Fallback** ⚠️