Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug Custom shadow angle for spot light having wrong wrap mode

Discussion in 'High Definition Render Pipeline' started by Ruchir, Jul 12, 2021.

  1. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    When using custom shadow angle for spotLight I think the wrap mode for shadow texture is set to clamp, as you can see the shadow map get stretched over all of the illuminated are which looks really bad.
    upload_2021-7-12_19-43-55.png

    upload_2021-7-12_19-44-22.png
    Normal:
    upload_2021-7-12_19-46-17.png

    upload_2021-7-12_19-45-47.png

    Also, it only happens on two sides of the shadow map, other sides stay the same.
     
  2. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Although this could be beneficial in some cases like if there's a wall or large object we know would be casting a shadow all along the area but we just want dynamic shadows to be limited to a small area in middle.
    upload_2021-7-12_23-28-9.png

    In the picture, you can see that if the object is above the shadow casting plane then it's illuminated properly but the ground is shadowed.

    So maybe you could provide this as an enum between different wrap modes (if it's related to that) and change the default to not stretch the shadow :)
     
  3. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    Any updates on this?
     
  4. antoinel_unity

    antoinel_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    270
    Ruchir likes this.