This document describes OpenGLContext's "flat" rendering process. This process uses client-side (not GL-side) calculations to produce composed transformation matrices which are directly loaded before rendering geometry. The rendering process is considerably less involved than the original design, in which a set of separate "RenderPass" objects each traversed the whole scenegraph; that system has since been removed.
The flat pass carries two implementations: a legacy fixed-function path (the compatibility profile) and a shader path (the core profile). For how the shader path works -- its passes, shader programs and the VRML97 lighting shaders -- read Core-Profile Rendering; for the physically based renderer built on it, read Physically Based Rendering.
PyVRML97 allows for watching updates to properties of nodes. OpenGLContext uses this to watch for all updates to node fields within a scenegraph. For each path to each node, it records a NodePath object which can calculate (and cache) the combined transform matrices for the path.
With this data structure (essentially a list of matrices and Render nodes), the scenegraph can be rendered with a number of simple iterations, rather than with a complex traversal mechanism (which traditionally was a significant factor of OpenGLContext run-time).
The default flat render pass also includes "colour select" rendering. That is, it can do a selection rendering pass which can be queried to process incoming mouse events to find the object under the mouse. This avoids the use of the legacy select render mode.
So let's take a look at how the rendering process is triggered, from
the moment the GUI library sends the "OnPaint" or equivalent event to
the Context through to the calling of an individual RenderPass.
Earlier versions instead built an OverallPass holding a set of sub-passes, each of which traversed the whole scenegraph in turn. That system was removed once the flat pass replaced it.