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

(Unity 5) Odd terrain details (grass) behavior on deferred, fine on legacy deferred. Any clues?

Discussion in 'General Graphics' started by kmoosmann, Mar 7, 2015.

  1. kmoosmann

    kmoosmann

    Joined:
    Mar 1, 2014
    Posts:
    22
    So I'm experiencing some odd light bleeding issues when light sources hit terrain details (like grass textures).
    I'm hitting this grass patch with a spotlight, like so:

    deferred_light_01.png

    However, when "standing" in front of that spotlight, the grass appears all washed out within the frustum of the light cone.

    deferred_light_02.png
    Which, as you can see - doesn't happen in "Legacy deferred".

    legacy_deferred_light_01.png

    I have no clue why that's happening. We're working on a rather large project and upgraded to Unity5 - this is one of the issues we can't seem to get our heads around though. Any ideas?

    Cheers,
    Kai
     
  2. RickyX

    RickyX

    Joined:
    Jan 16, 2013
    Posts:
    280
    Looks normal to me
     
  3. kmoosmann

    kmoosmann

    Joined:
    Mar 1, 2014
    Posts:
    22
    How is this normal? It's not a realistic behavior at all. I would say it would look normal if the light source was volumetric, but it's not.

    I think I know what's happening though. On deferred, it seems Unity also uses it's standard shader for grass patches. The smoothness on the standard shader is set to 50% by default - and I think that's exactly what I'm seeing here. Unfortunately, the grass material can't be accessed.
     
    theANMATOR2b likes this.
  4. theANMATOR2b

    theANMATOR2b

    Joined:
    Jul 12, 2014
    Posts:
    7,790
    Maybe Unity added volumetric lighting effect for free. It's a feature!

    Seriously though - was the theory you posted the issue?
    Did you find a solution to solve the problem?
     
  5. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    335
    The cause for such effect is the normal we use to render the 'grass quad' being rather inaccurate. The normal direction is taken directly from the terrain underneath. This way we can have more consistent shading between terrain and grass. Unfortunately this approach doesn't work well with standard deferred rendering. We will force grass to render in forward path in a later release.
     
  6. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Any chance that "force grass to render in forward path" is going to be patched in any time soon?
     
  7. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    335
    That would be 5.2.
     
  8. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Awesome! I was worried it got shelved. Thanks.
     
  9. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    335
    In the meantime, if you want to do this by yourself, you can simply add "exclude_path:deferred" to the built-in grass shaders. That's exactly what we did.