L3DT development blog
Large 3D terrain generator


Hi All,

Since release 2.1 back in 2003, L3DT has been able to generate so-called 'Megatextures'. These textures are rather large (32k x 32k pixels or greater) and rather detailed (32x texture to heightfield res or greater), and require both dynamic paging and texture mip/clip-mapping to render on current hardware. Up until now, however, we L3DT users haven't had a 3D renderer that could efficiently handle that much texture data. L3DTVi2, the 'old' renderer for L3DT, handled the paging part but not the mipmapping. This meant that whilst it could render large textures (32k x 32k were OK), it choked on the highly detailed textures (e.g. 32x res) because it ran out of texture memory. Sapphire, the 'new' renderer for L3DT, now supports both dynamic paging and mipmapping, which means that it can now render megatextures with framerates comparable to our normal 'tiny' maps.

Here are some screenshots of Sapphire rendering a 1024×1024 heightfield with a 32k x 32k pixel (3GB) texture.

For best results, click on any of the images below for a fullscreen render.

Firstly, and aerial shot (~20fps)
Now, a bit lower down at the same corner (~5fps)
Standing on the rock in the middle of the image above, looking to the left (~5fps)
Moved to the left, looking to the right (~20fps)
Back at the corner, but with camera zoomed in 8x (<1fps)
Zooming in further (still sharp, but «1fps )
A random shot from the opposite corner of the map (~20fps)

If you're still not sure just how detailed a megatexture can be, consider this 2048x2048 pixel texture tile, which covers a single 64×64 pixel tile of the heightfield. That's a lot of detail, and I'm pretty happy that I managed to render all this on an elderly 256Mb 128MB1) graphics card (did I mention the texture was 3GB uncompressed?).

Note also that I'm not yet using any shaders here, and nor am I cheating by using a detail map. This is all fixed-function pipeline OpenGL 1.2.

Now, you may have noticed that the frame-rates of the zoomed-in images above are just dreadful (<1 fps). What has happened here is that I've zoomed in to the point where I've run out of video memory. Clearly I have to further optimise the texture caching routine to prevent this from occurring, but I have some ideas on how to do this. I hope to have a dev build ready sometime next week, so do stay tuned.

Cheerio, Aaron.

Update: I've fixed the texture caching problem, and uploaded an updated version of Sapphire and L3DT that includes megatexture rendering support. It's on the pro downloads page under 'developmental builds' as L3DT, dated the 24th of June. Note also that there are some tips and rules for rendering megatextures in Sapphire, which are explained over here. — aaron 2007/06/24 02:22

1) A very old nVidia FX5700.
l3dt/2007/jun/21.txt · Last modified: 2017/08/31 05:55 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Share Alike 3.0 Unported
L3DT Development Blog RSS Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki