Using SVG for graphically rich 2D content in mobile 3D games

Kiia Kallio
Software Engineer
Fathammer Oy
Tammasaarenkatu 7 A
FIN-00180 Helsinki
FINLAND
phone: +358 40 5077 908
e-mail: kkkallio@fathammer.com
http://www.fathammer.com

Keywords: 3D, mobile gaming, texture generation, SVG

Extended Abstract:

Traditionally, textures in 3D applications have been based on bitmaps or algorithmically generated procedural textures. There has been no reason to use vector graphic formats for textures, as the visual quality of vector graphics has been generally worse than with bitmap images. Also 3D rendering techniques require either transforming the vector image into 3D polygon data or rendering into a bitmap, thus getting only a small benefit of a vector format.

The benefits of vector graphics, independency of resolution and small storage space requirements, have not been generally considered significant from the point of view of 3D game developers.

In a mobile 3D gaming environment - such as Nokia Series 60 platform, Sony Ericsson P800 or PocketPC PDA's - the storage space limitations pose new challenges for the game content. Although processing power and runtime memory limitations allow visual quality comparable to Sony Playstation 1, the storage space is reduced to a fraction - instead of a CD-ROM the game should fit into a few megabyte memory cartridge.

The mobile space is also populated by several competing devices with various display resolutions. Vector graphic approach to 2D content allows game developers to create content that scales well on various devices. When used as textures, vector images still have to be rendered into bitmaps, but for UI components it is possible to render the vector image directly to the screen, thus saving the memory required for a bitmap.

The biggest problem with vector formats is the limited artistic expression. Vector graphics tend to produce comic-like images and are not suitable for rendering natural materials - things that are essential to rich 3D environments. However, SVG has a mechanism that can be used to get around these limitations: filter effects. In addition to the usual drop shadow effect, filters allow creation of a wide variety of natural-looking textures.

SVG filters are powerful in the hands of a programmer who knows image processing and SVG specification inside out. However, there are no good tools that enable artists to design the effects themselves - for most graphic designers, writing SVG code is not an option. The available tools provide only a pre-defined selection of filter effects or at best allow only slight modifications of them. SVG Filter Editor, included with the X-Forge 3D Game Engine, is a tool that enables artists to construct the filters visually without writing SVG code, but still allowing access to all the filtering features of SVG specification. SVG Filter Editor can be used alongside a vector drawing package, such as Adobe Illustrator, or independently for editing filter definitions of existing SVG files.

SVG file format is not optional for tight storage limitations in one aspect: as a text based format it takes more space than necessary. Also the XML parser adds up to the size of the executable, and DOM tree has quite large runtime memory requirements. However, it is possible to move the parsing process from the load time to the content creation tool chain by using a pre-parsed binary format.

Also current mobile SVG profiles are not designed according to these requirements. Features regarding image quality are considered secondary, and more attention is placed on multimedia and interactivity features. Therefore, the subset of SVG supported by X-Forge 3D Game Engine is not based on current mobile profiles, although features required for SVG Tiny are included in the subset definition.