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

How to make scene editor fully lit when using 2d lights ?

Discussion in '2D' started by katinas15, Nov 16, 2019.

  1. katinas15

    katinas15

    Joined:
    Aug 18, 2019
    Posts:
    8
    Hello, I have trouble figuring out how can I make my scene editor fully lit. upload_2019-11-16_15-42-13.png
    My editor looks like this. I would like to see everything in the scene editor, but when I run the game, I want it to be like it is shown in the picture. I can make a global light (which lights the whole scene editor), then turn it off with a script when I run the game, but that not a great solution. Is there another way to make the scene editor fully lit ? (like before, without using 2d lights)

    Thank you.
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Hi @katinas15

    Does clicking the "sun" icon next to "2D" button in Scene view top bar help?

    I'm not sure if it works with the new sprite lighting features (haven't used those).

    It toggles on/off scene lighting, but like I said, it might not work with 2d lights.
     
  3. katinas15

    katinas15

    Joined:
    Aug 18, 2019
    Posts:
    8
    @eses this doesnt seem to work. Nothing changes
     
  4. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Hi @katinas15

    Yeah... I sort of expected that, then I don't have any ideas...
     
  5. APSchmidtOfOld

    APSchmidtOfOld

    Joined:
    Aug 8, 2016
    Posts:
    4,473
    I'm not using 2D lights but that's what I'm doing in my game; it doesn't seem that there is another solution.

    By the way, where do you find 2D lights?
     
  6. katinas15

    katinas15

    Joined:
    Aug 18, 2019
    Posts:
    8
    @APSchmidt I am using new Unity Lightweight Render Pipeline (LWRP), downloaded from Unity package manager.
     
    APSchmidtOfOld likes this.
  7. APSchmidtOfOld

    APSchmidtOfOld

    Joined:
    Aug 8, 2016
    Posts:
    4,473
    Thank you! :)

    Oh, I just remember how to get your scene fully lit: disable the toggle fog and the rest tool.

    Sans-titre-3.jpg
     
  8. katinas15

    katinas15

    Joined:
    Aug 18, 2019
    Posts:
    8
    Strange... It doesn't do anything for me
     
  9. APSchmidtOfOld

    APSchmidtOfOld

    Joined:
    Aug 8, 2016
    Posts:
    4,473
    I took a closer look at your screen capture and it appears that that tool is already disabled. I'm out of ideas...
     
  10. katinas15

    katinas15

    Joined:
    Aug 18, 2019
    Posts:
    8
    Thanks for the help anyways
     
  11. vakabaka

    vakabaka

    Joined:
    Jul 21, 2014
    Posts:
    1,153
    add global light and enable disable it :D //ah, I see, you have tried it
    or maybe window - rendering - lighting setting and change environment lighting

    I know, both are stupid solution :(
     
  12. katinas15

    katinas15

    Joined:
    Aug 18, 2019
    Posts:
    8
    Well... this isn't anything serious, so I guess I will keep using the global light. Maybe this was overlooked by Unity themselves.
     
  13. APSchmidtOfOld

    APSchmidtOfOld

    Joined:
    Aug 8, 2016
    Posts:
    4,473
    Okay, let's try something else. The reason why disabling that tool I mentioned is working for me is because I have a skybox material and a light source added in the Lighting settings. Maybe you could try that. I'm not sure it will work though because all my sprites have normal maps; they can be lit by 3D lights.
     
  14. NickVst

    NickVst

    Joined:
    Feb 17, 2017
    Posts:
    25
    Currently having the same issue, although I did come across something that alleviates the problem somewhat.

    In your Project Settings > Editor, there's a field for Prefab Editing Environment. You could set up a scene that only holds a global light, and then apply that as the scene for editing prefabs. This way you can edit those without a hassle, and just have a debug global light in your scene.

    I would love to see a more elegant solution though; preferably just the button designated for it working ;)
     
  15. APSchmidtOfOld

    APSchmidtOfOld

    Joined:
    Aug 8, 2016
    Posts:
    4,473
    That button was originally made for 3D scenes, not for 2D since 2D scenes didn't have lighting back then. ;)

    I've tried setting a default scene for the Prefab Editing Environment but either I don't understand how to set it or it doesn't work. :(
     
  16. NickVst

    NickVst

    Joined:
    Feb 17, 2017
    Posts:
    25
    That's odd. Does the following flow work for you?

    1. Create a new scene (call it "scn_Prefab" for clarity).
    2. Remove the camera from the scene.
    3. Add a global light to the scene ( Light > 2D > Global Light 2D (Experimental) ).
    4. Go to the project settings and set the Regular Environment field to scn_Prefab.
    5. Open up a prefab that is using LWRP sprites.

    The sprites in my prefab are now lit properly.

    The only issue I'm facing with this solution is that if I disable anything in the prefab scene, it's not disabled when editing prefabs. It does not affect the final game, but if you want to edit a prefab without the light enabled, you would have to either remove it from the scene or disable the prefab scene itself again. Nevermind, this works now.
     
  17. APSchmidtOfOld

    APSchmidtOfOld

    Joined:
    Aug 8, 2016
    Posts:
    4,473
    Ah, I'm not using that package, not until it's out of its "experimental" stage. Thanks for the explanation, people coming here will find it useful. :)