Do shadows work on TGEA 1.0.3 Atlas Terrain?
by Andy Hawkins · in Torque Game Engine Advanced · 03/27/2008 (9:34 pm) · 19 replies
I've tried various lighting schemes but I can't get static DTS's to cast shadows on unique or blended terrain.
Do they work? Have they been turned off and I have to enable them somewhere?
Do they work? Have they been turned off and I have to enable them somewhere?
#2
When you create your atlas file you need to make sure the texture and geometry tree depths are the same.
I have had this happen to me if I don't set the tree depth correctly.
If your source textures are tiled remember this
A 2 X 2 texture source will produce a tree depth of 1
A 4 X 4 texture source will produce a tree depth of 2
A 8 X 8 texture source will produce a tree depth of 3
A 16 X 16 texture source will produce a tree depth of 4
A 32 X 32 texture source will produce a tree depth of 5
This assumes a texture size of 512*512 pixels.
Can't help on the DTS shadow.
03/28/2008 (8:18 am)
I think the shadow from the camera is from an improper tree depth atlas texture setup.When you create your atlas file you need to make sure the texture and geometry tree depths are the same.
I have had this happen to me if I don't set the tree depth correctly.
If your source textures are tiled remember this
A 2 X 2 texture source will produce a tree depth of 1
A 4 X 4 texture source will produce a tree depth of 2
A 8 X 8 texture source will produce a tree depth of 3
A 16 X 16 texture source will produce a tree depth of 4
A 32 X 32 texture source will produce a tree depth of 5
This assumes a texture size of 512*512 pixels.
Can't help on the DTS shadow.
#3
Do you know if shadows can be cast from DTS's onto terrain?
Do you know if the atlas terrain works properly at all?
03/28/2008 (6:14 pm)
Thanks Bill. Well I did some more tests last night - got the tree depth right, but I can't get shadows on a blended terrain and it's really dark all the time. The whole thing is very annoying and I can't get a useable terrain out of the tools.Do you know if shadows can be cast from DTS's onto terrain?
Do you know if the atlas terrain works properly at all?
#4
Go into the mission inspector and set the sun's ambient value higher and then do a relight.
If that doesn't work make sure the sun position is above the terrain.
As for DTS shadows on atlas I haven't look much into it.
Both the player and vehicles cast shadows on atlas terrains so it should be possible.
As for atlas terrain working properly I believe that a lot of the problem with using it is a huge amount of undocumented things that I only found thru trail and error while creating my AtlasSphere class which is derived from the Atlasinstance2 class.
03/28/2008 (8:23 pm)
As far as it being dark on the terrain try this.Go into the mission inspector and set the sun's ambient value higher and then do a relight.
If that doesn't work make sure the sun position is above the terrain.
As for DTS shadows on atlas I haven't look much into it.
Both the player and vehicles cast shadows on atlas terrains so it should be possible.
As for atlas terrain working properly I believe that a lot of the problem with using it is a huge amount of undocumented things that I only found thru trail and error while creating my AtlasSphere class which is derived from the Atlasinstance2 class.
#5
The only thing legacy has over atlas is in game editing.
Don't get me wrong I am not saying legacy has no place I am just saying I prefer atlas.
Just a couple shots for size





03/28/2008 (8:44 pm)
IMHO I think that Atlas terrain is far better than legacy.The only thing legacy has over atlas is in game editing.
Don't get me wrong I am not saying legacy has no place I am just saying I prefer atlas.
Just a couple shots for size





#6
03/28/2008 (9:53 pm)
I noticed only your player is casting shadows. Does the building cast shadows?
#7
03/28/2008 (10:58 pm)
That building is a dts shape so I think it would have to have its settings tweaked to turn on shadows. Interiors do cast shadows. I tend to agree with Bill in that I prefer atlas to Legacy. The new Legacy is great for what it does, having the ability to do in-game editing, etc is nice. If you don't mind losing that though I prefer atlas. I did get multiple detail textures working sort of in atlas last night also, though I'm getting some glitching on the clipmap seams so I had to limit the visibility to a short distance 65 meters currently to avoid them. Still working on that one. The performance though in Atlas is fantastic in 1.7.
#8
However now I think the latest L3DT Atlas generator is faulty.
-First pic is unique terrain - looks good but I can't have shadows.
-Second pic is blended terrain and what happens for a fraction of a second during a relight - looks good, but no shadow, and black pixels for one map.
-Third pic is after the relight - looks drab... black pixels no shadows.
-Fourth pic is earlier L3DT to Atlas generator, wrong colours.
The last two pics (fifth and sixth) are a bigger map, using old L3DT exporter.
-The fifth pic is unique terrain, no shadows working, and what's with the black terrain segment?
-The sixth pic showing blended (wrong colours) but shadows working. Argh!!!!! And what's with the shaded purple tower????





03/28/2008 (11:14 pm)
I did get some success by using a collision mesh in static objects, they cast a shadow.However now I think the latest L3DT Atlas generator is faulty.
-First pic is unique terrain - looks good but I can't have shadows.
-Second pic is blended terrain and what happens for a fraction of a second during a relight - looks good, but no shadow, and black pixels for one map.
-Third pic is after the relight - looks drab... black pixels no shadows.
-Fourth pic is earlier L3DT to Atlas generator, wrong colours.
The last two pics (fifth and sixth) are a bigger map, using old L3DT exporter.
-The fifth pic is unique terrain, no shadows working, and what's with the black terrain segment?
-The sixth pic showing blended (wrong colours) but shadows working. Argh!!!!! And what's with the shaded purple tower????
#9
I prefer to use the console functions.
I still use L3DT to setup my terrain but the direct to atlas exporter has a couple of oddities.
One is that in L3DT there is a 1 pixel wide strip on the right and bottom of the height map that can not be edited directly. What should happen is before it starts to export the terrain it should increase the height map by 1 similar to the way the other L3DTio_Atlas2 exporter works.
Now for the problem you are having I got 3 more things to try.
First make sure the light map is setup the same as the opacity map.
If your opacity map is made of an 8 X 8 tiled 512 textures do the same for the light map.
Second I have encountered were large atlas files can cause errors you describe.
Try exporting the same map at a smaller size then relighting it in game.
Third try exporting your map at a target tree depth of 3.
I have seen where high tree depths like 5 or 6 has caused errors where LOD level 0 1 and 2 look fine but when 3 and 4 come in the light map gets screwed up.
03/29/2008 (4:12 am)
I have never liked that exporter in L3DT.I prefer to use the console functions.
I still use L3DT to setup my terrain but the direct to atlas exporter has a couple of oddities.
One is that in L3DT there is a 1 pixel wide strip on the right and bottom of the height map that can not be edited directly. What should happen is before it starts to export the terrain it should increase the height map by 1 similar to the way the other L3DTio_Atlas2 exporter works.
Now for the problem you are having I got 3 more things to try.
First make sure the light map is setup the same as the opacity map.
If your opacity map is made of an 8 X 8 tiled 512 textures do the same for the light map.
Second I have encountered were large atlas files can cause errors you describe.
Try exporting the same map at a smaller size then relighting it in game.
Third try exporting your map at a target tree depth of 3.
I have seen where high tree depths like 5 or 6 has caused errors where LOD level 0 1 and 2 look fine but when 3 and 4 come in the light map gets screwed up.
#10
1) I don't know how to read a png as the (alpha) opacity map
2) I get a weird chunk error when I try to load a blended terrain.
Care to share you blended terrain console commands please?
03/30/2008 (8:33 am)
I'm having trouble using the console functions to import a blended terrain.1) I don't know how to read a png as the (alpha) opacity map
2) I get a weird chunk error when I try to load a blended terrain.
Care to share you blended terrain console commands please?
#11
In atlasGenerateTextureTOCFromTiles the last parameter tells it to store in jpeg or png in the atlas file.
03/30/2008 (12:28 pm)
enableWinConsole(true);
setLogMode(2);
cls();
echo("Starting Atlas Build!\n\n");
//small size for lightmap
//atlasOldGenerateChunkFileFromRaw16("starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/MOON_14_5_CLIP_HF.raw", 1024, 1.000000, 0.0108562, "starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/MOON_14_5_CLIP.chu", 1.000000, 4);
//large
atlasOldGenerateChunkFileFromRaw16("starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/MOON_14_5_CLIP_HF.raw", 1024, 20.000000, 0.217124, "starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/MOON_14_5_CLIP.chu", 16.000000, 4);
importOldAtlasCHU("starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/MOON_14_5_CLIP.chu", "starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/MOON_14_5_CLIP.geom.atlas");
atlasGenerateTextureTOCFromTiles(8, "starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/LM/MOON_LM_x%dy%d", "starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/Lightmap.atlas", 0);
//atlasGenerateTextureTOCFromLargeJPEG("starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/MOON_LM.jpg", 1, "starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/Lightmap.atlas");
atlasGenerateTextureTOCFromTiles(8, "starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/ALM_Alpha1/Alpha1_x%dy%d", "starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/OpacityTex.atlas", 1);
atlasGenerateBlenderTerrain(
"starter.fps/data/terrains/moon1_CLIP.atlas",
"starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/MOON_14_5_CLIP.geom.atlas",
"starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/OpacityTex.atlas",
"starter.fps/data/terrains/moonsphere/moon2/DD/SPHERE/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
16384,
// 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.
//rock2.jpg
"starter.fps/l3dt/yellowsand1-desert.jpg",
"starter.fps/l3dt/rock1-desert2.jpg",
"starter.fps/l3dt/rocks1-desert.jpg",
"starter.fps/l3dt/rock1-desert.jpg"
);
quit();In atlasGenerateTextureTOCFromTiles the last parameter tells it to store in jpeg or png in the atlas file.
#12
03/30/2008 (4:47 pm)
Thanks very much Bill - this should really help.
#13
Ideally speaking, I would like to have a large number of textures available for use on Atlas terrains, as the more textures available the greater the degree of variety and believability the terrain will have in game...
Does anyone know anything about this?
03/31/2008 (12:38 pm)
Has anyone managed to get more than 8 textures working on an Atlas terrain? I remember seeing a resource that had 16 textures working for Atlas a while ago...but I cannot seem to find it...Ideally speaking, I would like to have a large number of textures available for use on Atlas terrains, as the more textures available the greater the degree of variety and believability the terrain will have in game...
Does anyone know anything about this?
#14
In the Repopulation I'm just using a normal 4 texture atlas, but I'm using a lightmap created with Grome and I'm coloring the lightmap. Lightmaps normally only use black and white, but they are 24 bit images so can be used to paint different portions of the terrain in different colors which would then blend with your textures and could be used for different colored patches of grass or rock colorations, etc. Since on the atlas terrains at the moment it isn't sampling the lightmap to shadow your player anyway, that works out well for helping to provide you with a lot more color options without requiring more textures.
03/31/2008 (7:55 pm)
I don't think there was ever a resource for 16, but you may be thinking of HTC which was an editing program which let you use a ton of different colors, but that was using a unique terrain. It hasn't been updated in ages though and IMO is dead (which is unfortunate for us who actually bought a license). In the Repopulation I'm just using a normal 4 texture atlas, but I'm using a lightmap created with Grome and I'm coloring the lightmap. Lightmaps normally only use black and white, but they are 24 bit images so can be used to paint different portions of the terrain in different colors which would then blend with your textures and could be used for different colored patches of grass or rock colorations, etc. Since on the atlas terrains at the moment it isn't sampling the lightmap to shadow your player anyway, that works out well for helping to provide you with a lot more color options without requiring more textures.
#15
If so I didn't know that. Off to investigate. :)
04/01/2008 (3:17 am)
@J.C smith Hmm.... Colored lightmaps? That works in TGEA out of the box? If so I didn't know that. Off to investigate. :)
#16
Thanks a lot J.C. good move finding a way around the restrictions of the system.
Is the standard Atlas limited to only four textures? I thought it was more, but using the light map should be able to give me the variety that I desire.
04/01/2008 (6:34 am)
Wow, that would definitely help with getting more variety on the Atlas terrain without having to worry about dealing with loads of different textures.Thanks a lot J.C. good move finding a way around the restrictions of the system.
Is the standard Atlas limited to only four textures? I thought it was more, but using the light map should be able to give me the variety that I desire.
#17

04/01/2008 (8:10 am)
Thanks for the tip J.C. On a good note I got the blended terrain to work finally with Bill Vee and Aaron Torpy's assistance. I wrote my own export script instead of using L3DT and produced these beauties. I will be looking into why the L3DT exported didn't give me what I wanted and hopefully be able to provide a fix for that product soon.
#18
One quick note...I did rewrite the ClipMapBlenderCache code that Atlas and TerrainBlock share in TGEA 1.7 to allow for basically unlimited blended textures (at the cost of more rendering passes). You can see this in action on the TGE Demo Advanced and Stronghold terrains which each use 6 textures.
I didn't touch the Atlas generation code so it may still be hardcoded for 4 textures only (same for the code that hands off the sources to the ClipMap) but those should be the easier of the fixes.
04/01/2008 (10:59 am)
Hey guys,One quick note...I did rewrite the ClipMapBlenderCache code that Atlas and TerrainBlock share in TGEA 1.7 to allow for basically unlimited blended textures (at the cost of more rendering passes). You can see this in action on the TGE Demo Advanced and Stronghold terrains which each use 6 textures.
I didn't touch the Atlas generation code so it may still be hardcoded for 4 textures only (same for the code that hands off the sources to the ClipMap) but those should be the easier of the fixes.
#19
Any estimate on when the shadows will start working on Unique Atlas terrains?
Edit: once my head hit the pillow I realized this was a stupid question -- with a static lightmap the baking of shadows becomes naturally impossible :)
If one wishes to use the unique atlas what are the options for static shape shadows (I assume that dynamic shadows from players etc. work on unique atlas terrain)? Is it possible to force a static shape to use some limited form of dynamic shadows (e.g. calculated only upon initial placement or at least on very long intervals, not every frame)? I vaguely recall something like that from the original Synapse lighting kit for TGE.
04/06/2008 (3:09 pm)
@GG:Any estimate on when the shadows will start working on Unique Atlas terrains?
Edit: once my head hit the pillow I realized this was a stupid question -- with a static lightmap the baking of shadows becomes naturally impossible :)
If one wishes to use the unique atlas what are the options for static shape shadows (I assume that dynamic shadows from players etc. work on unique atlas terrain)? Is it possible to force a static shape to use some limited form of dynamic shadows (e.g. calculated only upon initial placement or at least on very long intervals, not every frame)? I vaguely recall something like that from the original Synapse lighting kit for TGE.
Associate Andy Hawkins
DrewFX
... but I can't get the shadows for any DTS to show on the terrain. This is driving me slightly insane.
Is it possible to have shadows from DTS's on unique terrain? I wish someone would let me know because I'm wasting a lot of time trying to get a decent terrain for my game going. I was under the impression this tech was working already.
Here's a vid of the problem.
www.drewfx.com/BRAVE/ShadowProblemsTGEA.mpg Mpeg 1 @ 5meg