- Increase the number of textures used in the shader.
- Allow up to four textures per terrain chunk. These would be determined either programmatically based on which texture layers were in use on that section, or defined by the artist.
- Implement a virtual texture system like id Software used in the game Rage.
Comments
It's called programmer art. A competent artist can apply dirt and rocks anywhere they want to break up the detail. There's also a lot of tricks we can do to improve this, but they're not in the prototype we have running now.
Article approved, and +1 for article on virtual texturing! Definitely, any source on implementation of (sparse) virtual textures (megatextures, or call it however you like ... all in all it's just a clever use of Level-of-Detail and for better performance, texture atlases) is greeted by me...
Anyway I'll give few points here, as I've already spent a lot of time with megatextures (I'm although not developing for mobile devices, only for PCs).
1) Breaking terrain to chunks is okay, but, I'm using as small chunks, that you don't need to futher "break" the chunk for single "chunk" of virtual texture, which should have like 128x128 or 256x256 pixels. So terrain chunks are quite small, plus I need at least diffuse, normals and displacement channel for virtual texture, compressed using (S3TC) block compression.
2) These small chunks are loaded as pages into large texture (I use 2048x2048 for 128x128 chunks) this means max. 256 pages. Of course in this case a page-table is a must.
3) Calculating which pages I need in the memory is the hardest part. Using the thing you described earlier is good, but keeps a lot of redundant pages in memory generally.
I stayed with ID Soft presentation and used redundant rendering pass + readback (I'm gotta try to use compute shader here though - just to see whether it'll be faster) to determine which pages I need. Dynamic reflections are although a bit of problem, as I don't see high detail textures sometimes (but as I use normal mapped surfaces for reflections it really isn't visible).
Or you can just guess the pages you need by simple heuristics. I've had quite good results with brain-dead computation of visible tiles with frustum culling, and "mip-level" determination by distance to camera... not as good as rendering pass, but definitely less expensive.
4) Using paging instead of using separate textures (like you used, at least thats what I got from the article) makes your texture filtering harder. You though have all the lower mip-levels in memory, and determining mip level is easy. Linear filtering needs a little more computation (for texture boundaries) ... and anisotropic is a bit harder. There was a discussion on Mollyrocket about "texture filtering of virtual textures" - read here if you're interested https://mollyrocket.com/forums/viewtopic.php?t=826
I appologize for long comment, but I think these points might be mentioned in comments.
EDIT: Just to add a bit of math... virtual textures are not always the best solution, especially for large open worlds (even though, they might be viable and good - uniqueness rules). Let's say you have 2km x 2km terrain, you want 64 pixels per meter (which is good looking), you need 128000x128000 texture to cover it, assuming you use BC1 for color, BC5 for normals (reconstructing 3rd component0 and BC4 for height map, you need 3.8 GB for color, 7.6 GB for normals and 3.8 GB for displacement, assuming normals and displacement can be at half resolution (quarter size), gets you to 3.8 GB for color, 1.9 GB for normals and 0.95 GB for displacement , summed up to 6.65 GB for just terrain. Which is usable... but larger resolution is just meh to distribute with game.
Vilem, we dynamically generate the megatexture data instead of paging it from the hard drive. This makes it scale extremely well for large worlds.
With the Leadwerks 3 terrain system, I wanted to retain the advantages of terrain in Leadwerks 2, but overcome some of the limitations. id Software's "megatexture" technique offered artistic freedom, but there were some serious issues to overcome.
Nice article, but why there are still texture repetitions/tiling visible on every shot in a article that tries to solve this ? :)