Atlas texture quality
by Adam Beer · in Torque Game Engine Advanced · 02/18/2009 (2:11 pm) · 10 replies
I am trying to create a detailed unique atlas terrain in TGEA 1.7.1. I have a 4096x4096 texture and when it is imported into TGEA 1.7.1 as a unique atlas file (using L3DT) it looks like I assigned a low res texture...the quality horrible for what should be a 4096x4096 texture. Is there anything I can do to make the quality of this massive texture look better?
About the author
Adam is the owner of Ignition Games, an indie game and software development company.
#2
in the deleteme folder that L3DT creates on export, there is a TX folder with lots'n'lots of your texture tiles, all rather small. open them all in photoshop, do a record action on one of them that consists of
1:resize the 512 size to 4096, using "bicubic smoother"
2:save, overwrite
3:close file
now play the new action on all the other tiles (this saves you from manually doing the "open file, resize, save and close", now its just hit the play action button, save a lot of time when you need to do the same actions on a bunch of tiles)
now rerun the L3DTio_Atlas2_export_script.cs script that was outputed (is that a real word?) to your game folder. you "should" now have a texture 8 times more detailed.
also, at that size for each tile, you can edit in your own area specific details rather nicely
edit:
forgot to mention, try to keep the new TX folder size under 200 meg. torque tends to crash if its over 200.
02/19/2009 (1:01 am)
Adam,in the deleteme folder that L3DT creates on export, there is a TX folder with lots'n'lots of your texture tiles, all rather small. open them all in photoshop, do a record action on one of them that consists of
1:resize the 512 size to 4096, using "bicubic smoother"
2:save, overwrite
3:close file
now play the new action on all the other tiles (this saves you from manually doing the "open file, resize, save and close", now its just hit the play action button, save a lot of time when you need to do the same actions on a bunch of tiles)
now rerun the L3DTio_Atlas2_export_script.cs script that was outputed (is that a real word?) to your game folder. you "should" now have a texture 8 times more detailed.
also, at that size for each tile, you can edit in your own area specific details rather nicely
edit:
forgot to mention, try to keep the new TX folder size under 200 meg. torque tends to crash if its over 200.
#3
02/19/2009 (1:54 pm)
Thanks deepscratch. It seems that I get a crash even though the texture only add up to 123mb, so I am not sure what my problem could be. I am going to try to size them down to 1024 and maybe that will help.
#4
you know, of course, that you can start torque, and in the console window, run each section of the export script seperately. this allows you to get a log on the action, and where its crashing.
post the log here, I'll see if I can help.
BTW: DL some freeware batch image resizer to resize them all. I use a prog called resizejpegs.exe, works ok.
I used this technique to rapidly export a 41km X 41km map from L3DT using a single 8192 texture, then upped the output files to 2048. the whole opperation took 30 minutes, as apposed to 2 days to get the same detail by getting L3DT to generate a hi res texture, and it gives you more freedom to detail the tiles by hand.
you can basicaly resize each tile (256 of them there are) to 8192, add fine features like paths, stones, whatever you like, then resize down to say 2048 each, up the dpi from 72 standard to like 300, and get super hi res stuff.
I do this regularly with textures for models I create, seemed like a natural extention.
02/19/2009 (2:09 pm)
2048 should go smoothly.you know, of course, that you can start torque, and in the console window, run each section of the export script seperately. this allows you to get a log on the action, and where its crashing.
post the log here, I'll see if I can help.
BTW: DL some freeware batch image resizer to resize them all. I use a prog called resizejpegs.exe, works ok.
I used this technique to rapidly export a 41km X 41km map from L3DT using a single 8192 texture, then upped the output files to 2048. the whole opperation took 30 minutes, as apposed to 2 days to get the same detail by getting L3DT to generate a hi res texture, and it gives you more freedom to detail the tiles by hand.
you can basicaly resize each tile (256 of them there are) to 8192, add fine features like paths, stones, whatever you like, then resize down to say 2048 each, up the dpi from 72 standard to like 300, and get super hi res stuff.
I do this regularly with textures for models I create, seemed like a natural extention.
#5
Depending on your geometry tree configuration vs. texture configuration, the clipmap may be dropping levels (it likely is). Use AtlasInstance2::renderDebugTextures to see a visualization of the clipmap. If there's a red spot under your camera, you're fine. If it isn't even blue, you're losing two levels or more (it's always starting from the highest resolution ones).
If this is a/the problem, you have two choices.
a) generate a better geometry tree (less triangles per chunk). This solution only works in some cases and quickly leads to a multitude of other issues with Atlas.
b) up the clipmap resolution (pref::Atlas::clipMapSize). This quickly eats into GFX memory and performance, though.
02/21/2009 (1:41 pm)
Depending on your geometry tree configuration vs. texture configuration, the clipmap may be dropping levels (it likely is). Use AtlasInstance2::renderDebugTextures to see a visualization of the clipmap. If there's a red spot under your camera, you're fine. If it isn't even blue, you're losing two levels or more (it's always starting from the highest resolution ones).
If this is a/the problem, you have two choices.
a) generate a better geometry tree (less triangles per chunk). This solution only works in some cases and quickly leads to a multitude of other issues with Atlas.
b) up the clipmap resolution (pref::Atlas::clipMapSize). This quickly eats into GFX memory and performance, though.
#6
Deepscratch, thanks for your suggestions, but they dont seem to work for me. Anyone got any ideas as to whats going on or how to fix it?
02/21/2009 (8:32 pm)
Ok I tried the atlas debug texture function and my terrain is red under the camera. Not sure what else so do. Deepscratch, thanks for your suggestions, but they dont seem to work for me. Anyone got any ideas as to whats going on or how to fix it?
#7
Following Jaimi's thought, how many texels per unit does your 4kx4k texture add up to (texture resolution / (heightmap resolution*square size*instance scale))? Except for really small terrains, a resolution of 4kx4k for a unique texture is quite low.
But then, if that's the problem, deepscratch's solution is a very workable way. Have you tried following his suggestions for tracing where and/or why it crashes?
02/21/2009 (9:41 pm)
Following Jaimi's thought, how many texels per unit does your 4kx4k texture add up to (texture resolution / (heightmap resolution*square size*instance scale))? Except for really small terrains, a resolution of 4kx4k for a unique texture is quite low.
But then, if that's the problem, deepscratch's solution is a very workable way. Have you tried following his suggestions for tracing where and/or why it crashes?
#8
02/22/2009 (7:44 pm)
It turns out changing the $pref::Atlas::clipMapSize made it look alot better. I think adding a detail texture might also help a bit. I will post my results soon.
#9
ignitiongamespm.com/uploads/Adam/mach-terrain.jpg
03/12/2009 (6:48 pm)
I have the clipMapSize at 4096, and it runs fine with this result:ignitiongamespm.com/uploads/Adam/mach-terrain.jpg
#10
//EDIT: Just noticed, you already stated above that your source texture is 4k. In that case, this doesn't really apply, of course.
03/13/2009 (2:27 am)
Be aware that pumping up the clipmap size has a drastic impact on video memory usage as the clipstack is multiple levels deep. Depending on your source texture size, at a clipmap size of 4kx4k you end up with four or five (or more) 4kx4k textures (at four levels and with uncompressed RGBA, that's 256MB).//EDIT: Just noticed, you already stated above that your source texture is 4k. In that case, this doesn't really apply, of course.
Associate Jaimi McEntire
King of Flapjacks