Error while creating a terrain with a large texture
by Alexis Brown · in Torque Game Engine Advanced · 08/23/2006 (8:17 pm) · 7 replies
I thought I would see how big of a terrain I could load into TSE so I used l3dt to generate a 4096x4096 hf with a 16384x16384 texture map :)
It compiles the chu just fine and even generates about 457meg of the lightmap_png.atlas file but it errors out before it finishes.
here is the tail end of the console.log file.
Is this possible to do ?
It compiles the chu just fine and even generates about 457meg of the lightmap_png.atlas file but it errors out before it finishes.
atlasOldGenerateChunkFileFromRaw16("MyGame/l3dt/big.RAW", 4096, 1.0, 1.0/150, "MyGame/geometry.chu", 60.0, 6);
importOldAtlasCHU("MyGame/geometry.chu", "MyGame/geometry.atlas");
atlasGenerateTextureTOCFromTiles(16, "MyGame/l3dt/big_x%dy%d.jpg", "MyGame/lightmap_png.atlas");
//atlasGenerateTextureTOCFromLargeJPEG( "mygame/l3dt/big.jpg", 6, "MyGame/lightmap_png.atlas");
//atlasConvertTextureTOC("MyGame/lightmap_png.atlas", "MyGame/lightmap.atlas", 0);
atlasGenerateUniqueTerrain("MyGame/myterrainA.atlas", "MyGame/geometry.atlas", "MyGame/lightmap.atlas");
quit();here is the tail end of the console.log file.
630364 (total bytes in all pages=511708896) generating (4 @ 6, 0) from (5 @ 12, 0), (5 @ 12, 1), (5 @ 13, 1), (5 @ 13, 0) generating (4 @ 6, 1) from (5 @ 12, 2), (5 @ 12, 3), (5 @ 13, 3), (5 @ 13, 2) Fatal-ISV: (c:\projects\tse\tse\engine\gfx\bitmappng.cpp @ 86) Error reading PNG file: IDAT: CRC error
Is this possible to do ?
#2
Plus, the FromTiles command doesn't want an extension (it assumes .png), so that might also be one of your issues (but its odd that it looks like it runs for a bit before crashing on that).
08/24/2006 (8:38 am)
Hmm... just noticed your image tiles (a 16x16 grid of images that are 124px wide each) are in the jpg format. Maybe I'm wrong, but I have never used jpgs and was under the impression that they needed to be png files.Plus, the FromTiles command doesn't want an extension (it assumes .png), so that might also be one of your issues (but its odd that it looks like it runs for a bit before crashing on that).
#3
08/24/2006 (9:46 am)
The documentation states that you should start with an error metric equal to 1% of your terrain's height range. Then you should try lowering it slowly (keeping Tree Depth the same) until you get an "overflow" error then stop. The object is to get your verts/chunk as high as possible. That will provide the "smoothest" terrain.
#4
atlasGenerateTextureTOCFromTiles(16, "MyGame/l3dt/big_x%dy%d.png", "MyGame/lightmap_png.atlas");
I tried it with png files too and I get an unhandled exception in the mutex locking code for a Vector
I get errrors regardless of wether I have the hf code in there or not. maybe 32x32 512x512 images will work.
Edit: nope
08/26/2006 (4:12 pm)
The problem is in the call to atlasGenerateTextureTOCFromTiles(16, "MyGame/l3dt/big_x%dy%d.png", "MyGame/lightmap_png.atlas");
I tried it with png files too and I get an unhandled exception in the mutex locking code for a Vector
I get errrors regardless of wether I have the hf code in there or not. maybe 32x32 512x512 images will work.
Edit: nope
#5
08/27/2006 (8:42 am)
Did you try using png's but leaveing the .png off of it how Ryan mentioned?
#6
a little bit after it starts gobbling memory

shortly after it crashes with the unhandled exception I mentioned above.

Others have done what I'm doing so I assume it's just me but I can't see what I've done wrong.
I saw the same behaviour on another machine of mine that has 2gig of ram.
08/27/2006 (12:05 pm)
Yes and I got the same error. Here are a couple of screen captures to show how it gobbles up memory torwards the end of the process. I assume it's the end because the atlas file is approaching 500 meg. I'm not sure how big the final file should be.a little bit after it starts gobbling memory

shortly after it crashes with the unhandled exception I mentioned above.

Others have done what I'm doing so I assume it's just me but I can't see what I've done wrong.
atlasGenerateTextureTOCFromTiles(32, "MyGame/l3dt/large_x%dy%d", "MyGame/texture.atlas");
I saw the same behaviour on another machine of mine that has 2gig of ram.
#7
08/27/2006 (10:33 pm)
I cranked the page file up to 3gig and that let it finish processing the texture.
Torque Owner Ryan Dey (not Tom Watson)
I have very successfully compiled 4097px heightfields with 16384px textures (broken into 32x32=1024 tiles). I have the data all prepared and will be making atlas terrains with twice that as soon as I can find the time.
The error you are encountering "might" be a corrupt file, I don't know. Looking at the commands you are using, I see two minor problems, both with the chunk import command. I don't know what your terrain looks like, so I can't know for sure, but 60.0 for an error metric is light years higher than what you should need. For a 4097px raw file with moderately hilly landscape, 2-3 should be all you need. With my relatively flat land, I'm using numbers such as 0.1. When you run the chunk command (I do each one individually), you are looking to have roughly 1000-5000 verts/chunk, and limit the number of "Min/Max Exceeded" warnings you get.
The other issue that is cosmetic in nature (of the final product) is your quad-tree depths don't match, which isn't only a problem until Milestone 4 rolls out. With the images in a 16x16 tile, the quadtree for the elevation should be 5, not 6. I haven't figured out a way to explain it simply, but 2^4=16 (the number of image tiles across), so you add a 1 to 4 and get the an elevation tree depth of 5.
Here are an example of the commands I use to compile data similar to what you have:
atlasGenerateTextureTOCFromTiles(32, "./4kmOutTilesA/Aerial_B11E14_x%d_y%d", "./aerial_B11E14.atlas"); atlasOldGenerateChunkFileFromRaw16("./elev_B11E14_4097.raw", 4096, 1.0, 1.0 / 100.0,"./elev_B11E14_4097.chu", 0.1, 6 ); ImportOldAtlasCHU("./elev_B11E14_4097.chu","./elev_B11E14_4097.atlas"); atlasGenerateUniqueTerrain("./Data_NDTIP_B11E14.atlas","./elev_B11E14_4097.atlas","./aerial_B11E14.atlas");I really wish I had more time to play with TSE (its only a side task at my job). I have a lot of information written up that I think would be very useful to you and the audience in general, but just don't have the time to finish it off.
Best of luck.