To achieve texture streaming, the Granite texture streaming library splits the texture in tiles. Tiles are small rectangles of texture data. Tiles are the basic unit of processing in the Granite SDK. All data is loaded, coded and processed one tile at a time. The Granite SDK also supports multiple resolution levels (also known as ‘mipmaps’). To achieve this, the resolution levels are split into tiles as well. While the idea of tiles is simple, coding it quickly gets difficult.
First, to support advanced filtering algorithms such as anisotropic filtering, you have to ensure that your tiles are correctly set-up with overlapping borders. Secondly, as tiles are now loaded at run-time, all image processing and compression algorithms have to be highly optimized. But don’t worry: the Granite SDK takes care of all this behind the scenes.
To create the tiled textures, our tools import all your texture data into an efficient file format for large image data sets. The pixel data is highly compressed, using state of the art image compression techniques. The Granite SDK compression systems are specifically tuned for game specific data types, such as normal maps and alpha channels. Our tools quickly and efficiently convert your source art to our streamable file format.
At run-time, the library then quickly transcodes data from our custom compression format into a GPU friendly format (like DXT1 or DXT5). Doing this allows for hardware accelerated sampling in your shaders, while reducing the amount of video memory. Our transcoder algorithms are highly optimized (using assembly on most platforms) and can easily be run off the main game thread, allowing you to make optimal use of multicore systems.
The Granite SDK works independent of a particular graphics API and allows you to plug it in at any level in your game engine. Whether you want to use it for all the objects in the game or just as a special effect on some surfaces, the Granite SDK offers an easy integration path that allows you to customize all aspects of the library: graphics, IO, threading and memory allocation. And if you just want something going quickly, you can use high performance default implementations straight away.