#I m trying to do the raycast method now
1 messages · Page 1 of 1 (latest)
You probably can't....exactly. All you can do is intersect the scene via the depth buffer, and for each light look up into the shadow map and find out what the intersection point was. Anything longer than that value, from the light, is in shadow for some reason that you cannot tell. That's because the shadow map was drawn from the light's view as a depth buffer (see that link I posted for you that talks about that).
That's not all that different than screen space shadows. You could look up URP's screen space shadows features/shaders for source code.
All this is incomplete, basically, in that you don't really have full scene data. You have the view's depth buffers and the light's depth buffers as shadow maps. But you don't have real geometry data anymore, unless you want to actually upload a bunch of geometry data into some sort of compute buffer and then do intersections from that, but that would be incredibly slow. It's often done in ray tracing, but it's not really a real time thing unless you're using RTX type of features.