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

Directional light assumes a horizon

Discussion in 'High Definition Render Pipeline' started by Loden_Heathen, Jul 3, 2021.

  1. Loden_Heathen


    Sep 1, 2012
    Unless I am just missing something obvious it seems that the directional light assumes a horizon at 0 x rotation and distorts and eventually clips the light at 0 on the x axis rotaiton.

    This makes the directional light usless for cases where there is no horizon e.g. space games

    So what am I missing?

    If this really is the case what is the expected use case for a space game?

    [Edit 1]
    So the issue seems to be the fog system ... which is a real shame the volumetric fog gives a nice effect even for a space game but it seems to assume a horizon
  2. SebLazyWizard


    Jun 15, 2018
    The fog is an exponential height fog that is designed to work in a planet like scenario (and that planet is treated as a totally flat surface).
    So the normal fog isn't suitable for a space scene anyway, instead you should use a local density volume as fog.

    However I also got annoyed by the light-dimming behavior of the fog as it doesn't match the round planet of the PBSky, luckily there's a "hidden" option to skip the light-dimming.

    You have to install the HDRP Configuration Editable Package, then locate to ...YourProjectPath\LocalPackages\com.unity.render-pipelines.high-definition-config\Runtime, open up ShaderConfig.cs.hlsl and add #define LIGHT_EVALUATION_NO_HEIGHT_FOG to it.
  3. Loden_Heathen


    Sep 1, 2012
    Thanks for the reply

    and ya finding the fog very anoying to work with even in a more traditional terestrial scene

    As to the local density volume
    What are you using in that case to control the density of lighting?

    The visual effect we want to get is a slight haze similar to a volumetric cloud to express the dust such as from a battle
    We had thought ah Unity HDRP now with volumetric light/fog but so far exceedingly unimpressed compres to existing tools where it was a simply matter of droping in a volume and dialing in the desired settings. Does Unity's HDRP not have anything that strait forward?

    Found documentaiton on it

    Have not fouund why I cant find it in our project ...

    [EDIT 2]
    Updating HDRP from 10.5 to 10.5.1 made the option appear

    [EDIT 3]
    We have toyed around with it and your tip has let us get close. Saddly its still no where near as usable as say Aura 2 in terms of easy flexable control over volumes.

    Would be nice to see more controls for the volume density objects but its a suitable workaround for now I suppose.
    Last edited: Jul 4, 2021