[Tutorial] Use fog correctly

Discussion in 'Tutorials & Resources' started by Schinken, Dec 5, 2009.

  1. Schinken

    Schinken L1: Registered

    Messages:
    33
    Positive Ratings:
    15
    Hello everyone who is reading this :).
    As i had some trouble with fog in the past and figured out a good solution, i want to share it with you.


    1. The Setup
    2. Getting the sky color
    3. Problems


    1st: The Setup

    Okay i just assume that you know how to create maps and etc.
    A good tutorial for a 3d skybox can be found here -> http://forums.tf2maps.net/showthread.php?t=116


    Put an env_fog_controller into your gameplay area.
    These are my settings:
    [​IMG]


    This is what it looks in-game for me:
    [​IMG]
    Doesn't look very good, huh?





    2nd: Getting the sky color



    Just take a screenshot and load the image into Photoshop or any other image editing programm.
    Get the color of the sky next to the water:
    [​IMG]


    Now change the Primary Fog Color to these values:
    [​IMG]


    In-Game:
    [​IMG]
    Looks way better, huh?




    3rd: Problems

    The problem is, it only works good on non-vertical maps.
    [​IMG]
    Pretty ugly...

    So now how to fix this?
    Create a skybox which has only one color, use that color as fog color and it should work.




    You can download the map here: http://dl.dropbox.com/u/2811892/fog.vmf
     
    • Thanks Thanks x 1
    Last edited: Dec 5, 2009
  2. Tapp

    Tapp L10: Glamorous Member

    Messages:
    776
    Positive Ratings:
    215
    Nice little tut for those who don't understand, although I think that the last thing you should do is have a mono-colour skybox. The best thing to do is find where it shows up the most, follow the tut for that exact spot, and enter in the sky-fog direction. Then repeat for the second-worst spot using the secondary fog colour. Imo that's the best way to do it, but your tut certainly helps.