# A Framework for Learning and Rapid Implementation of Real-Time Global Illumination Methods
## 3 Proposed Framework
### Framework Architecture
#### 3.1.3 Render Subsystem  
Scene Data Management  
The SceneDataManagement Component is responsible for managing the geometry and illumination properties of the scene and to provide access to this information. Scene data is loaded from files on disk and stored in a hierarchy of objects that contain properties. The geometry of the scene objects is transformed into the format required by the OpenGL 4.6 graphics API and is loaded into the GPU memory when the framework starts. Any modification of the scene objects, such as creating or deleting an object or loading an entire other scene, changes the information loaded in the GPU memory. For better management of drawable objects and lighting information in the scene, such as the set of directional, point and spot light sources, we stored the scene information in parallel with the management of the Engine Subsystem. We stored a special scene for the Render Subsystem, similar to the approach of physics engines such as Bullet. This scene is stored in RenderScene class, visible in the class hierarchy in Figure 3.  
The information in the rendered scene is stored optimized for the processes required for the rendering pipeline. One of these processes is the specific iteration through certain types of objects, such as drawable objects or directional, point or spot light sources. Moreover, objects in the rendered scene can be easily queried for information needed for the rendering, such as the position or rendering state. In addition, the scene allows the interrogation of specific information, such as ambient light information. The scene information in the Engine Subsystem must be synchronized with that in the scene in the Render Subsystem. Thus, for any modification of the objects, such as the creation, deletion or change of the rendering state, the information from the render scene must be updated. Rendering Pipeline  
The Render Pipeline Component is responsible for supporting the processing stages specific to the real-time global illumination methods. The framework contains several implementations of rendering pipelines for different real-time global illumination methods for demonstration purposes. However, the quality of the framework is represented by the Rendering Subsystem that allows the rapid and easy development of such methods. This subsystem has been designed with a multi-pass architecture. A rendering pass represents a working unit of the pipeline. A sequence of rendering passes represents a rendering pipeline. This can be seen in Figure 3, through the relationship between the IRenderPipeline and IRenderPass interfaces. To implement a real-time global illumination method, a rendering pipeline and a set of rendering passes must be specialized. The passes can be reused for several pipelines. Concretely, the pipeline specialization must implement the Init() method in which to insert in the list of passes instances of the pass specializations. For example:  
void SpecializedRenderPipeline::Init () {  renderPasses.push_back (new SpecializedRenderPass1 ());  renderPasses.push_back (new SpecializedRenderPass2 ());  renderPasses.push_back (new SpecializedRenderPass3 ());  } ```
The order of inserting the rendering passes also represents the order of execution. The Execute() method of the IRenderPipeline interface is called every frame and calls the Execute(...) method for every rendering pass. A specialization of the IRenderPass interface must implement the methods shown in Figure 3. The Execute(...) method is called every frame, so that it can perform data processing on the CPU or GPU at the frame level. The purpose of this method specialization is to send to the output a render volume obtained as a result of the pass processing. The rendering volume can contain any information, such as the framebuffer resulting from rendering. The class in which this rendering volume is implemented must be a specialization of the IRenderVolume interface. For simplicity, this volume is stored inside a volume container.