Auto Removing Unseen Texture Detail

Culling texture data in A boy and His Kite proof of concept

From 4.5GB to 230MB on disk in Epic’s Cinematic “A Boy and his Kite”

Could we save disk space by removing texture regions that are never visible? At Graphine we are developing a texture culling system into our Granite streaming SDK. We tested a working prototype on Epic’s award-winning ‘A Boy and His Kite’. The results are stunning: we reduced the texture storage footprint for the cinematic shot in this demo from 4.5GB to 230MB, keeping just 5% of the original textures, and all without any visible loss of quality.

Smaller Storage Footprint, More Quality

The idea of culling unused content is well known and anything but new. If something is never visible, there is no need to render it. Taken one step further, there is also no need to store it on the disk. By culling texture regions never used in the game or cinematic, we can lower the total size on disk (aka download size) of your project. And the freed space allows you to add even more texture detail to the world.

The Granite texture streaming system lends itself perfectly to culling texture regions from disk. When streaming Granite textures, our tile-based texture streaming system exactly knows each frame which texture regions (parts of texture mip maps) are visible and how many times each region is visible. If we record this information, and pass it along to our texture compression tool, we can recode the textures and omit unused texture regions. And the resulting cinematic with the culled textures would look identical to the original.

We tested our prototype on Epic’s ‘A Boy and His Kite demo’. This demo has a beautiful two minute long cinematic showing a 100-square-mile landscape with many photogrammetry-captured textured objects. We converted 4.5GB of its textures to Granite Tile Set textures. With Granite streaming active, we ran the cinematic and activated our new streaming recording mode. Next, our texture coding tool took the recording output file, recoded the textures and removed the unused regions. We measured the size of the resulting tile sets, and came up with 230 MB in size, a file size reduction of 95%! We replaced the original tile sets with our culled version, replayed the cinematic, and the output was visually identical!

It’s clear this technique has a lot of potential. Not just by decreasing storage requirements, it also allows you to add additional texture detail at a lower cost. For example, you could author your cinematics with stunning 16K by 16K textures, and cull every unseen detail above 4K by 4K to keep storage requirements down. And there are many more use cases: reduce the download footprint of your click and point exploration games or VR cinematic experiences. With the latter, we can even factor in 360 degrees viewing angles with our culling technique.

Recording

How does it work? First of all, our culling system works during production. You run a build of the game in recording mode, recode your textures using the recorded info, and ship the culled textures.

For recording, we added a Granite recording mode to our SDK which records any texture region our streaming engine encounters during gameplay. Granite can do this easily as it already keeps track of this information to know what to stream. In UE4, we created a recording manager component to add to the scene that allows you to configure and steer the recordings. Select the Matinee or Level Sequence you wish to record and start recording by calling the Start function on the manager from Blueprint. Once started, the component plays and records the cinematic, in editor or in the built game. Each recording produces a GSP recording file which can then be passed on to our tools to recode the tile sets.


Recoding Tile Sets

With your recording files, you can begin recoding your Granite textures. Our tools analyse the recording files, figure out which texture regions were ever used, and omit unused regions from the final culled texture. They do this on a tile basis, typically 128 by 128 pixels. Our tile set texture format supports sparse textures natively, without any file format changes, so the resulting sparse textures are compatible with your old and new builds.

You can also tell our tools to cull textures in a certain mip map range. Imagine you want to cull textures in a cinematic by removing visible regions, yet want to keep a base line of quality for roaming free in the game world. You could scale up your textures for the cinematic, for example, up to 16K by 16K, and cull every unused texture region above 4K by 4K, and you would thereby get sharper cinematics at a lower cost!

With ‘A Boy and His Kite’, we recorded the Matinee in a single recording. After recoding five virtual textures with this recording, file size went from 4,394 MB to 230 MB.

Using Tile Sets

Using your new optimized tile sets is as easy as just overwriting your old ones with the new ones, just as you would do when updating a dds or png file for example. Granite can just as easily stream from the updated textures. We didn’t do measurements on performance impact yet, but it is safe to say that we should get a small performance bonus as the streamed tile sets just became significantly smaller.

Wrap up

Culling invisible texture regions has a high potential. It can mean the difference between a 230MB and 44394 MB game to distribute, and it allows a developer to add even more detail to the virtual world. We are still working on the technology, but we hope it makes it in to a mature product soon with the help of our many partners. Interested to try it out? Contact us!


Leave your information