I'm writing a custom shader in unity 5 that requires a shadowmap (not just for drawing shadows but also for different computations involving scattering particles through fog). Does anybody know how to actually get the shadow map in unity rather than just using the fallback option? That is including the actual Z buffer not just the resulting 1's and 0's.
I could also use the depth buffer from the camera but that only appears to apply to camera used by the player rather than the second one I can add to replace the light (inside the light).