1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"[]>
2<html xml:lang="en-US" lang="en-US">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../css/document.css" type="text/css" />
7    <title>Process Flow</title>
8  </head>
9  <body>
10    <h1>Process Flow</h1>
11
12    <h2 id="update_sequence">Update Sequence</h2>
13    <div class="section">
14      <p>
15        The figure below shows the update sequence. Although this sequence is executed repeatedly, the repetitive processes can be eliminated depending on changes in the scene.
16      </p>
17      <img src="images/sequence.png" />
18    </div>
19
20    <h2> (1) SceneInitializer / SceneTraverser </h2>
21    <div class="section">
22      <p>
23        <a href="../../nw/gfx/SceneInitializer/Overview.html">SceneInitializer</a> executes initialization processes, such as material ID calculation, for each node in the SceneTree. 初期化には <a href="../../nw/gfx/SceneInitializer/Begin.html">SceneInitializer::Begin</a>, <a href="../../nw/gfx/SceneInitializer/End.html">SceneInitializer::End</a>, and <a href="../../nw/gfx/SceneNode/Accept.html">SceneNode::Accept</a> are used.
24      </p>
25      <p>
26        <a href="../../nw/gfx/SceneTraverser/Overview.html">SceneTraverser</a> traverses the SceneTree (the hierarchical structure for <a href="../../nw/gfx/SceneNode/Overview.html">SceneNode</a>), serializes each SceneNode, and outputs the result to <a href="../../nw/gfx/SceneContext/Overview.html">SceneContext</a>. <a href="../../nw/gfx/SceneTraverser/Begin.html">SceneTraverser::Begin</a>, <a href="../../nw/gfx/SceneTraverser/End.html">SceneTraverser::End</a> and <a href="../../nw/gfx/SceneNode/Accept.html">SceneNode::Accept</a> are used to traverse a scene.
27      </p>
28      <p>
29        A scene must be initialized and traversed again if there is a change in the SceneTree structure such as due to adding a node (<a href="../../nw/gfx/SceneNode/AttachChild.html">AttachChild</a>) or deleting one (<a href="../../nw/gfx/SceneNode/DetachChild.html">DetachChild</a>).
30      </p>
31      <p>
32        Execute <a href="../../nw/demo/SceneSystem/InitializeScene.html">demo::SceneSystem::InitializeScene</a> in the demo library.
33      </p>
34    </div>
35
36    <h2> (2) SceneUpdater::UpdateAll </h2>
37    <div class="section">
38      <p>
39        <a href="../../nw/gfx/SceneUpdater/UpdateAll.html">SceneUpdater::UpdateAll</a> updates positional information according to the coordinate system (<a href="../../nw/gfx/SceneUpdater/UpdateTransformNode.html">UpdateTransformNode</a>) and updates deform information (<a href="../../nw/gfx/SceneUpdater/UpdateSkeletalModel.html">UpdateSkeletalModel</a>) for the SceneNode registered in <a href="../../nw/gfx/SceneContext/Overview.html">SceneContext</a>. It also updates animation (<a href="../../nw/gfx/SceneUpdater/EvaluateAnim.html">EvaluateAnim</a> and <a href="../../nw/gfx/SceneUpdater/UpdateAnim.html">UpdateAnim</a>). Calling UpdateAll will execute all of these processes at once. However, they may also be called individually as required.
40      </p>
41      <p>
42        This process must be executed in order to apply node translations and/or animations.
43      </p>
44      <p>
45        Execute <a href="../../nw/demo/SceneSystem/UpdateScene.html">demo::SceneSystem::UpdateScene</a> in the demo library.
46      </p>
47    </div>
48
49    <h2> (3) SceneUpdater::SubmitView </h2>
50    <div class="section">
51      <p>
52        <a href="../../nw/gfx/SceneUpdater/SubmitView.html">SceneUpdater::SubmitView</a> updates information dependent on the view coordinate system. Next, create a key for sorting meshes (<a href="../../nw/gfx/res/ResMesh/Overview.html">ResMesh</a>) and register meshes (<a href="../../nw/gfx/BasicRenderQueue/EnqueueMesh.html">EnqueueMesh</a>) in <a href="../../nw/gfx/BasicRenderQueue/Overview.html">RenderQueue</a>. RenderQueue will now include the <a href="../../nw/gfx/BasicRenderElement/Overview.html">RenderElement</a> list structure.
53      </p>
54      <p>
55        The key used for sorting is created using <a href="../../nw/gfx/BasicRenderKeyFactory/Overview.html">BasicRenderKeyFactory</a> and its derived classes.
56      </p>
57      <p>
58        This process is executed when the View coordinate system has been changed. Execute <a href="../../nw/gfx/Camera/UpdateCameraMatrix.html">Camera::UpdateCameraMatrix</a> to apply camera movements and changes by the view updater or projection updater to the view coordinate system.
59      </p>
60      <p>
61        This process should be re-executed in cases such as when the view updater is changed or the camera is switched. However, if the camera moves, take care that movement of the camera is not reflected unless nodes are moved by executing UpdateAll in (2).
62      </p>
63      <p>
64        Execute <a href="../../nw/demo/RenderSystem/SubmitView.html">demo::RenderSystem::SubmitView</a> in the demo library.
65      </p>
66    </div>
67
68    <h2> (4) std::sort </h2>
69    <div class="section">
70      <p>
71        Render targets registered in RenderQueue will be arranged based on sort keys. Execute <a href="../../nw/demo/RenderSystem/SubmitView.html">demo::RenderSystem::SubmitView</a> in the demo library in conjunction with SubmitView in the previous section.
72      </p>
73    </div>
74
75    <h2> (5) MeshRenderer::RenderMesh </h2>
76    <div class="section">
77      <p>
78        <a href="../../nw/gfx/MeshRenderer/RenderMesh.html">MeshRenderer::RenderMesh</a> creates a command for rendering meshes. This results in generation of CommandList which is executed by the GPU to carry out rendering.
79      </p>
80      <p>
81        Commands for rendering meshes are created by executing <a href="../../nw/demo/RenderSystem/RenderScene.html">demo::RenderSystem::RenderScene</a> and <a href="../../nw/demo/RenderSystem/RenderStereoScene.html">demo::RenderSystem::RenderStereoScene</a> in the demo library. Command list management and execution is carried out by <a href="../../nw/demo/CommandListSwapper/Overview.html">demo::CommandListSwapper</a>.
82      </p>
83    </div>
84
85
86  <hr><p>CONFIDENTIAL</p></body>
87</html>