Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

fog near/far

Discussion in 'Editor & General Support' started by dacloo, Feb 18, 2006.

  1. dacloo


    Jun 30, 2005
    I found the settings for fog color and density, but how can I set the fog near and fog far values? (in Blitz you can set where the lineair fog starts and ends, I suppose its just a setting in OpenGL?)
  2. Joachim_Ante


    Unity Technologies

    Mar 16, 2005
    There are no fog near and far settings since we use exponential fog which is visually much more pleasing.
    The fog falloff can be set in Edit-> Render Settings.

    For culling you can set the far plane and near clip plane in the camera.
  3. rui_mac


    Jul 5, 2006
    Even so, there should be a setting for the distance at which the fog would start. As it is now, it seems to start too soon (even if it is almost real-life accurate). Visually, it washes out the images.
    Fog, in 3D, is not only used to simulate real life fog. Actually it is more often used to simulate atmospheric perspective as in, the saturation of colors washes out as further away from the camera they are. But, to make it look good, it has to start a little (or much) further from the camera. Is it possible to consider that for a future version?

    Rui Batista
  4. taumel


    Jun 9, 2005
    I would also like to weclome better fog steering as at the moment you can't tell the distance of the fog and how fast it moves in. For instance Imagine that i want the fog a more far away but there i want it to turn on really fast...


  5. NicholasFrancis


    Apr 8, 2005
    The main problem with custom fog modes are that they don't map to OpenGL. All Unity shaders use the OpenGL fixed-function pipeline for vertex lighting, so we're really stuck with that.

    OpenGL DOES have a linear fog mode - the thing is that if we do that, then all fragment programs have to exist in twice as many variations. Each shader already has 5 (IIRC) different fragment programs, so adding linear fog would make this go up to 10. Multiply by the number of builtin shaders, and you can see what we're looking at. And yes - this does increase download size quite a bit.

    If you want custom fog, make special-cased vertex programs. You can decide 'I only use this shader' - we can't