Search Unity

Feature Request URP ShadowCaster2D - Hollow shape

Discussion in 'Editor & General Support' started by CaptN_Coding, May 5, 2023.

  1. CaptN_Coding

    CaptN_Coding

    Joined:
    Nov 6, 2019
    Posts:
    4
    Hello,
    I've been struggling from months to automatically build shadowcaster from tilemap. Some partial solution exist (ex :
    ), but everyone has the same problem : We cannot have hollow shape.
    When we have a hole and a shadowcaster surrounding it, all lights within this hole are not emmitting because urp handle shadowcaster has "filled" and not hollow.

    As of today, i can't find a solution, since i need it to be able to generate and modify in real time (procedurally generated and modifiable tilemap).
    The best way to surround this problem is to manually make a new "hollow shape" shadowcaster from the filled shape of the shadowcaster, but it is very inefficient to do, especially in real time, and add many points on the shapes so fps drop accordingly.

    I would love to have the possibility to set a shadowcaster as "contour" and not "filled" so that lights inside it can work fine. I don't know if it is possible (maybe the algorithm calculating lights would be very inefficient this way) but if it is, it would be super duper cool for my project.
    Thanks in advance for your response,
    MM
     
    nonebits and fasteddy92 like this.