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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[Solved]Light inside and outside

Discussion in 'Editor & General Support' started by stigmamax, May 21, 2015.

  1. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    231
    Hello,
    I have a scene with a very dark ambiance (desired) inside with Point Light. There are openings where you can see a very bright outdoor lighting with a directional Light (sun). it works well with the layer system

    Only it does not work at all once compiled! It is as if the outside light illuminated the interior.

    How to remedy the problem?
    Thank you in advance

    Good :


    Bad :
     
  2. Findus

    Findus

    Joined:
    Jun 23, 2012
    Posts:
    111
    Are you sure that's the outside light? Looks pretty flat to me. Like some self-illumination, ambient, or perhaps gamma problem. Maybe lightprobes outside? But then you'd probably notice something before you compile.
    Did you try to turn off the sun for a test?
     
  3. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    231
    it's the same if I turn off the sun. Here is a screen of Lighting window. I have nothing changed in this window.
    When I open Unity, the lighting is still too strong. It becomes normal when I run the scene.
     
  4. Findus

    Findus

    Joined:
    Jun 23, 2012
    Posts:
    111
    Quite frankly I have no idea what's happening, here. Especially when it comes to builds for specific platforms, my knowledge ends.

    Here's what I would do, though:
    I'd turn off or down anything you don't actually use. Realtime GI, Baked GI, Fog, Ambient Intensity, reflection intensity etc. and check if it changes anything. Maybe Unity is looking for relevant data and substitutes it by something else or a default value if it doesn't find anything.

    Be sure Unity builds the new lighting after your changes and don't forget to save scene and project afterwards, so the data is stored.
    (Maybe try to turn off Continuous Baking and build and reset the data manually. )
    Even if realtime and baked GI are turned off, Unity will bake reflection and lightprobes.
    (Unity has a hidden reflection probe by default. Since it only reflects the sky, turning its reflection intensity down should put that out of the picture. You can add reflection probes of your own for finer control. )

    Check if your light is set to realtime. (Unless you want to bake it. )

    Delete any lightprobes present, or if there are none, bake some black ones, or perhaps uncheck the little box that tells realtime objects to use lightprobes for some prominent object, in order to check if that makes a difference (Assuming your scene objects are set to non static, right now )

    Check if the Quality and Player settings for your build are the same as when you run the game from the editor.

    Did you ever wait for a while when running the game? Maybe it takes some time preparing stuff.

    If you use batching, try to turn that off for a test, perhaps.
     
  5. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    231
    I deleted all the lights and it's the same thing. Is it that these values are correct?
     
  6. Findus

    Findus

    Joined:
    Jun 23, 2012
    Posts:
    111
    There is no correct or false, here, at least for the setting I know about. That all depends on what you want to do. For each of those check boxes you should have a rough idea of what they do and decide accordingly and if it's a bug then correct settings don't help either.
    E.g. Forward and gamma looks ok for a game with few lightsources that's supposed to run on all kinds of mobiles. (I would have guessed the other way is more prone to error, having deferred and linear, here, and some target device not being able to run that. ) But you could still try to change that for a test and you could try deactivating DX11 and batching, but it's a complete shot in the dark and my money would be more on some of the things I mentioned in the previous post. (Not sure if you tried everything, but turning off the lights alone is not necessarily enough. )
    Unless you're lucky and someone knows what exactly is going on or has the same problem you'll have to figure it out on your own, I'm afraid. Replace your shaders etc.
     
  7. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    231
    I'll look again. Thank you for your answers.
     
  8. stigmamax

    stigmamax

    Joined:
    Jun 30, 2014
    Posts:
    231
    It's solved. I fixed Ambiant Source on Gradient and Reflexion Source On Custom.
    thank you all for your help