Search This Blog

Monday, September 12, 2016

Technique Training: Fog and Environmentals

I was originally going to bake this in with my Advanced lighting series but this is more of a subject unto itself.  One of the more powerful elements within Game-Guru for creating environmental effects is the fog system.  The fog system was originally... laughable:


Picture courtesy of  Lee Bamber's now extinct dev log.
As you can see it was just as simple coloring of everything in the background.  By comparison, this is the fog system from the way past dead Game Creation System from the mid-late nineties:

Literally the same system in practice.

That said, at some point, Lee realized this was a titanic error and fixed it to provide a significantly better fog system.  We ended up with something vastly better:

This is an old picture, but shows the lower limits of what's possible.
So as you can see this has a major impact on the function of environmentals.  This game engine has very few 'modern' features.  It's important to stretch everything to it's limit so that's what I'm aiming to teach you to do!


Realistic nighttime!

So with that we approach our first technique; realistic nighttime.  In game-guru, nighttime effects are actually quite difficult to achieve.  This is primarily because the sky system has a constantly active light which will frequently circumvent your efforts.  This light is fixed in space and you can turn down ambient/shadow values to zero but your game will still fall short of achieving that desired 'nighttime' look.

The trick, the real trick, is to use fog.  If you set all the values to 1 for RGB, set the range start up close and the far distance close, then modify the intensity as desired it will create a black fog which accurately mimics the feel of night and it's creeping darkness.
As you can see from this picture:  it looks silly with a daytime sky.


But if you add a nighttime sky, it all falls together.  The best part is it accurately sets up flash-light fall-off.

As you can see, it looks far more like night.

Distance simulation with Fog

One common mistake I see in Game-Guru games is that they very frequently don't factor in standard atmospheric effects.   This in turn, makes their own job HARDER.

Not a bad city depiction, texture misalignment aside.


So this scene looks good.  It's a basic city done with some simple city models someone made.  Overall, not terrible.
Compare this against GTA IV:
Can you guess the difference?
The difference is atmospheric haze.  A slight atmospheric haze provides a level of reality to any city scene as most any place in the world has at least SOME slight atmospheric haze.

Haze is defined as: "Traditionally an atmospheric phenomenon where dust, smoke and other dry particles obscure the clarity of the sky."

What you'll find is in almost every scene, from top to bottom at least a slight tinge of fog on the outlying distance (use your total visible range in an average scene, add fog to the last 15-20%) will have atmospheric haze.

Don't overdo it, or you'll look like silent hill.
Trivia fact: did you know the first Silent Hill's trademark fog was actually a way to disguise the draw-distance limitations of the PlayStation 1 and the respective game engine involved?  By implementing a heavy fog they accomplished both an incredible atmosphere and also improved game performance.  That's win-win!

When implementing your haze, you want to keep in mind that time of day matters; remember haze is effectively a reflection or light being blocked.  As the time of day changes, so too does the haze.

Not a game-guru picture.  Just some random image from google.
As you can see above, the relatively nearby trees have a SLIGHT orange tinge (even in the upper branches) caused by atmospheric haze and ambient lighting.  The lightrays further illustrate the haze, though lightrays on Game-Guru are totally dictated by the aforementioned fixed sun.
This is more what you're striving for:

From Twin Worlds - Note the orange haze, matching the sky perfectly.
As you can see, these settings are pretty simple stuff. You can do quite a lot with them.



Further examples(settings included):

My city test - day, with Atmospheric (normal) coloring:
If you further modify your depth of field settings you can achieve a more pleasing result, but this fairly decent for a quick example.

 
Preparing for a more night-oriented effect.

This is a longer range darkness, but still dark.  I left the cloudy sky in for contrast.

Now is a really dark version - high intensity.  Distance remains the same.
 

Notice how the red light is no longer visible.
Maximum darkness.  Close range.  No flashlight.  Dark sky.  

I had to move close just so you could see anything!!
Sunset Sky, Sunset fog for atmospheric haze.


My favorite, personally speaking.

 Silent hill, just because :P


Just add pyramid head.


As always, feel free to comment.  If this has been useful to me, please post a link to your results below!

1 comment:

Anonymous said...

Good stuff, great advice!