If you are thinking of developing a game engine, or are in the process of it, you may wonder "How do you load data into a game engine?" One answer is to provide it manually. Although it may seem inefficient, it works perfectly for simple shapes and in early stages of development. However, as your engine improves, the best way to load data into a game engine is to develop a Digital Asset Exporter and a Digital Asset Loader.
Game engine development requires the development of an external plug-in that extracts geometrical data from a 3D character. This plug-in is known as a Digital Asset Exporter (DAE), and it interfaces with modeling tools like Blender 3D.
The DAE is part of a bridge between Blender and the engine. Whereas Blender helps with the creation of a game character, the DAE extracts data required by the engine.
At its most basic, the DAE extracts the following information from a character's mesh:
- Vertices
- Normal vectors
- UV coordinates
- Texture image
The Digital Asset Exporter is only part of the equation. Once the raw data is available, a Digital Asset Loader (DAL) loads the raw data into the engine's data structures. However, the DAE must provide the raw data to the DAL in an XML-format which the DAL can parse.
Once the data is in the engine's data structures, the rendering manager sends this data to the GPU for rendering.
Unlike the DAE which I developed using Python and resides outside the engine, the DAL was developed using C++ and is part of the engine.
In my experience, the most complicated part of developing a DAE was understanding the Blender API, getting acquainted with 3D modeling terminology and using Blender itself.
I am not an artist. So I had to learn Game Character Modeling before I was able to develop the DAE.
The DAL is straightforward to implement. I ended up using the TinyXML API which parses XML-format documents.
Hope this helps.