The Java 3D API Specification |
C H A P T E R13 |
Execution and Rendering Model |
13.1
Java 3D supports three different modes for rendering scenes: immediate mode, retained mode, and compiled-retained mode. These three levels of API support represent a potentially large variation in graphics processing speed and in on-the-fly restructuring.Three Major Rendering Modes
13.1.1
Immediate mode allows maximum flexibility at some cost in rendering speed. The application programmer can either use or ignore the scene graph structure inherent in Java 3D's design. The programmer can choose to draw geometry directly or to define a scene graph. Immediate mode can be either used independently or mixed with retained and/or compiled-retained mode rendering. The immediate-mode API is described in Chapter 14, "Immediate-Mode Rendering."Immediate Mode
13.1.2
Retained mode allows a great deal of the flexibility provided by immediate mode while also providing a substantial increase in rendering speed. All objects defined in the scene graph are accessible and manipulable. The scene graph itself is fully manipulable. The application programmer can rapidly construct the scene graph, create and delete nodes, and instantly "see" the effect of edits. Retained mode also allows maximal access to objects through a general pick capability.Retained Mode
13.1.3
Compiled-retained mode allows the Java 3D API to perform an arbitrarily complex series of optimizations including, but not restricted to, geometry compression, scene graph flattening, geometry grouping, and state change clustering.Compiled-Retained Mode
13.2
From an application's perspective, Java 3D's render loop runs continuously. Whenever an application adds a scene branch to the virtual world, that scene branch is instantly visible. This high-level view of the render loop permits concurrent implementations of Java 3D as well as serial implementations. The remainder of this section describes the Java 3D render loop bootstrap process from a serialized perspective. Differences that would appear in concurrent implementations are noted as well.Instantiating the Render Loop
13.2.1
First the application must construct its scene graphs. It does this by constructing scene graph nodes and component objects and linking them into self-contained trees with a BranchGroup node as a root. The application next must obtain a reference to any constituent nodes or objects within that branch that it may wish to manipulate. It sets the capabilities of all the objects to match their anticipated use and only then compiles the branch using the BranchGroup'sAn Application-Level Perspective compile
method. Whether it compiles the branch, the application can add it to the virtual universe by adding the BranchGroup to a Locale object. The application repeats this process for each branch it wishes to create. Note that for concurrent Java 3D implementations, whenever an application adds a branch to the active virtual universe, that branch becomes visible.
13.2.2
This initialization process is identical for retained and compiled-retained modes. In both modes, the application builds a scene graph. In compiled-retained mode, the application compiles the scene graph. Then the application inserts the (possibly compiled) scene graph into the virtual universe.Retained and Compiled-Retained Rendering Modes
The Java 3D API Specification |