Marmalade 3D Kit brings together a collection of tools and APIs to simplify the creation of 3D games built using Marmalade Core.
3D Kit technology overview
The diagram below shows how the 3D Kit tools, resources, code and libraries relate to each other.
Click to enlarge
The core API components in 3D Kit are IwGx and related libraries, which provide the rendering and resource loading components of an engine, but do not cover functionality such as scene/entity relationships or scripting.
The IwEngineCore module provides an extensible and lean example engine, built on IwGx and I/O APIs from the core S3E abstraction framework. You can use this as a starting point for building richer engine technology.
Marmalade does not currently provide a dedicated 3D scene/asset editor. Instead, the 3D Kit libraries support importing models, materials, animations and so on directly from Maya and 3ds Max, or from other 3D modelling tools via exporting to FBX.
You can also choose to sidestep 3D Kit entirely and adapt existing C++ engine code to work with Marmalade, running directly on OpenGL ES (supported on all platforms), or Marmalade Core wrappers for DirectX (Windows) and Metal (iOS).
IwGx and IwResManager
The IwGx set of libraries provides 3D primitive drawing (IwGx), model rendering and animation (IwGeom, IwGraphics, IwAnim), bitmap and TrueType fonts (IwGxFont) and a resource manager (IwResManager) to handle loading and optimising models, materials and textures. Often, this set of libraries is collectively referred to as simply IwGx.
IwGx uses its own text file format for assets called ITX. Asset files like this include
.mtl (material) and so on plus a
.group format which collects groups of related assets for easy loading. The IwResManager library can load groups from this text format.
In its debug mode, IwResManager also optimises the data and exports to a binary format. This process can be configured to compress textures to all the common hardware formats such as PVRTC and ATITC, as well as other optimisations such as atlasing. For release builds, the optimised binary data is automatically loaded in place of the source versions.
IwEngineCore is a very lightweight open source engine built on top of IwGx that adds typical entity/scene-graph concepts.
A tutorial for a complete 3D game, walking through what's in IwEngineCore, how to extend it and how to build the game is provided here.
Exporting 3D models
Exporter plugins for most Maya and 3ds Max versions are supplied with Marmalade. These exporters can directly export 3D models to ITX
An FBX converter tool is also provided for converting 3D models exported in FBX format into ITX
.group files. This is useful for tools such as Maya LT or Blender which do not have custom exporters.
Click to enlarge
User interface libraries
Various user interface libraries can be used with 3D Kit:
- The IwUI library uses IwGx and has a text format that works with IwResManager.
- IwNUI provides a useful subset of real native platform controls (e.g. using UIKit) programmatically.
- The 2D Kit Editor, part of Marmalade 2D Kit, can be used to build UIs and import them to run alongside 3D Kit libraries.
- Other libraries, such as Scaleform for loading Flash UIs, are available from third parties.