⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rendering.html

📁 JAVA多媒体开发类库说明
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">  <title>Java 3D API - Execution and Rendering Model</title></head><body><h2>Execution and Rendering Model</h2><p>Java&nbsp;3D's execution and rendering model assumes theexistence of a <a href="../VirtualUniverse.html">VirtualUniverse</a>object and an attached scene graph. Thisscene graph can be minimal and not noticeable from an application'sperspective when using immediate-mode rendering, but it must exist.</p><p>Java&nbsp;3D's execution model intertwines with its rendering modesandwithbehaviors and their scheduling. This chapter first describes the threerendering modes, then describes how an application starts up aJava&nbsp;3Denvironment, and finally it discusses how the various rendering modeswork within this framework.</p><p></p><h2>Three Major Rendering Modes</h2><p>Java&nbsp;3D supports three different modes for rendering scenes:immediatemode, retained mode, and compiled-retained mode. These three levels ofAPI support represent a potentially large variation in graphicsprocessing speed and in on-the-fly restructuring.</p><p></p><h3>Immediate Mode</h3><p>Immediate mode allows maximum flexibility at some cost in renderingspeed. The application programmer can either use or ignore the scenegraph structure inherent in Java&nbsp;3D's design. The programmer canchooseto draw geometry directly or to define a scene graph. Immediate modecan be either used independently or mixed with retained and/orcompiled-retained mode rendering. The immediate-mode API is describedin the "<a href="Immediate.html">Immediate-Mode Rendering</a>" section.</p><p></p><h3>Retained Mode</h3><p>Retained mode allows a great deal of the flexibility provided byimmediate mode while also providing a substantial increase in renderingspeed. All objects defined in the scene graph are accessible andmanipulable. The scene graph itself is fully manipulable. Theapplication programmer can rapidly construct the scene graph, createand delete nodes, and instantly "see" the effect of edits. Retainedmode also allows maximal access to objects through a general pickcapability.</p><p>Java&nbsp;3D's retained mode allows a programmer to constructobjects,insert objects into a database, compose objects, and add behaviors toobjects.</p><p>In retained mode, Java&nbsp;3D knows that the programmer has definedobjects, knows how the programmer has combined those objects intocompound objects or scene graphs, and knows what behaviors or actionsthe programmer has attached to objects in the database. This knowledgeallows Java&nbsp;3D to perform many optimizations. It can constructspecialized data structures that hold an object's geometry in a mannerthat enhances the speed at which the Java&nbsp;3D system can render it.Itcan compile object behaviors so that they run at maximum speed wheninvoked. It can flatten transformation manipulations and state changeswhere possible in the scene graph.</p><p></p><h3>Compiled-Retained Mode</h3><p>Compiled-retained mode allows the Java&nbsp;3D API to perform anarbitrarilycomplex series of optimizations including, but not restricted to,geometry compression, scene graph flattening, geometry grouping, andstate change clustering.</p><p>Compiled-retained mode provides hooks for end-user manipulation andpicking. Pick operations return the closest object (in scene graphspace) associated with the picked geometry.</p><p>Java&nbsp;3D's compiled-retained mode ensures effective graphicsrenderingspeed in yet one more way. A programmer can request that Java&nbsp;3Dcompile an object or a scene graph. Once it is compiled, the programmerhas minimal access to the internal structure of the object or scenegraph. Capability flags provide access to specified components that theapplication program may need to modify on a continuing basis.</p><p>A compiled object or scene graph consists of whatever internalstructures Java&nbsp;3D wishes to create to ensure that objects orscenegraphs render at maximal rates. Because Java&nbsp;3D knows that themajorityof the compiled object's or scene graph's components will not change,it can perform an extraordinary number of optimizations, including thefusing of multiple objects into one conceptual object, turning anobject into compressed geometry or even breaking an object up intolike-kind components and reassembling the like-kind components into new"conceptual objects."</p><p></p><h2>Instantiating the Render Loop</h2><p>From an application's perspective, Java&nbsp;3D's render loop runscontinuously. Whenever an application adds a scene branch to thevirtual world, that scene branch is instantly visible. This high-levelview of the render loop permits concurrent implementations ofJava&nbsp;3Das well as serial implementations. The remainder of this sectiondescribes the Java&nbsp;3D render loop bootstrap process from aserializedperspective. Differences that would appear in concurrentimplementations are noted as well.</p><p></p><h3>An Application-LevelPerspective</h3><p>First the application must construct its scene graphs. It does thisbyconstructing scene graph nodes and component objects and linking theminto self-contained trees with a BranchGroup node as a root. Theapplication next must obtain a reference to any constituent nodes orobjects within that branch that it may wish to manipulate. It sets thecapabilities of all the objects to match their anticipated use and onlythen compiles the branch using the BranchGroup's <code>compile</code>method. Whether it compiles the branch, the application can add it tothe virtual universe by adding the BranchGroup to a Locale object. Theapplication repeats this process for each branch it wishes to create.Note that for concurrent Java&nbsp;3D implementations, whenever anapplication adds a branch to the active virtual universe, that branchbecomes visible.</p><p></p><h3>Retained andCompiled-Retained Rendering Modes</h3><p>This initialization process is identical for retained andcompiled-retained modes. In both modes, the application builds a scenegraph. In compiled-retained mode, the application compiles the scenegraph. Then the application inserts the (possibly compiled) scene graphinto the virtual universe.</p></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -