Search Unity

Question Video Player -> Transparent Background -> Shadows

Discussion in 'Shader Graph' started by RomJu, Oct 14, 2021.

  1. RomJu

    RomJu

    Joined:
    Sep 25, 2018
    Posts:
    6
    Hello everyone !

    Okay so this a really tricky one and I don't even know if it possible.
    Basically I've working on this fro a week now not finding any viable solution :

    I have a video player in my Unity AR URP project. This player is playing a video with transparent background (the black is removed). What I want to achieve is, for example of a person is dancing in the video, to cast shadows of the person on the floor.
    I know how to remove the background. I know how to cast shadows. But with URP even a transparent surface is cast as a 100% opaque texture, so basically my shadows are always squared because the VIDEO FRAME is casting shadows, not the person in it.

    I hope I made myself understood.
    Thanks !
     
  2. Sinterklaas

    Sinterklaas

    Joined:
    Jun 6, 2018
    Posts:
    93
    I think that using alpha clip will fix this problem. It can be enabled in the graph inspector. This causes pixels below a certain alpha treshold to be discarded, which I believe will also prevent them from casting shadows.