< Zurück | Inhalt | Weiter >

4.7 Immediate mode vs. retained mode vs. mixed mode

Java 3D does not interact directly with system display hardware to produce the 3D rendering of a scene, but rather relies upon a lower level 3D graphics API: currently either OpenGL or DirectX. The designers of Java 3D have added several locations within the Java 3D rendering loop that application developers can hook into to directly render 3D primitives irrespective of the current scenegraph.

Using Java 3D in retained mode does not exploit these capabilities. This is usually the recommended and most common mode for Java 3D. The application developer defines the scenegraph for the application, passes it to Java 3D, and Java 3D is responsible for rendering the scene. Java 3D also coordinates and carries out a lot of the chores related to user interaction.

In complete contrast, using Java 3D in immediate mode does not exploit Java 3D’s scenegraph abilities at all, and the application developer assumes all responsibility for rendering and user interaction. Java 3D is merely being used as a cross−platform Java wrapper over the native low−level graphics API.

As its name implies, running Java 3D in mixed mode exploits some of each of the features of retained mode and some of the features of immediate mode. The application developer does define a scenegraph for some of the items in the scenegraph but retains responsibility for rendering certain 3D primitives that fall outside of the scenegraph structure.


4.7.1 Immediate mode
From ImmediateTest.java
4.7.2 Mixed mode
From MixedTest.java
4.7.3 Summary of modes
Retained mode
Mixed mode