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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Realtime and baked light completely different in Unity editor and WebGL build

Discussion in 'Global Illumination' started by Wattosan, Jan 12, 2018.

  1. Wattosan

    Wattosan

    Joined:
    Mar 22, 2013
    Posts:
    450
    Hey,

    I encountered an issue where the lighting is completely different in Unity's editor and WebGL build. Windows build shows the same result as the Unity editor (so this is correct).

    Unity editor and windows:

    WebGL build:

    I also noticed that right before the light bake finishes in the editor, the game screen promptly (half a second) looks like the WebGL build, but then corrects itself. This also happens when opening the .exe windows build. As long as the game window stays unfocused, the lighting looks off. Focusing the window (clicking on it) fixes the issue.
    This can be seen in the following video:

    Using Unity 2017.2.0f3. The same problem occurs with Enlighten and Progressive. Does not matter if lights are realtime or baked. All lights are set to Important. No light or reflection probes are used. All lights used are point lights (no directional).

    Picture of light settings:

    EDIT 1: The bug exists when building on android as well. Will test iOS soon.

    Any helps is much appreciated!

    Thank you!
     
    Last edited: Jan 12, 2018
  2. jspivack

    jspivack

    Joined:
    Feb 21, 2018
    Posts:
    2
    Old thread, but did you ever figure out what was happening?
     
  3. Wattosan

    Wattosan

    Joined:
    Mar 22, 2013
    Posts:
    450
    No, sorry.
     
  4. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,886
    Those platforms don't support Realtime Global Illumination. You have to turn it off.

    Most of those platforms aren't powerful enough to run it, or lack some feature to support it. WebGL is powerful, but often lacks a single crucial feature in the API.

    The only way is to bake the indirect, and have realtime/mixed lights on top.