MS4 and L3DT blended troubles
by Erik Madison · in Torque Game Engine Advanced · 09/11/2006 (12:11 pm) · 41 replies
Just prior to MS4s release, I had an Atlas2 version of stronghold up and running. I had done this via unique terrain. After MS4, it no longer worked (even with the new lightmap settings in the .mis). Now I realize how much better a blended terrain looks, so I'm trying to recreate it that way. So far, neither method seems to work anymore. I hex looked over arcticBlended.atlas, and saw the l3dt texture directorie listed. I created a new, better placed texture dir, made a new climate with those textures, and ran the below commands. Hex checking the final output, I don't even see my textures listed, and needless to say it won't load.
From the now ancient TDN article, I find some oddities.
First off, generate from tiles requires a 4th arg, which I'm assuming is 1/0 png/jpg. That at least output decent looking console messages.
This confuses me though:
So... my question is thus: WTF am I doing wrong? :) Perhaps the climate file and exact scripts used to make arcticBlended.atlas would shed some light on this, as that Atlas2 obviously loads and looks fine.
// L3DT version
atlasOldGenerateChunkFileFromRaw16("client/data/terrains/l3dt/stronghold.RAW", 512, 4, 1.0/256.0, "client/data/terrains/geometry.chu", 2.0, 3);
importOldAtlasCHU("client/data/terrains/geometry.chu", "client/data/terrains/geometry.atlas");
atlasGenerateTextureTOCFromTiles(4, "client/data/terrains/l3dt/stronghold_opacity_Alpha1/Alpha1_x%dy%d.png", "client/data/terrains/opacity.atlas", 1);
atlasGenerateTextureTOCFromTiles(4, "client/data/terrains/l3dt/LM/stronghold_LM_x%dy%d.jpg", "client/data/terrains/lightmap_png.atlas", 0);
atlasConvertTextureTOC("client/data/terrains/lightmap_png.atlas", "client/data/terrains/lightmap.atlas", 0);
atlasGenerateBlenderTerrain("client/data/terrains/stronghold.atlas", "client/data/terrains/geometry.atlas", "client/data/terrains/opacity.atlas", "client/data/terrains/lightmap.atlas");From the now ancient TDN article, I find some oddities.
First off, generate from tiles requires a 4th arg, which I'm assuming is 1/0 png/jpg. That at least output decent looking console messages.
This confuses me though:
Quote:The texturemap process outputs a unique texture, tiled or not. Whats in the LM dir is the actual lightmap. The opacity map with alphas et al is done via generate alphas. The example script (which my above script very closely follows) seems to do it the logical way, while the warning quote seems to completely contradict this.
Note: The lightmap is the group of mosiac textures generated in the "Texture Map" process and the opacity map is the image generated in the "Light Map" process. Be careful to not get these confused.
So... my question is thus: WTF am I doing wrong? :) Perhaps the climate file and exact scripts used to make arcticBlended.atlas would shed some light on this, as that Atlas2 obviously loads and looks fine.
About the author
#2
Follow this and you will have a completely working blended terrain in Atlas2. Unique terrain textures might be cooler, but you're going to have to use such a huge jpg that its really not worth the effort. Blended terrains can _quickly_ be made, look incredible in detail, and load faster than my poor progress meter can register.
First you need a good heightmap. If you're trying to create a huge random world, L3DT is fine. For anything else though, it lacks horribly in the creation of good ones. I prefer Freeworld3D, as the sculpting tools are probably the best around.
I like to save the maps as bmp. It transfers nicely between any heightmap maker, any paint program you use, and L3DT for the final texturing. Once you have a map you are happy with, save it TWICE. One version for the final process, and one version that is [bold]flipped[/bold]. Forget everything you've read about rotating your image. North won't be at the top of the map like it should, it will be the left side. Top is east. (Based on Torques calculations. This is true for sunlight values, compass resources, etc). So, rotating the map would solve that, but it will make every other step a nightmare.
Create a custom climate (or clone/adjust a current one). The textures in your climate file should be from your proper data/terrain directory, or whereever you are keeping your terrain textures. You can have 18-20 actual textures, but sticking with the original 6-12 of legacy terrain will save your sanity.
Open L3DT, choose file->import heightmap. Pick your [bold]flipped[/bold] version. Click the DesignMap paint tool, check off climate, scroll to your new one, and 'apply to all'. This ensures your entire map will be done with your climate only. Do not generate a new heightmap at this point, you'll mess up your handcrafted one. Generate your lightmaps. Standard users will have to stick with low res. Pro users, check off hi res, set it for say 4, and check off use paging. I like 512x512 squares for detail, so readjust the numbers till it reads that. Generate your attributes map, check it for accuracy. If its wrong, your climate file needs adjusting, and you'll have to start all over at that point. If its okay, continue, and now generate your alpha maps. Keep it the same settings you used for your lightmap, results are much better that way. At one stage, its going to list the textures its using (it may not be all you loaded), along with an ID num. Write this down!!! It's going to change for just about every map you make, and it effects your final texture creation step. Save all, name the project whatever.
Go back to file->import, and now import your [bold]non-flipped original[/bold] heightmap. Choose file->export, and pick raw as the format. I believe there are internal settings in L2DT that would avoid this step, but I haven't tested it. This method works.
Run all of the commands I posted above, adjusting the paths to match yours. In the final texturing stage command (2nd post), you need to include all the textures, in the EXACT order that your alphamap output told you.
Bingo, guaranteed working, highly detailed, atlas2 terrain. The funky steps were all tested with textual hieghtmaps to be sure the flipflopping was right. This won't be a resource, nor a TDN wiki, as I'm sure this will all be wrong next codedrop :) Enjoy while you can!
09/13/2006 (5:43 pm)
Alright, this is working well.Follow this and you will have a completely working blended terrain in Atlas2. Unique terrain textures might be cooler, but you're going to have to use such a huge jpg that its really not worth the effort. Blended terrains can _quickly_ be made, look incredible in detail, and load faster than my poor progress meter can register.
First you need a good heightmap. If you're trying to create a huge random world, L3DT is fine. For anything else though, it lacks horribly in the creation of good ones. I prefer Freeworld3D, as the sculpting tools are probably the best around.
I like to save the maps as bmp. It transfers nicely between any heightmap maker, any paint program you use, and L3DT for the final texturing. Once you have a map you are happy with, save it TWICE. One version for the final process, and one version that is [bold]flipped[/bold]. Forget everything you've read about rotating your image. North won't be at the top of the map like it should, it will be the left side. Top is east. (Based on Torques calculations. This is true for sunlight values, compass resources, etc). So, rotating the map would solve that, but it will make every other step a nightmare.
Create a custom climate (or clone/adjust a current one). The textures in your climate file should be from your proper data/terrain directory, or whereever you are keeping your terrain textures. You can have 18-20 actual textures, but sticking with the original 6-12 of legacy terrain will save your sanity.
Open L3DT, choose file->import heightmap. Pick your [bold]flipped[/bold] version. Click the DesignMap paint tool, check off climate, scroll to your new one, and 'apply to all'. This ensures your entire map will be done with your climate only. Do not generate a new heightmap at this point, you'll mess up your handcrafted one. Generate your lightmaps. Standard users will have to stick with low res. Pro users, check off hi res, set it for say 4, and check off use paging. I like 512x512 squares for detail, so readjust the numbers till it reads that. Generate your attributes map, check it for accuracy. If its wrong, your climate file needs adjusting, and you'll have to start all over at that point. If its okay, continue, and now generate your alpha maps. Keep it the same settings you used for your lightmap, results are much better that way. At one stage, its going to list the textures its using (it may not be all you loaded), along with an ID num. Write this down!!! It's going to change for just about every map you make, and it effects your final texture creation step. Save all, name the project whatever.
Go back to file->import, and now import your [bold]non-flipped original[/bold] heightmap. Choose file->export, and pick raw as the format. I believe there are internal settings in L2DT that would avoid this step, but I haven't tested it. This method works.
Run all of the commands I posted above, adjusting the paths to match yours. In the final texturing stage command (2nd post), you need to include all the textures, in the EXACT order that your alphamap output told you.
Bingo, guaranteed working, highly detailed, atlas2 terrain. The funky steps were all tested with textual hieghtmaps to be sure the flipflopping was right. This won't be a resource, nor a TDN wiki, as I'm sure this will all be wrong next codedrop :) Enjoy while you can!
#3
Thanks for taknig the time to write this up--and hopefully it will be a good basis for a full on tutorial once Ben can finalize :)
09/13/2006 (5:51 pm)
Gimmmie screenshots!!!!Thanks for taknig the time to write this up--and hopefully it will be a good basis for a full on tutorial once Ben can finalize :)
#4
I don't quite understand this. I follow it up to the point where you import the non-flipped map. But then you say to run all the commands again on the non-flipped map. So why did we run all the commands on the flipped map? And which files do we use for Atlas, the flipped or non-flipped versions?
Also, what does "2nd post" mean?
Thanks a lot,
Dave.
09/14/2006 (8:01 am)
Hi Erik,I don't quite understand this. I follow it up to the point where you import the non-flipped map. But then you say to run all the commands again on the non-flipped map. So why did we run all the commands on the flipped map? And which files do we use for Atlas, the flipped or non-flipped versions?
Also, what does "2nd post" mean?
Thanks a lot,
Dave.
#5
2nd post referred to the proper form for the final console line. Replace the line I used in the top posting with the one I did in the second posting.
A final note: Your console window probably can't accept the final line if you have a lot of textures, its limited by an engine variable (IIRC MAX_CONSOLE_LINE). You can either change this in code, or even better, use Torsion and enter all your commands on its console line. It has no limitations, and just plain rocks.
Screenshots will be coming soon, one of my partners is making a pretty collage.
Edit: Okay, I see your confusion. 'Run all the commands I posted above' does not refer to the L3DT commands, but rather the TSE console window commands from the first post.
09/14/2006 (9:43 am)
All actions are done on the flipped map, except for the outputting of the .raw file. This will ensure your textures and your final ingame map match exactly, with the same orientation you saw when you first created your HM.2nd post referred to the proper form for the final console line. Replace the line I used in the top posting with the one I did in the second posting.
A final note: Your console window probably can't accept the final line if you have a lot of textures, its limited by an engine variable (IIRC MAX_CONSOLE_LINE). You can either change this in code, or even better, use Torsion and enter all your commands on its console line. It has no limitations, and just plain rocks.
Screenshots will be coming soon, one of my partners is making a pretty collage.
Edit: Okay, I see your confusion. 'Run all the commands I posted above' does not refer to the L3DT commands, but rather the TSE console window commands from the first post.
#6
All the best,
Dave.
09/14/2006 (11:06 am)
Ok great, thanks for clearing that up for me Eric. I'll have a go at it in the morning.All the best,
Dave.
#7
I have some updated docs that will be going up very soon. If anyone's interested in getting them sooner, I'd be happy to mail them over in exchange for that person spending a little time getting them into TDN. (I wrote them up using Writely - great piece of software.)
09/14/2006 (11:37 am)
No rotation of the data for proper import should be required. If you find that the terrain, once in, is misaligned, you can rotate it in the mission editor w/ no ill effects.I have some updated docs that will be going up very soon. If anyone's interested in getting them sooner, I'd be happy to mail them over in exchange for that person spending a little time getting them into TDN. (I wrote them up using Writely - great piece of software.)
#8
Flipping I do is only to align the texture with the geo. Rotating the terrain in the editor will 'fix' the north/south orientation to true cartography standards, but it will also take the texture with it.
I have found a new problem though, perhaps answered in your docs, perhaps not. GenerateUnique allows a good number of textures, BUT I just realized the alpha channeled opacity map only has 4 layers, and thus only 4 textures! I was sitting here wondering why L3DT was outputting 2 seperate AM directories, and then it hit me I am using 8 textures. Is it possible to add another blend step, that merges 2 opacity.atlas files?
09/14/2006 (1:43 pm)
Ben, I volunteer! Current email is in my profile.Flipping I do is only to align the texture with the geo. Rotating the terrain in the editor will 'fix' the north/south orientation to true cartography standards, but it will also take the texture with it.
I have found a new problem though, perhaps answered in your docs, perhaps not. GenerateUnique allows a good number of textures, BUT I just realized the alpha channeled opacity map only has 4 layers, and thus only 4 textures! I was sitting here wondering why L3DT was outputting 2 seperate AM directories, and then it hit me I am using 8 textures. Is it possible to add another blend step, that merges 2 opacity.atlas files?
#9
Thanks - sent 'em over.
Currently it only does 4 layers at a time. You'd have to extent AtlasTexChunk to include two or more textures, and make the blended image cache for the clipmaps do multiple blending passes. It's not too hard based on what's there, but it was a feature that ended up getting deferred in order to get more solid code into people's hands.
09/14/2006 (6:17 pm)
Hey Erik,Thanks - sent 'em over.
Currently it only does 4 layers at a time. You'd have to extent AtlasTexChunk to include two or more textures, and make the blended image cache for the clipmaps do multiple blending passes. It's not too hard based on what's there, but it was a feature that ended up getting deferred in order to get more solid code into people's hands.
#10
img141.imageshack.us/img141/6613/base00005265le3.png
That should be Lush Grass and Rock on the steeper hills..
I was able to compile with no errors. But the textures are all mis-alligned and black.
***Edit it looks like somehow im not exporting my opacity map correctly or its not importing correctly***
Here are my L3dt Settings
img223.imageshack.us/img223/89/alphasettingstu9.png
And these are my Blended Atlas Generation Settings
here is my console log (next post)
09/17/2006 (7:06 pm)
Any Idea what causes this?img141.imageshack.us/img141/6613/base00005265le3.png
That should be Lush Grass and Rock on the steeper hills..
I was able to compile with no errors. But the textures are all mis-alligned and black.
***Edit it looks like somehow im not exporting my opacity map correctly or its not importing correctly***
Here are my L3dt Settings
img223.imageshack.us/img223/89/alphasettingstu9.png
And these are my Blended Atlas Generation Settings
// Bring up a dos window to display current status. This lets you see immediately how the import/generation process is going.
enableWinConsole(true);
// Enable logging so we get a console.log. This is useful if something goes wrong - we can check the log for errors.
setLogMode(6);
error("======================Initializing Blended Atlas Terrain Creation===============");
error("========================Converting Raw HeightMap to .chu format=================");
// Generate geometry from a raw 16 bit heightfield.
atlasOldGenerateChunkFileFromRaw16("base/data/terrains/AnarTempera_HeightMap.raw", 4096, 2.0, 3.5/255, "base/Data/Terrains/AnarTempera_HeightMap.chu", 1.6, 4);
error("========================Raw HeightMap to .chu format complete=================");
// Import from old CHU format to .atlas.
error("==========================Begin Conversion from chu to .atlas===================");
ImportOldAtlasCHU("base/Data/Terrains/AnarTempera_HeightMap.chu","base/Data/Terrains/AnarTempera_HeightMap.atlas");
error("========================= .CHU Conversion to .atlas complete ===================");
// Import a tiled opacity map we generated with L3DT. Note we save it in PNG format to prevent artifacts in the blend results.
error("=========================Begin Opacity Map Conversion to .atlas==================");
atlasGenerateTextureTOCFromTiles(8, "base/Data/Terrains/Alpha1_x%dy%d.png", "base/data/terrains/AnarTempera_OpacityMap.atlas", 1);
error("=========================Opacity Map Conversion to .atlas complete==================");
// Import a tiled lightmap we generated, as well. We store these in JPEG as a little error is not going to be noticeable.
error("=========================Begin Lightmap Map Conversion to .atlas==================");
atlasGenerateTextureTOCFromTiles(8, "base/Data/Terrains/AnarTempera_LightMap_x%dy%d.jpg", "base/data/terrains/AnarTempera_LightMap.atlas", 1);
error("========================Lightmap Map Conversion to .atlas complete=================");
error("=========================Begin Blended Terrain Generation==================");
// 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(
"base/Data/Terrains/AnarTempera.atlas",
"base/Data/Terrains/AnarTempera_HeightMap.atlas",
"base/Data/Terrains/AnarTempera_OpacityMap.atlas",
"base/Data/Terrains/AnarTempera_LightMap.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/rock1b",
"terrain_water_demo/l3dt/grass1-lush");
error("=========================Blended Terrain Generation Complete==================");
echo("done");here is my console log (next post)
#11
09/17/2006 (9:02 pm)
Relevant log parts...=========================Begin Opacity Map Conversion to .atlas==================
atlasGenerateTextureTOCFromTiles - Initializing atlas file 'base/data/terrains/AnarTempera_OpacityMap.atlas'...
AtlasDeferredFile::ensureStreamWritable - switching file into writable mode... This may cause a crash if you have other copies of Torque accessing it!
atlasGenerateTextureTOCFromTiles - Atlas started, processing tiles for 4 deep tree...
atlasGenerateTextureTOCFromTiles - Storing tiles in PNG format...
atlasGenerateTextureTOCFromTiles - processing row 0...
atlasGenerateTextureTOCFromTiles - processing row 1...
atlasGenerateTextureTOCFromTiles - processing row 2...
atlasGenerateTextureTOCFromTiles - processing row 3...
atlasGenerateTextureTOCFromTiles - processing row 4...
atlasGenerateTextureTOCFromTiles - processing row 5...
atlasGenerateTextureTOCFromTiles - processing row 6...
atlasGenerateTextureTOCFromTiles - processing row 7...
generating (2 @ 0, 0) from (3 @ 0, 0), (3 @ 0, 1), (3 @ 1, 0), (3 @ 1, 1)
generating (2 @ 0, 1) from (3 @ 0, 2), (3 @ 0, 3), (3 @ 1, 2), (3 @ 1, 3)
generating (2 @ 0, 2) from (3 @ 0, 4), (3 @ 0, 5), (3 @ 1, 4), (3 @ 1, 5)
generating (2 @ 0, 3) from (3 @ 0, 6), (3 @ 0, 7), (3 @ 1, 6), (3 @ 1, 7)
generating (2 @ 1, 0) from (3 @ 2, 0), (3 @ 2, 1), (3 @ 3, 0), (3 @ 3, 1)
generating (2 @ 1, 1) from (3 @ 2, 2), (3 @ 2, 3), (3 @ 3, 2), (3 @ 3, 3)
generating (2 @ 1, 2) from (3 @ 2, 4), (3 @ 2, 5), (3 @ 3, 4), (3 @ 3, 5)
generating (2 @ 1, 3) from (3 @ 2, 6), (3 @ 2, 7), (3 @ 3, 6), (3 @ 3, 7)
generating (2 @ 2, 0) from (3 @ 4, 0), (3 @ 4, 1), (3 @ 5, 0), (3 @ 5, 1)
generating (2 @ 2, 1) from (3 @ 4, 2), (3 @ 4, 3), (3 @ 5, 2), (3 @ 5, 3)
generating (2 @ 2, 2) from (3 @ 4, 4), (3 @ 4, 5), (3 @ 5, 4), (3 @ 5, 5)
generating (2 @ 2, 3) from (3 @ 4, 6), (3 @ 4, 7), (3 @ 5, 6), (3 @ 5, 7)
generating (2 @ 3, 0) from (3 @ 6, 0), (3 @ 6, 1), (3 @ 7, 0), (3 @ 7, 1)
generating (2 @ 3, 1) from (3 @ 6, 2), (3 @ 6, 3), (3 @ 7, 2), (3 @ 7, 3)
generating (2 @ 3, 2) from (3 @ 6, 4), (3 @ 6, 5), (3 @ 7, 4), (3 @ 7, 5)
generating (2 @ 3, 3) from (3 @ 6, 6), (3 @ 6, 7), (3 @ 7, 6), (3 @ 7, 7)
generating (1 @ 0, 0) from (2 @ 0, 0), (2 @ 0, 1), (2 @ 1, 0), (2 @ 1, 1)
generating (1 @ 0, 1) from (2 @ 0, 2), (2 @ 0, 3), (2 @ 1, 2), (2 @ 1, 3)
generating (1 @ 1, 0) from (2 @ 2, 0), (2 @ 2, 1), (2 @ 3, 0), (2 @ 3, 1)
generating (1 @ 1, 1) from (2 @ 2, 2), (2 @ 2, 3), (2 @ 3, 2), (2 @ 3, 3)
generating (0 @ 0, 0) from (1 @ 0, 0), (1 @ 0, 1), (1 @ 1, 0), (1 @ 1, 1)
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile::waitForPendingWrites - Done!
atlasGenerateTextureTOCFromTiles - Done.
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile::waitForPendingWrites - Done!
=========================Opacity Map Conversion to .atlas complete==================
=========================Begin Lightmap Map Conversion to .atlas==================
atlasGenerateTextureTOCFromTiles - Initializing atlas file 'base/data/terrains/AnarTempera_LightMap.atlas'...
AtlasDeferredFile::ensureStreamWritable - switching file into writable mode... This may cause a crash if you have other copies of Torque accessing it!
atlasGenerateTextureTOCFromTiles - Atlas started, processing tiles for 4 deep tree...
atlasGenerateTextureTOCFromTiles - Storing tiles in PNG format...
atlasGenerateTextureTOCFromTiles - processing row 0...
atlasGenerateTextureTOCFromTiles - processing row 1...
atlasGenerateTextureTOCFromTiles - processing row 2...
atlasGenerateTextureTOCFromTiles - processing row 3...
atlasGenerateTextureTOCFromTiles - processing row 4...
atlasGenerateTextureTOCFromTiles - processing row 5...
atlasGenerateTextureTOCFromTiles - processing row 6...
atlasGenerateTextureTOCFromTiles - processing row 7...
generating (2 @ 0, 0) from (3 @ 0, 0), (3 @ 0, 1), (3 @ 1, 0), (3 @ 1, 1)
generating (2 @ 0, 1) from (3 @ 0, 2), (3 @ 0, 3), (3 @ 1, 2), (3 @ 1, 3)
generating (2 @ 0, 2) from (3 @ 0, 4), (3 @ 0, 5), (3 @ 1, 4), (3 @ 1, 5)
generating (2 @ 0, 3) from (3 @ 0, 6), (3 @ 0, 7), (3 @ 1, 6), (3 @ 1, 7)
generating (2 @ 1, 0) from (3 @ 2, 0), (3 @ 2, 1), (3 @ 3, 0), (3 @ 3, 1)
generating (2 @ 1, 1) from (3 @ 2, 2), (3 @ 2, 3), (3 @ 3, 2), (3 @ 3, 3)
generating (2 @ 1, 2) from (3 @ 2, 4), (3 @ 2, 5), (3 @ 3, 4), (3 @ 3, 5)
generating (2 @ 1, 3) from (3 @ 2, 6), (3 @ 2, 7), (3 @ 3, 6), (3 @ 3, 7)
generating (2 @ 2, 0) from (3 @ 4, 0), (3 @ 4, 1), (3 @ 5, 0), (3 @ 5, 1)
generating (2 @ 2, 1) from (3 @ 4, 2), (3 @ 4, 3), (3 @ 5, 2), (3 @ 5, 3)
generating (2 @ 2, 2) from (3 @ 4, 4), (3 @ 4, 5), (3 @ 5, 4), (3 @ 5, 5)
generating (2 @ 2, 3) from (3 @ 4, 6), (3 @ 4, 7), (3 @ 5, 6), (3 @ 5, 7)
generating (2 @ 3, 0) from (3 @ 6, 0), (3 @ 6, 1), (3 @ 7, 0), (3 @ 7, 1)
generating (2 @ 3, 1) from (3 @ 6, 2), (3 @ 6, 3), (3 @ 7, 2), (3 @ 7, 3)
generating (2 @ 3, 2) from (3 @ 6, 4), (3 @ 6, 5), (3 @ 7, 4), (3 @ 7, 5)
generating (2 @ 3, 3) from (3 @ 6, 6), (3 @ 6, 7), (3 @ 7, 6), (3 @ 7, 7)
generating (1 @ 0, 0) from (2 @ 0, 0), (2 @ 0, 1), (2 @ 1, 0), (2 @ 1, 1)
generating (1 @ 0, 1) from (2 @ 0, 2), (2 @ 0, 3), (2 @ 1, 2), (2 @ 1, 3)
generating (1 @ 1, 0) from (2 @ 2, 0), (2 @ 2, 1), (2 @ 3, 0), (2 @ 3, 1)
generating (1 @ 1, 1) from (2 @ 2, 2), (2 @ 2, 3), (2 @ 3, 2), (2 @ 3, 3)
generating (0 @ 0, 0) from (1 @ 0, 0), (1 @ 0, 1), (1 @ 1, 0), (1 @ 1, 1)
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile::waitForPendingWrites - Done!
atlasGenerateTextureTOCFromTiles - Done.
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile::waitForPendingWrites - Done!
========================Lightmap Map Conversion to .atlas complete=================
=========================Begin Blended Terrain Generation==================
atlasGenerateBlenderTerrain - Getting ready to produce blender terrain...
o Opening 'base/Data/Terrains/AnarTempera_HeightMap.atlas' for geometry...
AtlasFile::load - loading Atlas resource 2f123fc with base/Data/Terrains/AnarTempera_HeightMap.atlas
o Opening 'base/Data/Terrains/AnarTempera_OpacityMap.atlas' for opacity data...
AtlasFile::load - loading Atlas resource 3f5cab4 with base/Data/Terrains/AnarTempera_OpacityMap.atlas
o Opening 'base/Data/Terrains/AnarTempera_LightMap.atlas' for lightmap data...
AtlasFile::load - loading Atlas resource 2fb8c04 with base/Data/Terrains/AnarTempera_LightMap.atlas
o Copying TOCs...
o Generating config TOC...
o Outputting new .atlas file headers...
AtlasDeferredFile::ensureStreamWritable - switching file into writable mode... This may cause a crash if you have other copies of Torque accessing it!
o Starting loader threads...
o Copying geometry chunks...
AtlasDeferredFile::ensureStreamWritable - switching file into writable mode... This may cause a crash if you have other copies of Torque accessing it!
- Copied 85 chunks via copyChunksToTOC, stream len approx. 32351054 bytes
o Copying opacity map chunks...
AtlasDeferredFile::ensureStreamWritable - switching file into writable mode... This may cause a crash if you have other copies of Torque accessing it!
- Copied 85 chunks via copyChunksToTOC, stream len approx. 3016720 bytes
o Copying lightmap chunks...
AtlasDeferredFile::ensureStreamWritable - switching file into writable mode... This may cause a crash if you have other copies of Torque accessing it!
- Copied 85 chunks via copyChunksToTOC, stream len approx. 32072332 bytes
o Generating config chunks...
- Virtual texture size is 32768
- Found 2 source images specified.
* Source #0 = 'terrain_water_demo/l3dt/rock1b'
* Source #1 = 'terrain_water_demo/l3dt/grass1-lush'
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile::waitForPendingWrites - Done!
o Done!
AtlasFile::waitForPendingWrites - Waiting for pending output to finish.
AtlasFile::waitForPendingWrites - Done!
=========================Blended Terrain Generation Complete==================
#12
It looks like it is not finding the grass texture properly - whether that's because the source texture is missing (check console), because the wrong channel is getting set with data (maybe it thinks grass should be a channel other than it is), or something else is a litttle hard to say off hand.
Probably the import is fun, and it's an issue with the runtime.
09/17/2006 (9:38 pm)
Did you try generating under debug mode? It takes longer but will catch any weird issues for you.It looks like it is not finding the grass texture properly - whether that's because the source texture is missing (check console), because the wrong channel is getting set with data (maybe it thinks grass should be a channel other than it is), or something else is a litttle hard to say off hand.
Probably the import is fun, and it's an issue with the runtime.
#13
09/17/2006 (10:30 pm)
The debug export looked the same as the regular one for the most part (no errors) The only odd thing I see is that L3dt's alpha index starts at 1 and counts to 2 but when generating the final atlas in game the engine starts its index at 0 and counts to 1 for the texture slots. I thought I remember reading somewhere that the indexes would match in both l3dt and the engine.
#14
09/17/2006 (10:39 pm)
That is probably the case. What if you specify four materials, three of them grass and the other sand?
#15
09/17/2006 (10:41 pm)
Can I feed it extra materials that are not in the blendmap to fill extra slots or will it get confused and fatal out?
#16
09/17/2006 (10:41 pm)
It should be OK with extra materials.
#17
img146.imageshack.us/my.php?image=base00005266nv4.png
Is there a way to add in fall backs to the engine so when a texture slot is not filled we (lazy artists) don't have to feed it a garbage texture when compiling?
09/17/2006 (10:42 pm)
That did it I see both textures now. They are rotated all funny, A la Unique terrains, but I can fix that by rotating the height map and regenerating all the texture maps in the morning.img146.imageshack.us/my.php?image=base00005266nv4.png
Is there a way to add in fall backs to the engine so when a texture slot is not filled we (lazy artists) don't have to feed it a garbage texture when compiling?
#18
ie, imagine that you have this mapping:
red = slot 3
green = slot 2
blue = slot 1
alpha = slot 0
Maybe L3DT matches that... maybe not. :) But if it gets it backwards then you have to put in some dummies so things match.
That said, fixing that issue is on my list now.
09/18/2006 (1:13 am)
It's not erroring because it got an empty slot, it's erroring because the slots aren't mapping to the opacity map properly.ie, imagine that you have this mapping:
red = slot 3
green = slot 2
blue = slot 1
alpha = slot 0
Maybe L3DT matches that... maybe not. :) But if it gets it backwards then you have to put in some dummies so things match.
That said, fixing that issue is on my list now.
#19
09/18/2006 (3:54 am)
Thanks for your help Ben.
#20
Appreciate any help you can give,
Thanks,
Dave.
09/18/2006 (12:06 pm)
Erik, I can't quite get this to work. There are a couple of issues but the main one at the moment is as follows. My map is not tiled, it's just a single map. The alpha map though is output to 4 files by L3DT, one for each texture. These are named testAM1, testAM2 etc. How do I generate the terrain using all 4 alpha maps using the "atlasGenerateTextureTOCFromTiles" command you show above? I see you have specififed 4 tiles, but my map isn't tiled, only the alpha maps are separate.Appreciate any help you can give,
Thanks,
Dave.
Torque Owner Erik Madison
atlasGenerateBlenderTerrain("client/data/terrains/stronghold.atlas", "client/data/terrains/geometry.atlas", "client/data/terrains/opacity.atlas", "client/data/terrains/lightmap.atlas", 32768, "client/data/terrains/l3dt/dirt1", "client/data/terrains/l3dt/grass1g", "client/data/terrains/l3dt/rock1");Code says we can include up to 15 textures (if I'm reading it right. Might be a couple less). The number is the virtual texture size. Guessing, I'd say this will give it the detail/quality of a unique texture of the same size? arcticeBlended is a pretty darn small Atlas2 instance, and it uses 32768, so I did as well for stronghold. I'm going to have to really guess on the textures. I used the full path, that may not be required. The order I will guess must match the tex_ID of your opacity map output in L3dt. eg, if it says grass1 is ID 0 with 41% coverage, then grass1 should _probably_ be the first one listed here. Dunno, but makes sense.I couldn't remember what my original outputs were, so I just tossed three random textures into the above statement, re-used my previously generated data files and placed it back in the mission. Bam! Completely wrong, but extremely detailed terrain is now appearing!
Hopefully, Vincent reads this, or already knows it, and is busy tossing it all into HTC nextgen. Things are starting to get pretty complex in terrain gen, pushing his product much much much higher up my priority list. :)
Edit: Oh yeah, the comment (above post) I believed was contradictory, I'm now positive is. Ignore it. Follow what I wrote only (adjusting to your flavor and own investigations of the code).