[转]Texture atlas extension to the RTSS
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.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构