I'm Jon Olick. I make shiny things. I simplify.


I presented Sparse Voxel Octrees at Siggraph 2008.

Friday, February 4, 2011

High Resolution Textures -- The Field Guide

The options:

Static Texturing
No dynamic loading. Just use higher resolution static textures. Standard stuff.
- VRAM limited

Dynamic Texturing
Dynamically load mips (Unreal 3 style).
+ Allows for much higher resolution
- Still ultimately resolution limited.
- Sometimes implemented with a feedback pass to a low resolution buffer.

Virtual Texturing
Dynamically load parts of textures.
+ Use as high of resolution textures as your heart desires.
+ Static memory footprint
- Sampling the virtual texture is slightly slower than Static or Dynamic texturing.
- Bi-linear filtering. (Tri-linear is possible, but requires more work.)
- Requires an extra rendering pass with most implementations (for the feedback of what pages to load)
- Problems with transparent materials. *****
- Popping mips when the disk streaming doesn't keep up very well with the game. *

Unique Virtual Texturing (AKA Mega Textures)
For each mesh in the world, allocate a portion of virtual texture space for that mesh and then bake in any lighting and diffuse information.
+ Use as high of a resolution texture as your heart desires.
+ Static memory footprint
+ Infinitely complex lighting algorithms.
+ Can bake in decals to allow an infinite number of them. ****
- Bi-linear filtering. (Tri-linear is possible, but requires more work.)
- Requires an extra rendering pass with most implementations (for the feedback of what pages to load)
- Iteration time is very slow
- Popping mips when the disk streaming doesn't keep up very well with the game. *
- Lighting is mostly static. **
- Requires massive disk space. ***
- Some games may have a world that is too big for UVTs -- exceeding floating point precision.
- Problems with transparent materials. *****

* The popping can be mitigated through "blending" of tiles as they load. However this requires using RGBA uncompressed textures for your physical tiles -- making texture reads slower and increasing memory requirements.

** I toyed around with animating virtual textures, so that you could have looping or one off lighting animations. Is a lot of extra space, and streamer had a hard time keeping up with the animation. Not impossible to pull off though, so something to keep in mind.

*** The disk space is typically reduced by both compression, and not storing the higher mips for areas that are never seen in game. If you happen to predict incorrectly, they just see a blurry texture.

**** Watch out for problems with changing the meshes after the baking process. Causes headaches.

***** VT typically uses a feedback rendering pass to a low resolution buffer to tell what to load and what not to load. This is typically rendered opaquely. The common work around is to render transparent materials using Standard or Dynamic texturing.

Where is the sweet spot?

Standard texturing is the easiest to implement.

Unique virtual texturing offers the best results.

But -- Virtual Texturing takes the prize.

Huh?
While Unique Virtual Texturing is great, it doesn't work for every game (your world size may be so large that it is unrealistic or you require a day-night cycle), and the bake times for lighting and texturing can be horrendous -- making fast iteration very hard.


Living Blog Post
I'll be updating this blog post from time to time as reference for myself and others. If you would like to see something added or corrected, send me a message or post in the comments.

-- Kind of wish this was a wiki or something. --

3 comments:

  1. Have you considered that it's possible to mix 'virtual texturing' and 'unique virtual texturing' as there is no reason why vt pages cannot be reused in multiple locations? (using baked lighting is obviously tricky here) Also, if you split you vt page table into sections, and make sure no texture ccordinates of any geometry cross a section, then you can allicate page table sections for geometry on the fly, avoiding the size limitations and fp issues (havent tried this yet though).

    ReplyDelete
  2. That sounds like a really interesting idea to work around the FP issues. :) very cool!

    ReplyDelete
  3. Why "the bake times for lighting and texturing can be horrendous", others engines do it in real-time ?
    Not baking in VT lighting and have a multi-layer VT is a solution, all maps for the same mesh could be pack together. A such solution is not feasible on PS3/Xbox360 ?
    It's a novice question...

    ReplyDelete