Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Lighting Modes in 5.6 Beta 2

Discussion in '5.6 Beta' started by smcclelland, Dec 21, 2016.

  1. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    Thanks @fguinier -- to answer your question, yes I'm in forward rendering, single-pass. Like I say it seems to work fine in the editor but crashes when I build.

    Additionally I'm baking two sets of lightmaps for a day / night cycle, so there is custom code that assigns the correct lightmaps at the start of the scene. I tested by completely disabling that custom code, and left the single important light still active and the scene still crashed exactly the same, so I'm fairly certain it's not from my code.

    This week, I'll try to create a simple scene that recreates the issue.

    // WildStyle
     
  2. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,327
    Guys, stop dodging the specular directional question - As an exercise, try to recreate this https://80.lv/articles/using-quixel-2-0-with-unity-5/ without it.
     
  3. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    There was a response on another thread, not sure if you've seen it?
    https://forum.unity3d.com/threads/progressive-lightmapper-in-5-6-beta-6.454362/page-2#post-2994212

    Doesn't really solve the issue right now though for me, particularly as SSR does not support forward and is performance heavy?

    https://github.com/Unity-Technologies/PostProcessing/wiki#screen-space-reflection

    "Please note that this effect is currently very heavy performance-wise and has a few quality issues. We're currently in the process of re-working it from scratch.

    SSR requires the use of the Deferred rendering path."


    // WildStyle
     
  4. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hi WildStyle,

    Reading again, I see that you are using a single pass forward renderer. Unity default forward loop is multi pass when using important/pixel light while vertex level light are handled single pass style. Seems that the problem is thus about the support of pixel-level mixed light in a custom single pass renderer.

    These tests can then help to narrow the problem:
    - Identify if it happens on lightmap static object or on dynamics object or both.
    - Identify if it happens in all mixed mode or only in some mode.

    Reasons/background story:
    *BakedIndirect mode only uses lightmap and light probe.
    *Shadowmask/DistanceShadowmask use lightmap / light probes + shadowmask / baked occlusion in light probes
    *Subtractive uses lightmap / light probes + baked occlusion in light probes

    * Regarding baked occlusion in the unity multipass fwd implementation :
    - For lightmap static objects: shadowmask are fetched in *UnitySampleBakedOcclusion()* itself using *uniform float4 unity_OcclusionMaskSelector* based on the current light.
    - For dynamic objects: baked occlusion from probe is handled CPU side by attenuating the light color based on the current light and object being renderer.

    I dunno how GI is handled in the case of your single pass forward renderer, however because we are speaking of a crash and thus of CPU. My guess would be to look at dynamic objects + pixel light and see if they actually trigger an extra pass. Maybe baked info from light probes are invalid (as you are probably storing these info differently for your single pass renderer) and Unity can't scope with that (it should however !)

    Hope it helps

    Florent
     
    WildStyle69 likes this.
  5. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    318
    Good feedback, info and troubleshooting tips. I'll look into things further and let you know my findings.

    *edit* - confirming that things work correctly in forward when using multi-pass, so your're definitely on the right track with your deduction work so far.

    Thanks!

    // WildStyle
     
    Last edited: Mar 29, 2017