Game Development Community

Problem with atlas2 (blur/lack of details)

by David \"lp\" Rosen · in Torque Game Engine Advanced · 12/04/2006 (8:28 am) · 6 replies

We are having trouble getting our terrains to look good with atlas2. When vieved from above at a short distance it looks great except for being slightly blurry at the outer edges of the window (www.dreamlords.com/downloads/gg/atlas2_1.jpg) but changing the camera angle causes it to lose all details and become blurry (www.dreamlords.com/downloads/gg/atlas2_2.jpg and www.dreamlords.com/downloads/gg/atlas2_3.jpg). We get the same effect with both our internal codebase and the terrain_water_demo in stock MS4. Setting the FoV to 90 (we are using 45) seems to reduce the effect somewhat but does not solve the problem.

The terrain uses a 8192x8192 JPEG texture and was generated with the following calls:
atlasGenerateTextureTOCFromLargeJPEG("rtss/data/terrains/map1.jpg",5,"rtss/data/terrains/map1jpg.atlas");

atlasOldGenerateChunkFileFromRaw16("rtss/data/terrains/map1.raw", 512,1, 0.0024921875, "rtss/data/terrains/map1.chu",1.8,4);

importOldAtlasCHU("rtss/data/terrains/map1.chu","rtss/data/terrains/map1.atlas");

atlasGenerateUniqueTerrain("rtss/data/terrains/map1atlas.atlas", "rtss/data/terrains/map1.atlas", "rtss/data/terrains/map1jpg.atlas");


Any help or pointers would be greatly appreciated since this is our last great hurdle in moving to MS4.

#1
12/04/2006 (3:15 pm)
David,

Don't quote me on this, and this may be outdated information, but AFAIK if you process your texture with a treeDepth of 5 and your terrain grid with a treeDepth of 4, then when you get close to the terrain your mesh will be at it's highest LOD but there will be 1 more LOD of texture that you'll never see. I suggest processing your your grid at a treeDepth of 5 also.

You might also look at atlas\resource\atlasResourceGeomTOC.cpp about line 54
mDistance_LODMax = 50.f;
This is used to determine the distance from the terrain at which the LOD changes. Try increasing this to something like 500.0 and see if the terrain looks sharper at a longer distance.
#2
12/05/2006 (6:29 am)
Not real sure, but don't you get better detail if the terrain texture is broken into tiles? And then use atlasGenerateTextureTOCFromTiles() instead of atlasGenerateTextureTOCFromLargeJPEG(). Haven't used anything else for Atlas2 terrain, but in L3DT its easy to break it into tiles.
#3
12/06/2006 (1:18 am)
I'd go with Mary's stuff first. It looks like its doing a LOD switch on the terrain texture. I can understand it further out, but maybe it has something to do with the projection of the terrain chunk onto the screen (i.e. pixel coverage).

Try that variable Mary mentioned. But the treedepth definitely sounds valid too.
#4
12/07/2006 (6:56 am)
Thank you for your replies. While I haven't been able to solve this problem yet I've at least made some progress.

I did manage to remove the effect when changing camera angles by changing the focus point in AtlasInstance2::renderObject from the camera position to the position of the object our camera is focused on.

Not much luck with the LOD yet but it and the distance at which the switches occur do seem to be the other part of the problem as the texture detail is good at the focus point and then degrades quickly further out. So far I've been unable to increase the range at which these switches happen.
#5
12/07/2006 (8:09 pm)
Set $AtlasInstance2::renderDebugTextures to see the debug textures. You may want to go to line 42 of atlasClipMap and change it from:

debugBmp->setColor(i,j, edge ? edgeClr : debugClr);

to

debugBmp->setColor(i,j, debugClr);

Then you can go in-game and Atlas will color code each LOD level a different color, so you can more easily see what's going on with the texture detail selection code. It might be that due to changes in the geometry LOD it's unable to render the highest LOD at some points - geometry LOD is independent of texture LOD, but texture LOD is constrained by geometry LOD (ie, it can't always show all texture LODs, depending on what geometry is being selected to render).

BTW, your environments look great. Very impressive stuff. :)
#6
01/10/2007 (7:16 pm)
Out of curiosity how did you get your command map working so well without it forcing the entire atlas terrain into the lowest LOD? We are having a problem right now with the TSE version of the command map resource that when the command map is active all the terrain (geometry and texture) gets forced into the lowest LOD.