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

Requesting an update: ShadowCaster2D using sprite pixel data

Discussion in '2D Experimental Preview' started by CoraBlue, Oct 4, 2021.

  1. CoraBlue

    CoraBlue

    Joined:
    Nov 16, 2017
    Posts:
    60
    It's been about a year since the team acknowledged that there have been office discussions about this feature. Can we get an update? I've been a huge fan of these features since day one, but the lack of sprite support for shadows is starting to feel more and more conspicuous.

    We're sort of locked out of doing anything involving sprites with an animator on them which feels extremely weird for a 2D feature.

    EDIT: Just want to clarify I appreciate how few people are on the team and that the last year has been a nightmare of bugs changes to the 2D package. If this is firmly on the backburner right now, at least we'd know.
     
    Last edited: Oct 4, 2021
    NotaNaN likes this.
  2. Chris_Chu

    Chris_Chu

    Unity Technologies

    Joined:
    Apr 19, 2018
    Posts:
    257
    I agree with you on this. Unfortunately, there were a lot of other things that needed to be fixed first and shadows didn't get needed attention. I am, however, working on this very thing at the moment and hopefully, I'll be able to say more about this soon.
     
    NotaNaN likes this.
  3. CoraBlue

    CoraBlue

    Joined:
    Nov 16, 2017
    Posts:
    60
    Just knowing work is being done on this when there's time is a great news. Appreciate the communication and how diligently you check the forums. Soon! ;)
     
    NotaNaN and MelvMay like this.
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    If it helps, we're also working on support for all 2D colliders in the future too:

    Here's some in-development videos just for fun:


     
    NotaNaN likes this.
  5. CoraBlue

    CoraBlue

    Joined:
    Nov 16, 2017
    Posts:
    60
    Thank you for the secondary update! The video is great to see. I realize this is a work in progress, but if you could clear something up.

    In the past I've hacked together solutions that look like the above by accessing the ShadowCaster2D via reflection and settings the vertices to the collider outline/physics shape. The weight and the round objects are giving me some idea. Example of my code here.



    This is *super* handy. And I'm glad you're working on it. But per pixel data is a separate thing and also being worked on, yes? The reason I want to clarify is because physics shapes aren't practical for animated sprites or for very complex shapes (even though they'd be much less expensive).
     
    Last edited: Oct 5, 2021
    NotaNaN likes this.
  6. Saafris

    Saafris

    Joined:
    Nov 22, 2017
    Posts:
    5
    Hello! I just wanted to chime in and say I have been looking out for this since the last thread came up, so I greatly appreciate the small updates.

    My use case is essentially: I have to load all of my art assets from sprite sheets at runtime, and I would really love to have shadow casting. Unfortunately, it means that I can't hand define any colliders, and most of the auto-generated stuff will be unusable for sprites of any complexity.
    My only other option seems to be hand coding something that _might_ be able to intelligently create a path for the shadowcaster. I am not optimistic at my ability to do that.

    Thanks!
     
    NotaNaN likes this.