Fog Texture??...Weird Atlas2 effect
by JPaxson · in Torque Game Engine Advanced · 10/30/2006 (2:43 pm) · 20 replies
TSE MS4, when I move my fog distance and visible distance to very large, like fog distance="3000", visibleDistance="4500" (effectively shutting it off for my particular terrain. my terrain is much larger than the terrain_water_demo's.) I get a weird spotlight effect on the terrain. It is like a very large light is following me around (outside the light cone is black).
I ran it down to the fogTexture created in sceneGraph and rendered in atlasClipMapBatcher. I can make it go away by making the fogTexture completely transparent but that does unexpecting things to the clipping and the display of atlas chunks. At the end of the day i need the ability to turn fog off or on and this artifact is unwelcomed even if it is working as intended.
Has anyone else made very large atlas2 terrains and noticed this problem? Maybe even come up with a solution to make everything play nice and get rid of the fog texture?
Thanks
I ran it down to the fogTexture created in sceneGraph and rendered in atlasClipMapBatcher. I can make it go away by making the fogTexture completely transparent but that does unexpecting things to the clipping and the display of atlas chunks. At the end of the day i need the ability to turn fog off or on and this artifact is unwelcomed even if it is working as intended.
Has anyone else made very large atlas2 terrains and noticed this problem? Maybe even come up with a solution to make everything play nice and get rid of the fog texture?
Thanks
About the author
#2
11/02/2006 (7:40 am)
Yup, got it too. I think it was in regular Atlas, though.
#3
11/02/2006 (8:01 am)
No my terrain is definately an atlas2 one. This "problem" only exists in MS4 for me with atlas2 terrains.
#4
11/02/2006 (11:35 pm)
I had this problem a while back, and it turned out that the JPEG texture I was using didn't have a DPI encoded in it. Opened it in irfanview, "resized" it to the same size, and irfanview filled in a 72 dpi resolution. Resaved and converted to atlas, and the spotlight effect went away.
#5
11/03/2006 (3:35 am)
Yup, I'm getting it too. Couldn't fix it in irfanview either, and it appears to have come about since I switched to a blended terrain (maybe thats just a coincidence though).
#6
11/03/2006 (3:37 am)
Oddly it goes away if I use a blank white lightmap. Very odd.
#7
11/03/2006 (11:30 am)
Yes, I changed the code which generates this image to just build a completely transparent image. That makes the problem go away, but with a large scale terrain this causes atlas problems with visibility determination of chunks an also looks like it causes far clipping artifacts.
#8
could you post some details of what you found out, like files and line numbers or something. I spent all morning trawling around inside the Atlas code but haven't yet found anything significant. Perhaps if you point me in the right direction I could code up a fix for it.
Cheers,
Andy.
11/03/2006 (11:56 am)
Brett,could you post some details of what you found out, like files and line numbers or something. I spent all morning trawling around inside the Atlas code but haven't yet found anything significant. Perhaps if you point me in the right direction I could code up a fix for it.
Cheers,
Andy.
#9
11/03/2006 (2:06 pm)
Andrew, if you'll send me your jpeg I'd be curious to see if I could reproduce the problem and my fix.
#10
11/04/2006 (6:15 am)
Seems to be something to do with blending clipmap levels for the lightmap, but I'm sick of trawling through the rats-nest of code trying to figure out how to fix it. I think the original author needs to take a look.
#11
11/04/2006 (8:34 am)
Seems to be something to do with blending clipmap levels for the lightmap, but I'm sick of trawling through the rats-nest of code trying to figure out how to fix it. I think the original author needs to take a look.
#12
11/04/2006 (9:47 am)
Just a word of advice: Keep your view distance fairly low. View distance is linked to scoping distance.
#13
SceneGraph::buildFogTexture (line 217 SceneGraph.cpp) builds the fogTexture used in atlasClipMapBatcher.cpp (AtlasClipMapBatcher::renderFog() line 215). At line 322 in the buildFogTexture function you can set it to output to file the texture it constructs(fogTextureTest.png at the .exe file level). Like I said before when the texture is constructed if I make the image completely transparent the ring disappears, but causes a lot of artifacts with rendering atlas. Maybe it will make more sense this morning.
@Matt
I don't have the option of small view distances.
@Lee
I'll try the jpeg resize thing.
11/06/2006 (6:44 am)
@AndrewSceneGraph::buildFogTexture (line 217 SceneGraph.cpp) builds the fogTexture used in atlasClipMapBatcher.cpp (AtlasClipMapBatcher::renderFog() line 215). At line 322 in the buildFogTexture function you can set it to output to file the texture it constructs(fogTextureTest.png at the .exe file level). Like I said before when the texture is constructed if I make the image completely transparent the ring disappears, but causes a lot of artifacts with rendering atlas. Maybe it will make more sense this morning.
@Matt
I don't have the option of small view distances.
@Lee
I'll try the jpeg resize thing.
#14
My guess as to what is going on is that the final blend of clipmap levels is including some black textures, so the further away geometry is the more black will be blended in.
I have tried to check the CVS server for any updates, but it appears to be offline at the moment - can anyone else access it?
Andy.
11/06/2006 (10:06 am)
Looks to me to be somthing to do with the depth of the atlas quadtree vs the size of the texture. Increasing tree depth seems to get rid of the effect, and increasing texture size makes it worse. Also atlasGenerateTextureTOCFromLargeJPEG and atlasGenerateTextureTOCFromTiles have differing effects, possibly because I am using atlasGenerateTextureTOCFromTiles with just one big tile. Perhaps the number of tiles for sent to this function should match the chunk tree?My guess as to what is going on is that the final blend of clipmap levels is including some black textures, so the further away geometry is the more black will be blended in.
I have tried to check the CVS server for any updates, but it appears to be offline at the moment - can anyone else access it?
Andy.
#15
Fine with me...if they update TSE frequently.
11/06/2006 (1:10 pm)
CVS is offline for good. Now we can only download a zip file--check your downloads page.Fine with me...if they update TSE frequently.
#16
11/07/2006 (1:50 am)
Why on earth did they pull the plug? I'm totally dependant upon getting the changed file list from CVS so that I can merge their changes with my heavily modified version of the runtime! :(
#18
11/08/2006 (6:33 am)
@Andrew ...You hit it right on the head reprocessing tree depth for image did the trick. Thanks.
#19
Fix can be found here:
www.garagegames.com/mg/forums/result.thread.php?qt=56269
enjoy!
01/07/2007 (3:32 pm)
Sorry to bump this old post but we found out the cause and a work around and I figured someone else would encounter this problem and not have a clue how to fix it. There is no need for an engine change to fix this. (although a check to see if the texture and heightmap chunks would prevent it from happening).Fix can be found here:
www.garagegames.com/mg/forums/result.thread.php?qt=56269
enjoy!
#20
Back to fog though, I have no problems with large view distances, but I just can't get normal fog to work at all.
It seems to totally ignore the values I key in. We want a lowish thick fog layer, but it doesn't seem to want to go that low, and at certain values, the fog just goes solid, and if I enter the fog, it'll vanish on the current atlas terrain.
If I raise the atlas terrain, the fog moves up with it, and since the terrain is in tiles, the fog only moves up on the current atlas tile!
01/11/2007 (9:36 am)
Thanks for the link, we used to have this problem too. I used to just think my computer couldn't handle certain file sizes for textures! :DBack to fog though, I have no problems with large view distances, but I just can't get normal fog to work at all.
It seems to totally ignore the values I key in. We want a lowish thick fog layer, but it doesn't seem to want to go that low, and at certain values, the fog just goes solid, and if I enter the fog, it'll vanish on the current atlas terrain.
If I raise the atlas terrain, the fog moves up with it, and since the terrain is in tiles, the fog only moves up on the current atlas tile!
Torque Owner JPaxson