When developing 3d games, the allure of using a pre-built game engine is all too great. The trouble is nowadays you really need a good content pipeline in order to take 3d objects from your modelling tool and render them in your game, which in the past has usually required someone on the development team to write an elaborate tool-specific exporter script or plugin.
Fortunately nowadays with solutions such as collada you can now pretty much skip the “write exporter” stage and move the logic to generate runtime model data into the engine itself. However you still need something to handle animation and skinning. There are a few solutions out there, but they either contain too much baggage or the licensing isn’t so great.
So I decided to try making something myself. My requirements were as follows:
- Written in standard C++
- Proven codebase
Most importantly I wanted to base my solution off of something I knew already worked, and I knew just the thing: the “dts” code from Torque3D, which has been in use in some form or another for over a decade.
DTS itself is quite a featured format, being suitable for rendering level geometry with basic culling and fully rigged and skinned character models. In Torque3D there is even a whole content pipeline so you can go straight from collada dae to “compiled” dts shape.
You might be thinking now “Wait a minute, this DTS stuff must be tightly integrated into Torque3D. Won’t I have to include 99% of Torque3D to use this?”
This is where the beauty of libDTShape comes in. libDTShape is an extremely stripped down version of the DTS code from Torque3D. It includes only the essential code which is needed to both load and create a DTS shape, while leaving you to implement the rendering. It lives in its own namespace, so it can work independently of your own code. It is also configurable, allowing you to strip down the code even further (e.g. to remove collada support).
For those who want to just quickly load a shape and see what you can do, don’t worry! libDTShape also includes a basic example OpenGL renderer.
Admittedly as it currently stands libDTShape is a bit of an experiment, but still I hope this can be useful to others.
libDTShape can be found here: https://github.com/jamesu/libdtshape