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

Problems with surface shaders, baked & realtime lighting

Discussion in 'Shaders' started by Boris-S, Apr 1, 2016.

  1. Boris-S

    Boris-S

    Joined:
    Jan 23, 2013
    Posts:
    23
    I have:

    1) Simple scene with static geometry.
    2) Baked GI lighting (no realtime).
    3) Realtime directional light with shadows enabled; shadow strength is 1.

    This is what I see when use Standard shader - correct image:
    standard.JPG

    And this is what I see with any other shader (for example, Legacy Diffuse):
    legacy.JPG

    Why the shadow is so transparent? I have a lot of surface shaders in my project and all of them produce faint shadows like this one when use along with baked lighting.
     
  2. Boris-S

    Boris-S

    Joined:
    Jan 23, 2013
    Posts:
    23
    Nobody knows?

    Is there any way to use baked lighting and realtime shadows for all geometry (even static)? Like Mixed light mode, but for all geometry, not only non-static.

    Interesting, once I change light type to mixed, the shadow becomes correct (strong)!
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,209
    It's probably because Unity has put a lot of work into trying to get it working with the standard shader and the legacy shaders are essentially deprecated so they're not working on them apart from making sure they render something.
     
  4. Boris-S

    Boris-S

    Joined:
    Jan 23, 2013
    Posts:
    23
    Sounds like a true. But I already tried to create custom surface shader based on new Standard lighting model, and result is the same... It works only if built-in Standard shader is used. So what we all should do if we need custom shaders?

    Maybe my question in start post sounds strange for someone, so let's explain a bit.

    In fact, I am trying to use Realtime GI in my game (static and non-static objects). It works fine until I add any Baked type light to the scene. Once it added, shadows become almost invisible. Even for areas that are not affected by that light, and even if light has zero intensity... Moreover, this happens only if baked light has Point or Spot type, when the Directional type works! Then I created test scene with a cube and found that the problem do not associated with the Realtime GI. It just happens when I use baked lighting + realtime light.
     
    Last edited: Apr 4, 2016
  5. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,209
    Sounds like there's a bug. I know they've been pushing hard on getting real time lighting and baked lighting to interact better, especially with mixed mode lights, but it's plausible the standard shader and standard surface shaders don't match right now.

    I'd report it.
     
  6. Boris-S

    Boris-S

    Joined:
    Jan 23, 2013
    Posts:
    23
    Yes, exactly. This is the problem.

    Where? It would be really nice to monitor the situation...
     
  7. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,209
  8. Boris-S

    Boris-S

    Joined:
    Jan 23, 2013
    Posts:
    23