Search Unity

Simple Lighting Question or is it Broken

Discussion in 'Global Illumination' started by SuperUltraHyper, Mar 18, 2016.

  1. SuperUltraHyper

    SuperUltraHyper

    Joined:
    Sep 7, 2015
    Posts:
    112
    Very straight forward...
    I want to light my scene. I want to use baked lighting. I want the dynamic objects to match the baked lighting.

    How do I accomplish this.

    I have created a test scene with spheres and a ground plane.
    I have tried light probes, light culling lists, reflection probes, etc.

    In every scenario I have tried, the lighting between the real time and baked spheres doesn't match. In every instance the real time lit spheres are blown out and brighter than their counterpart baked spheres. Specifically, the light facing side of the real time lit spheres is pure white.

    Is there a way to get these spheres to match visually?

    Further more, Culling Masks / Layers seem to have no effect on light probes or dynamic objects using baked lights.

    It can't be this broken... what am I doing wrong?
     
  2. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    Set non-dynamic objects to Static and lights to Baked.

    Place some Light Probes via Light Probes Group. Make sure they're not overlapping/flush/inside anything static. Make sure they're in a 3d grid pattern and not flat.

    Bake. It should be that simple.

    There might have been some bugs with a version of 5.3. Try the 5.4 beta 10, or the latest version of 5.3. Check you're in Deferred/Linear mode in Project Settings > Player.
     
    Last edited: Mar 20, 2016
  3. SuperUltraHyper

    SuperUltraHyper

    Joined:
    Sep 7, 2015
    Posts:
    112
    Yeah... It should be that simple but it isn't.

    Did you try it? Have you actually seen this work in any build of Unity?

    The static and non static spheres are lit much differently...
    The only way I get the result I am looking for is if I make 2 scenes. In the first scene set lighting to be baked for baked objects and in the other scene set lighting to Realtime GI for dynamic objects. Then the lighting seems to match... With the obvious problem that the objects are in separate scenes. (The scenes can't be merged in the editor either... already tried it.)

    You would think the Mixed Mode lights are specifically for this but it just blows out the lighting on dynamic objects. What is mixed mode even for?
     
  4. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    I've use it every day almost. I tried two yellow spheres and they near-enough match in baked-only mode and also real-time precomputed mode.

    Obviously there are differences because one is only being lit only by sampled probes, but they are similar. They shouldn't be majorly different.

    Also, lightmapping a sphere isn't exactly recommended due to seams.
     
  5. Korno

    Korno

    Joined:
    Oct 26, 2014
    Posts:
    518
    Mixed mode is broken at the moment. It should bake for static objects but then light dynamic objects like a normal light (including casting shadows ont static objects) but it doesnt work at all. There are about 1000 posts about it.

    I do wonder when it will be fixed....
     
  6. SuperUltraHyper

    SuperUltraHyper

    Joined:
    Sep 7, 2015
    Posts:
    112
    @Stardog: I guess it depends on your game. For me, near-enough isn't enough... If I can possibly avoid it.

    @Krono: Guess that would explain it. Thanks for the info.