AtlasGenerateTextureTOCFromTiles problems
by Deception Games · in Torque Game Engine Advanced · 05/16/2007 (12:19 pm) · 2 replies
So ran this command and it has failed on about the third image in the log. Or TGEA is crashing at this point, and all able to see in the log is that was creating the file, shows no errors.
Wondering if anyone having this issue running this command.?
Started to exporting out of L3DT as mosaic titles as 4096 texture size, when running this command using a 4 so cut them down to 1024.
When you receive a error the code tells you the following
usage:
Look for information the tilemask and found nothing that truly explains its properies.
When looking at the code and the examples online shows this.
What does the 0 represent in the code above? Seen where people don't use the 0 and replace it with "PNG"
Now this is above me because I'm a artist but continue trying to learn and understand it. Wish there was a better pipeline into the engine with less of a headache. Out of one fire into other fire trying to get this terrain completed
Recently made chances to the code on the engine to fix the atlasGenerateTextureTOCFromTiles
Replace the following code in /engine/atlas/editor/atlasImportLargeImage.cpp
Wondering if anyone having this issue running this command.?
Started to exporting out of L3DT as mosaic titles as 4096 texture size, when running this command using a 4 so cut them down to 1024.
When you receive a error the code tells you the following
usage:
(leafCount, tileMask, outFile, outFormat)
Look for information the tilemask and found nothing that truly explains its properies.
When looking at the code and the examples online shows this.
atlasGenerateTextureTOCFromTiles( 4,
"YOUR_MOD_FOLDER/data/terrains/colormap_y%dx%d",
"YOUR_MOD_FOLDER/data/terrains/deleteme.lightmap.atlas",
0 );What does the 0 represent in the code above? Seen where people don't use the 0 and replace it with "PNG"
Now this is above me because I'm a artist but continue trying to learn and understand it. Wish there was a better pipeline into the engine with less of a headache. Out of one fire into other fire trying to get this terrain completed
Recently made chances to the code on the engine to fix the atlasGenerateTextureTOCFromTiles
Replace the following code in /engine/atlas/editor/atlasImportLargeImage.cpp
// Copy from the JPEG working space to the bitmap.
GBitmap *gb = new GBitmap(tileSize, tileSize);
for(S32 k=0; k<tileSize; k++)
dMemcpy(gb->getAddress(0, k), rows[k] + j*tileSize*3, 3*tileSize);
atc->bitmap = gb;
with this code:
Code:
// Copy from the JPEG working space to the bitmap.
GBitmap *gb = new GBitmap[1];
gb->allocateBitmap(tileSize, tileSize);
for(S32 k=0; k<tileSize; k++)
dMemcpy(gb->getAddress(0, k), rows[k] + j*tileSize*3, 3*tileSize);
atc->layerCount = 1;
atc->bitmap = gb;
In /engine/atlas/editor/atlasImportTiles.cpp change:
Code:
dSprintf(buff, 512, tileMask, imgX, imgY);
GBitmap *bmp = GBitmap::load(buff);
if(!bmp)
{
Con::errorf("atlasGenerateTextureTOCFromTiles - unable to open tile '%s'! Aborting!", buff);
return;
}
// Create a chunk to store this data in.
AtlasTexChunk *atc = new AtlasTexChunk;
atc->mFormat = (AtlasTexChunk::TexFormat)outFormat;
atc->bitmap = bmp;
// Get the stub.
AtlasResourceTexStub *tStub = arttoc->getStub(treeDepth-1, Point2I(x,y));
// And store the chunk.
arttoc->instateNewChunk(tStub, atc, true);
// Purge it once we're done so we don't use gigs of ram!
tStub->purge();
to:
Code:
dSprintf(buff, 512, tileMask, imgX, imgY);
GBitmap *bmp = GBitmap::load(buff);
if(!bmp)
{
Con::errorf("atlasGenerateTextureTOCFromTiles - unable to open tile '%s'! Aborting!", buff);
return;
}
// Create a chunk to store this data in.
AtlasTexChunk *atc = new AtlasTexChunk;
atc->mFormat = (AtlasTexChunk::TexFormat)outFormat;
atc->layerCount = 1;
// Copy the loaded bitmap into our array of a single bitmap.
atc->bitmap = new GBitmap[1];
// Note that this copies the _pointers_ so we don't have to worry
// about leaking bmp's resources - they're transferred to atc->bitmap[0].
atc->bitmap[0] = *bmp;
// Get the stub.
AtlasResourceTexStub *tStub = arttoc->getStub(treeDepth-1, Point2I(x,y));
// And store the chunk.
arttoc->instateNewChunk(tStub, atc, true);
// Purge it once we're done so we don't use gigs of ram!
tStub->purge();
#2
Thanks for that information on that field, have to add that ever growing list of atlas information.
There really needs to be a better pipeline into this engine for artists.
Now wondering if just export out L3DT the mosaic tiles and just stitch them together and use the large jpg command to solve this mess.
05/17/2007 (9:56 am)
The Plugin is limit to a certain size right now and my option is very buggy. It does work fine on terrains that under 4097. Thanks for that information on that field, have to add that ever growing list of atlas information.
There really needs to be a better pipeline into this engine for artists.
Now wondering if just export out L3DT the mosaic tiles and just stitch them together and use the large jpg command to solve this mess.
Torque Owner Dennis Trevillyan
WatreGames
There are two ways to avoid having to deal with the various commands to generate an Atlas terrain. The first is the L3DT Atlas plugin. I've never used it so I can't really comment much on it other than to say it currently only works with Unique terrains and may be limited in the size of terrain it will convert. The second is a torque script dialog available here: www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=11826.
Hope that helps.