====== Megatexturing ====== Hi All, Since [[l3dt:ann:v2.1|release 2.1]] back in 2003, L3DT has been able to generate so-called '[[wp>Megatextures|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 1024x1024 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) ^ | [[http://www.bundysoft.com/news/lib/exe/fetch.php?cache=cache&media=l3dt:2007:jun:mega4.jpg|{{:l3dt:2007:jun:mega4.jpg?600}}]] | ^ Now, a bit lower down at the same corner (~5fps) ^ | [[http://www.bundysoft.com/news/lib/exe/fetch.php?cache=cache&media=l3dt:2007:jun:mega1.jpg|{{:l3dt:2007:jun:mega1.jpg?600}}]] | ^ Standing on the rock in the middle of the image above, looking to the left (~5fps) ^ | [[http://www.bundysoft.com/news/lib/exe/fetch.php?cache=cache&media=l3dt:2007:jun:mega8.jpg|{{:l3dt:2007:jun:mega8.jpg?600}}]] | ^ Moved to the left, looking to the right (~20fps) ^ | [[http://www.bundysoft.com/news/lib/exe/fetch.php?cache=cache&media=l3dt:2007:jun:mega7.jpg|{{:l3dt:2007:jun:mega7.jpg?600}}]] | ^ Back at the corner, but with camera zoomed in 8x (<1fps) ^ | [[http://www.bundysoft.com/news/lib/exe/fetch.php?cache=cache&media=l3dt:2007:jun:mega2.jpg|{{:l3dt:2007:jun:mega2.jpg?600}}]] | ^ Zooming in further (still sharp, but <<1fps ) ^ | [[http://www.bundysoft.com/news/lib/exe/fetch.php?cache=cache&media=l3dt:2007:jun:mega3.jpg|{{:l3dt:2007:jun:mega3.jpg?600}}]] | ^ A random shot from the opposite corner of the map (~20fps) ^ | [[http://www.bundysoft.com/news/lib/exe/fetch.php?cache=cache&media=l3dt:2007:jun:mega6.jpg|{{:l3dt:2007:jun:mega6.jpg?600}}]] |
If you're still not sure just how detailed a megatexture can be, consider [[http://www.bundysoft.com/news/lib/exe/fetch.php?cache=cache&media=l3dt:2007:jun:temp17_tx2_x1y1.jpg|this 2048x2048 pixel texture tile]], which covers a single 64x64 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 128MB((A very old nVidia FX5700.)) 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. {{tag>megatextures}} ---- **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 2.5.1.10, dated the 24th of June. Note also that there are some tips and rules for rendering megatextures in Sapphire, which are explained [[bundywiki>plugins:sapphire:userguide:megatextures|over here]]. --- //[[user>aaron]] 2007/06/24 02:22//