L3DT to ATLAS for Dummies
by Roland Stralberg · in Torque Game Engine Advanced · 02/06/2006 (12:41 am) · 19 replies
Hi.
I have tried to make a simple terrain
with L3DT as input for ATLAS and cant
get it right without errors. Of course
I'm doing something wrong. I have tried
to follow the hints and small tutorials
that exist without any success.
I would apreciate to get any help
to make a "ATLAS for dummies" instruction
on how to make this simple terrain. It must
be possible to make this in some standard way,
or horrible though - isnt it?
Size: 2048x2048 meters
Height: -100 -> 400 = 500 meters
where waterlevel is at 0 meter
Texture: approx 4096x4096 size
Thanks in advance for any help
Roland
I have tried to make a simple terrain
with L3DT as input for ATLAS and cant
get it right without errors. Of course
I'm doing something wrong. I have tried
to follow the hints and small tutorials
that exist without any success.
I would apreciate to get any help
to make a "ATLAS for dummies" instruction
on how to make this simple terrain. It must
be possible to make this in some standard way,
or horrible though - isnt it?
Size: 2048x2048 meters
Height: -100 -> 400 = 500 meters
where waterlevel is at 0 meter
Texture: approx 4096x4096 size
Thanks in advance for any help
Roland
#2
From the atlas2 import wiki
// Import a tiled opacity map we generated with L3DT. Note we save it in PNG format to prevent artifacts in the blend results.
atlasGenerateTextureTOCFromTiles(4, "terrain_water_demo/l3dt/alpha_Alpha1/Alpha1_x%dy%d", "terrain_water_demo/arcticOpacityTex.atlas", 1);
I don't know what all the arguments are, the documentation doesn't cover this function. My biggest problem so far is how do you export a .png tiled opacity map? I can't seem to find anything about it in l3dt help, wiki, or forums.
The next part from the wiki
// Finally, combine into a unique-textured terrain. Notice how this command is grouped
// onto multiple lines, to make it easier to read and understand. The first four parameters
// (the .atlas files) are the output file we are generating, and the three input files we
// need (geometry data, opacity data, and lightmap data).
atlasGenerateBlenderTerrain(
"terrain_water_demo/arcticBlended.atlas",
"terrain_water_demo/arcticGeometry.atlas",
"terrain_water_demo/arcticOpacityTex.atlas",
"terrain_water_demo/arcticLightmap.atlas",
// This is the size of the virtual texturemap the blender will be producing. This directly affects how much the source images are tiled, so it is
// hardcoded into the terrain. This must be a power of 2 - if you get it wrong the engine will nicely let you know and suggest some alternatives
32768,
// These are the source textures that the blender will be using. List them in the REVERSE order that L3DT shows in the alpha map export
// wizard. If you specify too few, then your terrain may cause the engine to crash.
"terrain_water_demo/l3dt/rocks1d",
"terrain_water_demo/l3dt/rock1",
"terrain_water_demo/l3dt/snow"
);
Ok so where do I get this file arcticblended.atlas... it doesn't talk about making it anywhere that I have found, and I thought these were output files in the beginning, they look like input files. I'm a bit confused, anyone have a direction to point me in?
Thanks,
Matt
11/25/2006 (9:01 pm)
New question for l3dtFrom the atlas2 import wiki
// Import a tiled opacity map we generated with L3DT. Note we save it in PNG format to prevent artifacts in the blend results.
atlasGenerateTextureTOCFromTiles(4, "terrain_water_demo/l3dt/alpha_Alpha1/Alpha1_x%dy%d", "terrain_water_demo/arcticOpacityTex.atlas", 1);
I don't know what all the arguments are, the documentation doesn't cover this function. My biggest problem so far is how do you export a .png tiled opacity map? I can't seem to find anything about it in l3dt help, wiki, or forums.
The next part from the wiki
// Finally, combine into a unique-textured terrain. Notice how this command is grouped
// onto multiple lines, to make it easier to read and understand. The first four parameters
// (the .atlas files) are the output file we are generating, and the three input files we
// need (geometry data, opacity data, and lightmap data).
atlasGenerateBlenderTerrain(
"terrain_water_demo/arcticBlended.atlas",
"terrain_water_demo/arcticGeometry.atlas",
"terrain_water_demo/arcticOpacityTex.atlas",
"terrain_water_demo/arcticLightmap.atlas",
// This is the size of the virtual texturemap the blender will be producing. This directly affects how much the source images are tiled, so it is
// hardcoded into the terrain. This must be a power of 2 - if you get it wrong the engine will nicely let you know and suggest some alternatives
32768,
// These are the source textures that the blender will be using. List them in the REVERSE order that L3DT shows in the alpha map export
// wizard. If you specify too few, then your terrain may cause the engine to crash.
"terrain_water_demo/l3dt/rocks1d",
"terrain_water_demo/l3dt/rock1",
"terrain_water_demo/l3dt/snow"
);
Ok so where do I get this file arcticblended.atlas... it doesn't talk about making it anywhere that I have found, and I thought these were output files in the beginning, they look like input files. I'm a bit confused, anyone have a direction to point me in?
Thanks,
Matt
#3
First off, are you trying to make a blended or unique atlas terrain. Unique terrains are made using one height map and one giant texture map. Blended terrains are made using a Height map, light map, and opacity (alpha masked) map. They each have there own way of being generated into a terrain so plugging in things to the wrong template will stop you dead in your tracks
*If your using a blended terrain then are you chunking it up into smaller pieces or leaving it as one mammoth light map and opacity map? If Chunkified what is the size of each chunk?
Secondly, I need to know what the exact size of all the maps are. Remember that the Height map is ALWAYS one pixel larger than all the other maps and all the other maps need to be in dimensions of a power of two. This means that if your other maps are all 2048x2048 then your Height map should be 2049x2049, or when the other maps are 4096x4096 then the height map should be 4097x4097. However when you are plugging in the values into the above template you always use the nearest power of two so if your height map is 2049x2049 then in the first line of the template it should say 2048.
Read what I said in the above 3 paragraphs and answer the questions and I can see what can be done to help you.
11/26/2006 (9:19 am)
Hi there. Before I can help there are a few things I need to know. First off, are you trying to make a blended or unique atlas terrain. Unique terrains are made using one height map and one giant texture map. Blended terrains are made using a Height map, light map, and opacity (alpha masked) map. They each have there own way of being generated into a terrain so plugging in things to the wrong template will stop you dead in your tracks
*If your using a blended terrain then are you chunking it up into smaller pieces or leaving it as one mammoth light map and opacity map? If Chunkified what is the size of each chunk?
Secondly, I need to know what the exact size of all the maps are. Remember that the Height map is ALWAYS one pixel larger than all the other maps and all the other maps need to be in dimensions of a power of two. This means that if your other maps are all 2048x2048 then your Height map should be 2049x2049, or when the other maps are 4096x4096 then the height map should be 4097x4097. However when you are plugging in the values into the above template you always use the nearest power of two so if your height map is 2049x2049 then in the first line of the template it should say 2048.
Read what I said in the above 3 paragraphs and answer the questions and I can see what can be done to help you.
#4
The light map is chunked into 768kb pieces, and the alpha map is various small sizes not exceeding 60kb.
The size as far as I saw when making the l3dt map is 1024, saved as 1025.
I'm not quite sure where these,
"terrain_water_demo/l3dt/rocks1d",
"terrain_water_demo/l3dt/rock1",
"terrain_water_demo/l3dt/snow"
are located, I find files like that in the l3dt program files directory, but that doesn't seem right.
Thanks,
Matt
11/26/2006 (10:04 am)
I'm doing a blended terrain, and I think I got an answer from l3dt forums. The opacity map is an alpha map in l3dt. But when I export the alpha map, it gives me 2 directories, and this tutorial from the wiki only covers using one.The light map is chunked into 768kb pieces, and the alpha map is various small sizes not exceeding 60kb.
The size as far as I saw when making the l3dt map is 1024, saved as 1025.
I'm not quite sure where these,
"terrain_water_demo/l3dt/rocks1d",
"terrain_water_demo/l3dt/rock1",
"terrain_water_demo/l3dt/snow"
are located, I find files like that in the l3dt program files directory, but that doesn't seem right.
Thanks,
Matt
#5
atlasGenerateTextureTOCFromTiles - unable to open tile 'D:/Backup/MyMMO/L3DT Map
s/test2_Alpha1/test2_Alpha1_x0y3'! Aborting!
and this
atlasGenerateTextureTOCFromTiles - unable to open tile 'D:/Backup/MyMMO/L3DT Map
s/LM/test2_LM_x0y15'! Aborting!
The alpha files I have don't go up to x0y3, they only make it to x0y1
and the light map files I have only go up to x0y14, why doesn't this wrap around to x1y0? It doesn't continue with next row after aborting.
Matt
11/26/2006 (10:34 am)
When I put everything together, now I get this in the console.atlasGenerateTextureTOCFromTiles - unable to open tile 'D:/Backup/MyMMO/L3DT Map
s/test2_Alpha1/test2_Alpha1_x0y3'! Aborting!
and this
atlasGenerateTextureTOCFromTiles - unable to open tile 'D:/Backup/MyMMO/L3DT Map
s/LM/test2_LM_x0y15'! Aborting!
The alpha files I have don't go up to x0y3, they only make it to x0y1
and the light map files I have only go up to x0y14, why doesn't this wrap around to x1y0? It doesn't continue with next row after aborting.
Matt
#6
L3DT makes one Alpha map for every four textures in your terrain. You get one directory per map. Unfortunately Atlas can only handle one Alpha map at the moment, so if you have more than four textures you will get black areas in your terrain. You can assign more than one texture to an alpha channel in L3DT to work around this, at the point where it displays all the texture names in a table (which you need to write down anyway to put into your generate Atlas command eventually). Or you can make sure you only have four textures max in your L3DT terrain instead.
As for tile names, IIRC L3DT numbers them from 0 to N-1, whereas TSE expects them to start at 1. Or the other way around, I can't remember at the minute. Anyway, you need to renumber the tiles before trying to use the import from tile command.
This whole area is a big mess at the moment, but from what I can see they seem to be working with Aaron from L3DT to get straight imports into TSE.
Dave.
11/26/2006 (12:07 pm)
Hi matt,L3DT makes one Alpha map for every four textures in your terrain. You get one directory per map. Unfortunately Atlas can only handle one Alpha map at the moment, so if you have more than four textures you will get black areas in your terrain. You can assign more than one texture to an alpha channel in L3DT to work around this, at the point where it displays all the texture names in a table (which you need to write down anyway to put into your generate Atlas command eventually). Or you can make sure you only have four textures max in your L3DT terrain instead.
As for tile names, IIRC L3DT numbers them from 0 to N-1, whereas TSE expects them to start at 1. Or the other way around, I can't remember at the minute. Anyway, you need to renumber the tiles before trying to use the import from tile command.
This whole area is a big mess at the moment, but from what I can see they seem to be working with Aaron from L3DT to get straight imports into TSE.
Dave.
#7
11/26/2006 (1:10 pm)
Hey Roland, just some friendly advice in the future you'll probably get a faster response if you phrase your title better. I thought this post was a how to at first so i didn't look at it.
#9
Yes thanks for the advice. English is not my strong side (I'm Swedish)
I'll try to put it better next time.
Others:
I havent been working with TSE since the first post in this thread,
so I cant complain :)
But for all other users I hope there will be a more 'easy'
way to put a terrain with Atlas than the current 'trial and error' method
Anyway.. Thanks.
Roland
11/26/2006 (1:16 pm)
Pauliver:Yes thanks for the advice. English is not my strong side (I'm Swedish)
I'll try to put it better next time.
Others:
I havent been working with TSE since the first post in this thread,
so I cant complain :)
But for all other users I hope there will be a more 'easy'
way to put a terrain with Atlas than the current 'trial and error' method
Anyway.. Thanks.
Roland
#10
11/26/2006 (2:12 pm)
I heard Ben was actually working with the L3DT people to have a streamlined pipeline from it to Atlas2, but i can't remember where...
#11
Matt
11/26/2006 (7:54 pm)
No worries Roland, I took the thread and tried to put as much information as I could find into it, just I couldn't find everything, that's what I was asking for help with.Matt
#12
12/11/2006 (12:23 am)
There's a plugin coming some time soon. Aaron at L3DT says he has made a plugin API for L3DT and GG are writing an importer to that API. There is a contract date "looming" so we should be in good shape reasonably soon :-)
#13
Thanks for the quote. If I might clarify, development is presently ongoing by both parties. The plugin API for L3DT was conceived for this Atlas plugin, and consequently it's been a bit of a race to implement, export and test the many features required by Atlas and its uniquely powerful (and complex) format. We're probably 90% there, but I can't nominate a timeline at this stage, as in addition to that last 10% there will be a lot of testing for this beastie. The last thing we would want is to release an incomplete, hard to use or buggy product*.
Cheers,
Aaron.
* Well, I do that sometimes, but I'm sure GarageGames wouldn't want that!
12/11/2006 (6:57 am)
Hi Dave,Thanks for the quote. If I might clarify, development is presently ongoing by both parties. The plugin API for L3DT was conceived for this Atlas plugin, and consequently it's been a bit of a race to implement, export and test the many features required by Atlas and its uniquely powerful (and complex) format. We're probably 90% there, but I can't nominate a timeline at this stage, as in addition to that last 10% there will be a lot of testing for this beastie. The last thing we would want is to release an incomplete, hard to use or buggy product*.
Cheers,
Aaron.
* Well, I do that sometimes, but I'm sure GarageGames wouldn't want that!
#14
Dave.
12/12/2006 (3:31 am)
Ah, the famous last 10% that takes 90% of the time :-) Thanks for your honest feedback as usual Aaron. We always know where we stand with you!Dave.
#15
12/12/2006 (6:16 am)
Great news. Looking forward to it.
#16
"Well, I do that sometimes, but I'm sure GarageGames wouldn't want that!"
*snickers*
12/13/2006 (10:18 am)
"The last thing we would want is to release an incomplete, hard to use or buggy product""Well, I do that sometimes, but I'm sure GarageGames wouldn't want that!"
*snickers*
#17
12/29/2006 (3:02 am)
Yeah, it's great to get honest feedback from a developer :-) Of course if you see the amount of work this guy does on his product you'd forgive him just about anything. I've never been so happy to have handed over my cash to anyone.
#18
I'm working with Aaron on this, and it's going fairly well. Currently on a bit of a hiatus over the holidays (Aaron, check your inbox. :P), but I think we're on track to get something out very early in '07.
And yes, it's way easier to use than the script commands. No tricky options to set. :)
12/29/2006 (4:14 pm)
Hehe... Hi guys. :)I'm working with Aaron on this, and it's going fairly well. Currently on a bit of a hiatus over the holidays (Aaron, check your inbox. :P), but I think we're on track to get something out very early in '07.
And yes, it's way easier to use than the script commands. No tricky options to set. :)
#19
12/31/2006 (3:21 am)
I'm all ready to fall down on my knees and worship the two of you :-) Hmmm...Ben-Aaron, guess I'll have to convert and become Jewish!
Torque Owner Matthew Godsey
This is from the TSE documentation(I think it's old)
generateChunkFileFromRaw16(srcFile, size, squareSize, vertScale, destFile, error, treeDepth)
This is from the atlas2 import wiki(I think it's up to date)
Here I believe they are using the same number of arguments as the old one.
// Generate geometry from a raw 16 bit heightfield.
atlasOldGenerateChunkFileFromRaw16("terrain_water_demo/arctic/arctic.raw", 1024, 1.0, 1.0/256.0, "terrain_water_demo/arcticGeom.chu", 0.5, 4);
srcFile = sourcefile with path i.e. "terrain_water_demo/arctic/arctic.raw"
size = 1024 -1
(if you go through the tutorial on l3dt site (which is out of date) it says export the heightmap as a .raw file and add 1 to it. Here you would subtract the 1 again to get the true size.)
squareSize = 1.0
space between sample points in meters, I don't know where this setting is in l3dt, if anyone could tell me where this is set please
vertScale = 1.0/256.0
this is the vertical scale and the current numbers gives us a vertical range of 256m, the factors are commonly of the form 1.0 / 2.0^n. So to get a 1000 meter range you would do 2.0/512.0.
destFile = destination file with path i.e. "terrain_water_demo/arcticGeom.chu"
error = .5
amount of acceptable error in the LOD From the wiki, they say to bump that up to 50 or 100 and then bring it back down until you find an error level that you can live with.
treeDepth = 4
a number indicating how deep the quadtree depth will be.
So what I would like to figure out is this:
squareSize where do you find that in l3dt? Where do you set it in l3dt?
vertScale is it ok to use 2.0/512.0 for 1000m range?
error what's a good number here, where would you find out how much you should put, or is this just arbitrary and you put in a large number and keep reducing it and regenerating until it looks good?
treeDepth is this set in l3dt in the wizards I keep seeing that say put in something from 1 to 4?