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

Bug UPR 12: terrain shader does not support shadows masks in deferred

Discussion in '2021.2 Beta' started by larsbertram1, Jul 25, 2021.

  1. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    the deferred pass just misses the pragmas but includes some older ones?

    this is from:
    https://github.com/Unity-Technologi...s.universal/Shaders/Terrain/TerrainLit.shader

    Pass
    {
    Name "GBuffer"
    Tags{"LightMode" = "UniversalGBuffer"}
    HLSLPROGRAM
    #pragma exclude_renderers gles
    #pragma target 3.0
    #pragma vertex SplatmapVert
    #pragma fragment SplatmapFragment
    #define _METALLICSPECGLOSSMAP 1
    #define _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A 1
    // -------------------------------------
    // Universal Pipeline keywords
    #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
    //#pragma multi_compile _ _ADDITIONAL_LIGHTS_VERTEX _ADDITIONAL_LIGHTS
    //#pragma multi_compile _ _ADDITIONAL_LIGHT_SHADOWS
    #pragma multi_compile_fragment _ _REFLECTION_PROBE_BLENDING
    #pragma multi_compile _ _SHADOWS_SOFT
    #pragma multi_compile _ _MIXED_LIGHTING_SUBTRACTIVE
    #pragma multi_compile_fragment _ _DBUFFER_MRT1 _DBUFFER_MRT2 _DBUFFER_MRT3
    #pragma multi_compile_fragment _ _LIGHT_LAYERS
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Hi @larsbertram1,

    Could you please submit a bug report for this issue, ideally with a minimal reproduction project?
     
  3. larsbertram1

    larsbertram1

    Joined:
    Oct 7, 2008
    Posts:
    6,901
    hi leonhard,

    thanks for coming back to me. unfotunately it turns out that shadowmasks in beta 5 are broken in forward and deferred.
    and not only on the terrain but also when it comes to the lit shader. although the lit shader looks a bit better.

    - terrain does not pick up the shadowmask at all but goes fully black
    - lit does - at least right after the transition from real time to shadowmasks
    - both drop shadows completely at a certain distance.
    - this happens in forward and deferred in beta 5 now

    bug filed (case 1354966)

    shadowmask.gif
     
  4. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Thanks a lot for the report and for bringing this up! We're looking into it.
     
  5. ArtyIF

    ArtyIF

    Joined:
    Oct 13, 2014
    Posts:
    36
    Using Linux. Works fine on OpenGL Core, but on Vulkan it has the same issue.