T3D 1.1 Beta3 - FogDistance Missing?[Fixed] - NOT A BUG
by CSMP · in Torque 3D Professional · 01/24/2011 (2:01 pm) · 12 replies
I'm trying to duplicate my TGE project in T3D and the first thing I noticed was the lack of a FogDistance control, The first thing I did when trying to get T3D working on older hardware was set the VisibleDistance to about half of what it was, and the second thing I was trying to do was set the Fog to hide the render cutoff of the terrain... now I've seen Fog settings in one of the controls but either FogDistance has been renamed, moved into another control or left out of the current version?
Basically I'm trying to figure out how to get the Fog effect that TGE used to hide the terrain cutoff, Any heads-up on this subject would be great.
P.S. This is not a bug and I probably should have posted this in the Porting Forum, but I wasnt sure if it was a bug or not at the time.
Basically I'm trying to figure out how to get the Fog effect that TGE used to hide the terrain cutoff, Any heads-up on this subject would be great.
P.S. This is not a bug and I probably should have posted this in the Porting Forum, but I wasnt sure if it was a bug or not at the time.
#2
01/24/2011 (3:01 pm)
You have to play around with the fog height aswell
#3
This is the result I keep getting, I've tried setting a negative value on the fogDensityOffset but it doesnt seem to work:(notice the fade and how the fog should be on the exact opposite side of the fade)
01/24/2011 (10:57 pm)
I've tried to work with the mentioned values and they seem to do the exact opposite of TGE fogDistance.This is the result I keep getting, I've tried setting a negative value on the fogDensityOffset but it doesnt seem to work:(notice the fade and how the fog should be on the exact opposite side of the fade)
#4
Here's an example with the editor window open so you can see the values I used:

As you can see, the density value is going to be extremely small. The difference between 0.001 and 0.005 is quite significant, so adjust by very small increments. The offset is much simpler, it's just the distance from the camera at which the fog effect begins (90 in this case). Finally, to do a full-scene fog you'll want the height value set to 0.
01/24/2011 (11:17 pm)
The fog settings are very different from TGE, however you can accomplish the same results once you get the hang of it. Basically, instead of just defining two distances for fog (start and 100% coverage) you now define a "density" and an "offset" (offset is the same as start distance).Here's an example with the editor window open so you can see the values I used:

As you can see, the density value is going to be extremely small. The difference between 0.001 and 0.005 is quite significant, so adjust by very small increments. The offset is much simpler, it's just the distance from the camera at which the fog effect begins (90 in this case). Finally, to do a full-scene fog you'll want the height value set to 0.
#5
P.S. Yes things are very differant from TGE!(lol)
01/24/2011 (11:31 pm)
@Henry: Appreciate the help... those settings matched up pretty well with my current level, it looks so much better now that I cant see the end of the world!P.S. Yes things are very differant from TGE!(lol)
#6
How much would it help/hurt to move back to a simple fogStart/fogEnd distance?
01/25/2011 (2:21 am)
While your here.How much would it help/hurt to move back to a simple fogStart/fogEnd distance?
#7
Start/End is probably more intuitive for more people and involves less guess and test adjustment... On the other hand changing it would force everyone to go set the fog in their levels again, but I doubt anyone would be confused once they saw "fogStart" & "fogEnd."
01/25/2011 (4:05 am)
The density thing seems to stump people coming from TGE pretty often, it's definitely a not-uncommon forum question.Start/End is probably more intuitive for more people and involves less guess and test adjustment... On the other hand changing it would force everyone to go set the fog in their levels again, but I doubt anyone would be confused once they saw "fogStart" & "fogEnd."
#8
I doubt having to fix the fog would slow people down.
01/25/2011 (5:12 am)
There are far worse things to have to fix when porting.I doubt having to fix the fog would slow people down.
#9
01/25/2011 (8:51 am)
Maybe just different wording of fogDensityOffset would do the trick? Nothing really to "fix", there's nothing wrong with learning new things ;)
#10
It's still completely clear and using the SkyBox looks strange without the sky being fogged as I can see the bottom of the skyTexture.

Edit: Ok, I may be missing something between the skybox,clouds and/or fog... I'm trying to mess with the settings right now.
Edit2: Well I've found the variable fogBandHeight and it's making the cloud line less noticeable along with differant fog colors, I'm pretty sure an actual skyBox material would pick up the slack and do the rest as far as the cloudline goes.
01/25/2011 (2:04 pm)
Hey guys, The settings Henry gave me worked good for blending the terrain better at the visibleDistance, but the problem now is the fog in the sky(or lack of)... It's still completely clear and using the SkyBox looks strange without the sky being fogged as I can see the bottom of the skyTexture.

Edit: Ok, I may be missing something between the skybox,clouds and/or fog... I'm trying to mess with the settings right now.
Edit2: Well I've found the variable fogBandHeight and it's making the cloud line less noticeable along with differant fog colors, I'm pretty sure an actual skyBox material would pick up the slack and do the rest as far as the cloudline goes.
#11
Here's a quick example I rigged up with the one skybox texture that was included in T3D (I usually use the scattersky without fog, so I don't have any skyboxes of my own).

As you can see the skybox texture is made to fade towards that grey which emulates a band of solid grey fog at the horizon. Then you should match your fog color to the solid horizon/under color (in this example I matched it by eye, but you should actually get the color value from the texture for a perfect match -- you can still slightly see the line between 100% fog and background).
*edit: I wasn't aware of fogBandHeight (again, I don't usually use skyboxes) but it does appear to accomplish the same thing I was talking about without actually forcing you to edit the skybox texture (fades the texture down to the fog color). For best results you still probably want to match the fog color to that background blue (the "under" part of the skybox texture) so that they match up. Also, the effect isn't quite as good as manually doing the fade in the texture as it comes to sharp points in the corners (you can avoid this with a manual fade, as in that example shot).
Take a look in yourProjectgamecoreartskiesNewLevel_sky for some examples of how to do the fade (notice the curve in each of those images which counteracts the corners). I would imagine there's some kind of skybox-making tool that would simplify this process, but that's just a guess.
One other note while I'm here, if you really want your fog to work out well and you don't want to get into crafting skyboxes by hand, you can actually do more than you might think with just a solid color sky and some clouds (which is basically all I ever used in TGE):
01/25/2011 (2:44 pm)
Skyboxes and clouds aren't ever going to be fogged (they're rendered under the rest of the scene and don't occupy the same space or use the same scale as the main scene). If that's a skybox then the problem is in the skybox texture -- it should be made to fade to the solid sky color (the horizon color) to emulate how it would look if it were fogged.Here's a quick example I rigged up with the one skybox texture that was included in T3D (I usually use the scattersky without fog, so I don't have any skyboxes of my own).

As you can see the skybox texture is made to fade towards that grey which emulates a band of solid grey fog at the horizon. Then you should match your fog color to the solid horizon/under color (in this example I matched it by eye, but you should actually get the color value from the texture for a perfect match -- you can still slightly see the line between 100% fog and background).
*edit: I wasn't aware of fogBandHeight (again, I don't usually use skyboxes) but it does appear to accomplish the same thing I was talking about without actually forcing you to edit the skybox texture (fades the texture down to the fog color). For best results you still probably want to match the fog color to that background blue (the "under" part of the skybox texture) so that they match up. Also, the effect isn't quite as good as manually doing the fade in the texture as it comes to sharp points in the corners (you can avoid this with a manual fade, as in that example shot).
Take a look in yourProjectgamecoreartskiesNewLevel_sky for some examples of how to do the fade (notice the curve in each of those images which counteracts the corners). I would imagine there's some kind of skybox-making tool that would simplify this process, but that's just a guess.
One other note while I'm here, if you really want your fog to work out well and you don't want to get into crafting skyboxes by hand, you can actually do more than you might think with just a solid color sky and some clouds (which is basically all I ever used in TGE):
#12
P.S. Very good looking levels you have there, added inspiration as well!
Edit: Yeah, The texture in the screenshots above was actually the 'BlankSkyMat' in which I was trying to do that exactly... which is also why it took tweaking all those settings to look right, luckily the RRGTS ComboPack came with some good skyboxes that I'll have to try out aswell.
01/25/2011 (3:06 pm)
@Henry: Thank you so much for the added help and screenshots, I will be looking into better skyBox textures as well but I believe with all this information all my problems are solved as far as the sky and fog.P.S. Very good looking levels you have there, added inspiration as well!
Edit: Yeah, The texture in the screenshots above was actually the 'BlankSkyMat' in which I was trying to do that exactly... which is also why it took tweaking all those settings to look right, luckily the RRGTS ComboPack came with some good skyboxes that I'll have to try out aswell.
Torque 3D Owner Marcus L