Skip to content
Russ Painter edited this page Jan 19, 2019 · 1 revision

Adding fog to our scene will accomplish a few things.

  • More spooky feeling
  • Greater sense of depth. Far away UFO's will be more occluded by fog and will appear further away.
  • Our small game world won't feel as claustrophobic. It won't be obvious that we're in a little sandbox.

The Wrong Way

Lighting settings is were we configure our fog. We'll set this up, even though it won't give us everything we need.

  1. If we go go the Lighting window and scroll down to Other Settings there's a checkbox for Fog. Check this.

  2. Change the fog Mode to Linear

  3. Change the fog color to be similar to your skybox colors. My skybox is an orange sunset, so I'm going to pick a light grey fog that has a slight bit of orange.

This will give us something like this:

Fog with Foward Rendering

It looks OK except that the skybox does not have fog applied to it. We're going to have to change the camera rending mode from Forward to Deferred and add the fog another way, using the Post Processing stack.

The Right Way

  1. Select the camera and in the Inspector window change Rendering Path to Deferred. The fog will disappear, but that's OK, we'll get it back.

  2. Uncheck Allow MSAA (removes jagged lines) since this isn't compatible with deferred rendering. We'll also find a better way of doing this image smooting.

  3. On the camera, add a component Post Processing Layer. The fog is back, but has the same skybox problem as before.

  4. In the Post Processing Layer component find Deferred Fog and un-check Exclude Skybox

Fog with Deferred Rendering

That's the stuff!

Clone this wiki locally