Search Unity

Different lighting in game view than scene view.

Discussion in 'Editor & General Support' started by Enzign, Oct 2, 2010.

  1. Enzign

    Enzign

    Joined:
    Aug 20, 2010
    Posts:
    169
    Hi everyone,
    I'm working on my first game and have a very annoying problem with lighting. The lighting in my Gameview doesn't look anything like what i setup in my Sceneview. I am using a directional light only, and i have the ambient light set to all black. Posting two pictures so you can see the difference.
    Anyone have any ideas what could cause this? I've been at it for hours. :)
     

    Attached Files:

  2. dingben

    dingben

    Joined:
    May 23, 2010
    Posts:
    45
    that has to be simple...
    directional light being moved closer, farther(z) at runtime? (even when you think not)
    any of the parameters such as intensity affected in your scripts.? (even when you think not)
    a transluscent object is being enabled between the cam and the view at runtime?.
    light at a marginal distance/intensity/etc... that computes out of range at runtime?
    lightmap problem?
    ...if I think of more checks, I will edit this post
     
  3. windexglow

    windexglow

    Joined:
    Jun 18, 2010
    Posts:
    378
    Check the edit - Project/Settings area. Looks like yours has more graphic effects enabled, which the editor may be (for optimization sake) not have enabled.
     
  4. oblivionfeet

    oblivionfeet

    Joined:
    Jul 24, 2010
    Posts:
    481
    Got lightmaps? It's possible you've accidentally switched your camera to forward rendering while your project (and therefore your scene view) might be set to deferred, or the other way around. So the look of things will be different due to the forward rendering limitations in U3.

    Or did you turn off the scene lights in your scene view (most likely the cause of it now I think about it), though it's hard to say as you cropped the title bar of the scene view), which would give you the default lighting in that view and scene lighting in your game camera view.
     
    HadiLexPanda likes this.
  5. Enzign

    Enzign

    Joined:
    Aug 20, 2010
    Posts:
    169
    Hi guys.
    Lots of thanks for all the suggestions. I will go through them all and see what i can find. I'll report back shortly.
     
  6. Naison

    Naison

    Joined:
    Feb 21, 2010
    Posts:
    386
    Joakim this is a really easy suggestion but none the less maybe it will help you,

    unity has default lighting in a scene at all times if you look in your scene window there is a light bulb icon that lets you toggle unity's built in lighting is it possible that you just have been making your scene with built in lighting turned on, and then when you test it your directional light becomes active?
     
    sway4labs likes this.
  7. Enzign

    Enzign

    Joined:
    Aug 20, 2010
    Posts:
    169
    If i select my main camera and watch the preview window when i play the game in the editor. There is quite a difference. Could it be that the camera preview shows the scene with builtin lighting even though i have scene lighting turned off? I have not been using the scene default light. It looks like the camera preview window might though, since that never changes when i turn the light on and off.
    Even if i turn my directional light off i have this difference.
    I also tried changing my project graphics settings between fastest and fantastik, but no difference there.
    I tried the different rendering methods and got terrible picture with one of them, but otherwise it was the same.
     
  8. Enzign

    Enzign

    Joined:
    Aug 20, 2010
    Posts:
    169
    Hmm...seems like i had the scene light all backwards. It needs to be on in the scene to show what will be rendered of course. However that doesn't really make a difference for me though. It seems like white isn't white, but some light grey, once the game runs. When i just show the game window it looks the same as the scene. But as soon as i press play, it seems like when i make things whiter, they just end up light grey for some reason.
     
  9. Enzign

    Enzign

    Joined:
    Aug 20, 2010
    Posts:
    169
    I found the problem. It seems to be my GUI background that causes this. When i remove the GUI background it looks like it should. Thanks for your help everyone. A lot of new information that i will have use for in my development.
     
  10. MihaMarn

    MihaMarn

    Joined:
    Nov 6, 2017
    Posts:
    15
    I have a similar problem in editor. When playing just this scene it is fine, hwen i build the app, it's also fine, but when I enter this scene from another scene in editor , the lighting is all dark. Checked light settings , they are unchanged. Checked cam settings, are also unchanged. When I come to this scene frpm editor/mainscene:

    upload_2018-5-4_10-52-24.png

    and when i pres play in editor directly in this scene or in win build:
    upload_2018-5-4_10-55-23.png
     
  11. robin_pcity

    robin_pcity

    Joined:
    Jun 26, 2020
    Posts:
    28
    Were you able to fix it?
     
  12. jasonrobertnelson

    jasonrobertnelson

    Joined:
    Feb 2, 2021
    Posts:
    5
    Were you able to fix this? I have a similar issue, whenever I turn on my GUI camera, the lighting in my scene becomes all washed out. Tried turning off basically every thing in the custom frame settings for the camera... no luck yet.