-
Notifications
You must be signed in to change notification settings - Fork 94
scene_traversal
title: Scene Traversal Pipeline description: published: true date: 2023-03-16T23:01:11.143Z 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.
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.
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.
This traversal clips models that are not visible. It uses clusters/portals for interiors and a frustrum clipping for exteriors.
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.
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.
This traversal computes dynamic lighting for each visible model with non-clipped lights.
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.