Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Add uniform Ambient Lighting?

Discussion in 'High Definition Render Pipeline' started by dgoyette, Jan 14, 2020.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,106
    I'm working on adding an option to turn off realtime lighting for low-performance machines. I was going to add simple baked lighting in all the scenes which I could turn on as needed, but I figured there must be a simpler way that didn't require baking. For this mode, I just want every pixel to be uniformly lit, no shadows, just like an omnidirectional directional light.

    I figured I could accomplish this with a skybox or a gradient sky. However, when I use either of those, applying white light, everything is just grey, with none of its actual color.

    Is there a different way to get uniform lighting in a scene for cases where I was high-performance, low-quality light?
     
  2. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    928
    Hi,
    > everything is just grey, with none of its actual color.
    I expect it is the exposure/tonemap that do this.
    If you want to have exactly your color, you must either use unlit (without any tonemap/exposure), or use only a directional or a sky with an intensity of PI.

    Lit material use Disney diffuse BRDF, but you can think of it like Lambert. The BRDF divide by PI, so providing a directional light with PI intensity (in lux) will give you your color. And use a fixed exposure a bit above 1 (we use EV100 for exposure and not a power of two).

    hope this help
     
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,106
    Thanks for the information. It really sounds like I should be approaching this from the shader side. I'm trying to create a super efficient, low-quality mode, for bad hardware, because even a bit of lighting causes significant framerate drops. But it sounds like I really just need to be able to swap my material for unlit materials, though I don't assume that will work for static objects at runtime. I was just trying to achieve the lowest-cost possible for "very low" settings. Your ideas have helped.
     

    Attached Files: