Search Unity

LWRP Baked lighting inconsistent or incorrect vs (old) Standard Render Pipeline.

Discussion in 'Universal Render Pipeline' started by PieterAlbers, Nov 10, 2019.

  1. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    246
    Hi all,

    For an internal prototype we recently started working with the LWRP.

    We're aiming for having as much static object as possible - all lightmapped - and the dynamic objects be lit by light probes.

    I have done lightbaking before - but I am noticing some odd differences between the 'old way' and the 'new way'. I am unsure if it is an issue/bug or that I am approaching it incorrect with the LWRP.

    Below are two screenshots from a sample scene. The plane, cylinder and green sphere are all static objects.
    The other sphere is dynamic. The plane & cylinder share the same material. The spheres both have unique materials. The green sphere's material has a green emissive color set to 1.5. You can see the lighting settings in the lighting tab. There is no active light in the scene.

    I am using the latest LWRP version. Color space is set to gamma for both versions.

    The lightprobes are 9 default (right click > Light > Light Probe Group) created Light Probe groups set in a 3x3 grid.

    The first one is baked in 2018.4.0. All materials use the Standard shader.
    The second one is baked in 2019.2.10. All materials use the LWRP Lit shader.




    The difference is striking and totally incorrect as far as I can tell.
    I have been looking at open issues and everything else but I can find but nothing I can use.

    What is going on? Are these the differences to expect when using the LWRP? Or is this an open/non-resolved issue?

    I have tried different materials for the LWRP version (Simple Lit, Baked Lit, Shader grap unlit with GI) but it stays similar to the image shown.

    I was expecting some differences between the two but nothing like this. Currently this is not usable.

    Furthermore I am seeing some incorrect lightprobe behaviour for the dynamic sphere in 2019.2.10.
    As the color is incorrect I can't see if this issue is the editor only displaying the incorrect lightprobe references or that it is indeed using the incorrect lightprobes. See image below.



    Anyone experiencing this as well? What am I missing?

    -Pieter
     
  2. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    246
    Quick update on this. I started completely afresh in a new project in 2019.2.10 and now the scene looks nearly identical to the one in 2018.4.

    I was testing it in a converted project - I am now looking into what is causing the differences.
     
  3. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    246
    The issues is related to the color space set to Gamma in 2019.2.10 - which is unfortunate.

    The test scene - made in a clean project on 2018.4 - shows no difference when either baking the scene in Gamma or Linear. Unfortunately these differences do exist in 2019.

    I understand Linear color space is the preferred way to go, but as a mobile and web developer we are not yet 100% convinced to let go of opengl es 2. We're still talking about 20% of all android devices in large markets and Safari and Edge as browsers - although we are aware that those usage percentages are low and Edge will switch to Chromium.

    Nevertheless, this kind of a bummer. So we either need to stick to linear or revert to the old render pipeline.

    Or maybe it is still a bug?
     
  4. berridge

    berridge

    Joined:
    Dec 17, 2018
    Posts:
    9
  5. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    246
    I haven't gone back to older Unity versions yet. I am already running half a dozen versions atm ;)
    I did create a bugreport on this - as I can't believe this is expected behaviour.
     
    berridge likes this.
  6. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    246
    Running into the same issue on 2019.3.0b10.
    Haven't heard anything on my bug report yet.
     
  7. liiir1985

    liiir1985

    Joined:
    Jul 30, 2014
    Posts:
    147
    it looks to me is just missing tonemapping after switching to hdr. Maybe you can check the high quality lightmap encoding setting in the player setting and other hdr related settings? it doesn't look like bug to me.
    And if you want to make use of PBR, then you'll need to convert your project to linear color space, otherwise you won't get correct rendering result. If you don't need pbr and hdr then you are safe to stay with gamma color space
     
  8. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    246
    I already tried any lightmap & hdr related settings to no avail. And unfortunately it does look like a bug - this used to work just fine in 2018 and there have been no conceptual changes to the way PBR works. There is simply something either missing or incorrectly applied. See berridge thread for more detail as well
     
  9. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    246
    I got a reply on my bug report yesterday - which I had to confirm today because I was simply stunned.

    Baking GI on LWRP with Gamma Color space is not supported.
    And will not be addressed on a short term - if at all.

    Kinda bums me out tbh.
     
  10. berridge

    berridge

    Joined:
    Dec 17, 2018
    Posts:
    9
    wow... so the "lightweight" pipeline won't support lightweight solutions for older mobiles and current WebGL graphic API's??
    Disappointing to be honest.
     
  11. PieterAlbers

    PieterAlbers

    Joined:
    Dec 2, 2014
    Posts:
    246
    I still find it hard to believe. We do quite a bit of WebGL and mobile stuff which can be impacted by this.

    In the end it will either mean going back to the Standard Render pipeline for as long as that is supported, not use lightmaps and probes under LWRP or cut off everyone with opengl es 2.0 - which are still quite a few...