I want to perform some effects only on the shadowed areas of the scene.
Is there any way to access the shadows texture of the scene?
I want to perform some effects only on the shadowed areas of the scene.
Is there any way to access the shadows texture of the scene?
It's not that there is anything such as a shadows texture, necessarily. I think your understanding of 3D graphics may be a bit confused, but resolving that goes far beyond simply providing a solution to your use case.
There are 3 ways that you can really create shadows:
How are you creating your shadows?
The general solution might be to author an image effect (Pro Only) which will detect shadowed areas based on some computation of what you see as shadowed. This depends on what you would define as shadowed and is quite subjective to your use case. One way could be to use the overall intensity of each pixel in the image for example.
If you are letting the renderer do your shadows, to apply effects to the shadowed areas, you could author a shader which computes the lighting component and performs your effect based on the value. You might consider doing this as a separate render with shader replacement.
If you are using projected shadows, then you could consider doing changes to your cookie or light. A shader solution above might also work. Anything more complex might generally require a second render pass and manipulation of a renderTexture (Pro Only) to get the pixels being hit by your shadow.
If you have baked shadows, you could apply effects to the textures in some script since they are just assets. You could also generally write a shader which gets the shadowed values from the texture or baked lighting texture and applies some effect based on that, but that's more expensive and needless when you could do the work in advance with a script you run in the editor beforehand. If your shadows are baked into your actual texture, depending on your effects, you could apply them directly to the texture where it is shadowed outside of Unity.
Some of this also depends on what kind of effects you are trying to accomplish. If they are just simple visual effects which change the surface's appearance with respect to lighting, you can generally achieve this with shaders. One shader which use to be used in case 1. and 2. was this desaturate darks shader, but it hasn't been updated for Unity 3 and would probably require some tweaking if not a full re-write into a surface shader. It works by getting the lighting component and applying some changes based on this value.