http://www.ogre3d.org/forums/viewtopic.php?f=4&t=61602
by Assaf Raman » Mon Nov 22, 2010 8:34 pm
Texture atlases are useful in cases you want to merge batches of static geometry that have different textures and you don't have texture arraysupport.
A texture atlas is basically one big texture that includes all textures of all the batches.
I has just committed a patch from Mattan Furst of a texture atlas extension to the RTSS.
I helped by adding geometry to demonstrate this new feature to the RTSS sample.
Mattan based his work on the well known NVIDIA texture atlas tools.
I created a sample texture atlas using the tool that looks like this:
The first problem we saw immediately was a texture bleed issue when using wrap addressing mode as you can see from this screen shot (on the left side are the original textures and the right side are the textures from the texture atlas):
The solution was lowering the textures quality by half in the texture atlas and have a frame of the texture wrapped, so when it bleeds – it bleeds into the appropriate texture, this modified image demonstrate the idea:
And here is a screen shot of the result with the modified texture atlas:
Here is the code for the modified texture atlas tool that support wrap
- AtlasCreationToolWithWrap.zip
- (687.45 KiB) Downloaded 299 times
and here is a modified exe:
- AtlasCreationToolWithWrap_exe.zip
- (43.19 KiB) Downloaded 248 times
Note - you only need the tool to create texture atlas textures - not to use them - a parser to the tool output is included in Mattan's patch.
I named the texture atlas with the original tool TextureAtlasSampleOrg.tai and the modified one TextureAtlasSampleWrap.tai.
Here they are (for non-ogre forum members that don't want to search for them in the OGRE code):
- TextureAtlasSampleOrg.zip
- (818 Bytes) Downloaded 181 times
- TextureAtlasSampleWrap.zip
- (847 Bytes) Downloaded 160 times
Here is the command I used to create the atlas:
- CODE:
"C:\Program Files\NVIDIA Corporation\Texture Atlas Tools\DEMOS\Direct3D9\bin\release\AtlasCreationTool.exe" -width 2048 -height 2048 -o TextureAtlasSample 1d_debug.png 1d_SPIRAL.png checker.png img1.png img2.png LowRes.png radial.png SmallLeaf_BP.png spotlight_image.png Dirt.jpg flare.png nm_bk.png rockwall.tga steelhead.png dirt01.jpg ogrelogo-small.jpg RustyBarrel.png NMBalls.png scr-up-p.png terr_dirt-grass.jpg tusk.jpg
And here are the textures I used (once more for ppl that don't want to download all of OGRE code just for this...):
- textures.zip
- (806.14 KiB) Downloaded 156 times
I committed the patch to the trunk.