
2006:265 CIV MASTER'S THESIS Implementation of a COLLADA scene-graph Johan Lindbergh Luleå University of Technology MSc Programmes in Engineering Computer Science and Engineering Department of Computer Science and Electrical Engineering Division of Media Technology 2006:265 CIV - ISSN: 1402-1617 - ISRN: LTU-EX--06/265--SE Implementation of a COLLADA scene-graph Master's thesis by Johan Lindbergh [email protected] September 11, 2006 Supervisors: Tomas Karlsson Mikael Drugge Luleå University of Technology Systemteknik Preface This thesis was done at Agency 9 AB for Luleå University of Technology Computer Science and Engineering, during late spring and summer 2006. Agency 9 wanted to see if the digital content pipeline could be made more ecient by designing a 3D engine around the open COLLADA format. Tomas Karlsson at Agency 9 had a rough draft for how this could be done using a client-server architecture. The basics of the architecture is that the client should read and parse data and create rendering instructions, while the server takes those instructions and resources and uses them for rendering the scene. The focus of this thesis is on the client part, although data structures relevant to the rendering server will be covered, as well as the communication with the server. I would like to thank Tomas Karlsson and Khashayar Farmanbar at Agency 9 for all help, and of course the other guys at Agency 9 during the period: Micke, Lasse, Johan, Tompa K and Andreas. Special thanks goes to Åsa Lindvall. You know why. Abstract The need for more graphical content in real-time applications is rapidly in- creasing. As hardware becomes more powerful, the polygon limit, shader possi- bilities and thereby also the room for details in a scene or model increases. The work to create these large digital worlds is done using dierent digital content creation tools (DCC tools), for example Autodesk Maya, 3dsMax, Milkshape or Blender. This makes it valuable to have a versatile non-proprietary format that can handle large data sets, and that is what makes COLLADA interesting for this thesis. A COLLADA document can contain and support almost every feature that a modern content creation tool could need. More importantly, it also contains a scene-graph. Agency 9's current 3D engine AgentFX has been using a scene-graph structure for several years. This scene-graph has to be created by manually building the graph; adding and removing nodes and their children, grandchildren and so on. But is it possible to directly use the scene-graph contained in a COLLADA document for a real-time 3D engine? The main goal of the thesis is to implement and evaluate a client-server architecture of a 3D engine with COLLADA as the base format, continuing on Agency 9's path of supporting COLLADA, and using a scene-graph structure. This thesis mainly covers the client part of the 3D engine. It describes the COLLADA format in more detail, and how to parse and store the COLLADA data structures. Also, the issue of how to communicate with the rendering server is addressed. The main conclusion is that the COLLADA structure can be modied and used as the base of a scene-graph based 3D engine. Contents 1 Introduction 1 1.1 Problem formulation . 1 1.2 Purpose . 2 1.3 Background . 2 1.3.1 COLLADA & the Khronos group . 2 1.3.2 Agency 9 . 3 1.4 Other work . 3 1.5 Limitations . 3 2 Methods and theory 4 2.1 XML . 4 2.1.1 Data binding . 4 2.2 Scene-graphs . 5 2.3 COLLADA . 6 2.3.1 Summary . 7 2.4 The COLLADA format . 7 2.4.1 Header . 8 2.4.2 Library . 8 2.4.3 Scene . 13 2.5 Rendering . 14 2.5.1 Resources and instructions . 14 3 Implementation 16 3.1 JAXB . 16 3.1.1 JAXB customization . 17 3.1.2 JAXB usage . 18 3.2 COLLADA Client . 19 3.2.1 Resources and instructions revisited . 19 3.2.2 Animating . 20 3.3 Client parser classes . 21 3.3.1 COLLADAParser . 21 3.3.2 AnimationParser . 21 3.3.3 CameraParser . 21 3.3.4 ControllerParser . 21 3.3.5 EectParser . 21 3.3.6 GeometryParser . 22 3.3.7 LightParser . 23 3.4 Rendering server . 23 iii 3.5 Data structures . 23 3.5.1 Bind package . 23 3.5.2 Vector math library . 24 3.6 Communication . 24 4 Evaluation 26 4.1 Functionality . 26 4.1.1 Client-server architecture . 26 4.1.2 Parsing COLLADA libraries . 26 4.1.3 Camera . 27 4.1.4 Animations . 27 4.1.5 Scene-graph . 27 4.2 Performance . 28 4.2.1 Load time examples . 28 4.2.2 Space costs . 30 5 Discussion 32 5.1 Conclusion . 32 5.1.1 COLLADA as a 3D engine format . 33 5.2 Future work . 33 Bibliography 35 List of Figures 36 List of Tables 37 A Unmarshalling example 39 B Sample COLLADA le 41 Chapter 1 Introduction 1.1 Problem formulation The concept of using a scene-graph has been around for quite some time. IRIS Inventor was one of the earliest, presented in a paper in 1993 [1]. Nowadays, a scene-graph is almost the de-facto standard data structure for representing a virtual world. Current 3D graphics toolkits using some form of scene-graph include Open Scenegraph1, Java3D 2, Gizmondo3, Renderware4 and of course AgentFX 5. For a more thorough explanation about what a scene-graph is, please refer to section 2.2. Until recently, AgentFX has put the work of building the scene-graph on the programmer. Manually creating and connecting all nodes in a content tree can be tedious work and be quite hard to manage. It could also be quite time consuming, especially when creating large virtual worlds. Agency 9 thought that it was possible to use COLLADA's own scene-graph representation to automatically build the scene-graph. Using the information in a COLLADA document, the programmer would no longer have to bother with the initial structuring of the graph. This was implemented and tested in Mikael Lagré's [2] bachelor's thesis (see 1.4) in 2005. Since COLLADA is very well dened, and its goal is to incorporate as many features in modern content creation tools as possible, it would be interesting to see if one could build an engine that can read and parse an entire COLLADA document. Then, depending on machine capabilities and implemented features, the engine should make its best eort to render the scene. Tomas Karlsson, CTO at Agency 9, had an idea of a client-server architecture for a 3D engine. The client should be responsible for reading and parsing the COLLADA data. The data should then be packaged and sent to a rendering server. The server [3] (see 1.4) is then responsible for implementing functionality of rendering what it can handle. The COLLADA documentation [4] quite clearly states that COLLADA is not a game engine format as such, rather that it is benecial in the content 1http://www.openscenegraph.org/ 2https://java3d.dev.java.net/ 3http://www.gizmosdk.com/ 4http://www.renderware.com/ 5http://www.agency9.se/ 1 1.2. PURPOSE CHAPTER 1. INTRODUCTION production pipeline. The documentation does however not point out any obvious problems with using COLLADA as an engine format, just that applications will use proprietary, size-optimized binary les. Whether there is some substance in those statements remains to be seen. 1.2 Purpose Agency 9 feels that it is worth researching the possibility to use COLLADA more or less as an engine format. Using the client-server architecture, the client should be able to supply the server with all data needed for rendering, and probably more than that. The goal is to be able to use the client and server as separate entities. Dierent rendering kernels could be used by the server, and depending on the kernel, dierent amounts of the data sent could be used in the rendering process. The purpose of this thesis is to learn as much as possible about XML and COLLADA, and to see if it is possible to take the whole COLLADA structure, including both resources and scene-graph, and map it to a real time rendering engine. Most of the work will be to understand the COLLADA structure and decide what to do with the data contained within a .dae6-le. Another big part of the work will be the learning about XML and data binding, implementing resource parsers and key-frame interpolation. Yet another part of the thesis project is to decide, together with Tomas Karlsson and Lasse Wedin [3] how to talk to the rendering server. Some problems in Lagré [2] arised because of the requirement to t the current version of AgentFX. These problems might be avoided by redesigning the 3D engine from scratch. Another higher purpose is thus to lay the foundation for a new iteration of AgentFX. 1.3 Background 1.3.1 COLLADA & the Khronos group COLLADA, from COLLAborative Design Activity, is basically an open Digi- tal Asset Exchange Schema for the interactive 3D industry. COLLADA is a standard of the Khronos group7. The Khronos group was founded in January 2000 by a number of media- centric companies including ATI, Creative, Google, Intel, nVidia, Ericsson and Sun Microsystems. The group is dedicated to creating open standard APIs and enable the authoring and playback of rich media on a wide variety of platforms and devices. Current media APIs and technologies are OpenGL R , OpenGL R ES, OpenVGTMand COLLADATMamong others.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages53 Page
-
File Size-