- Home /
Sampling Shadowmap in Post Processing Shader
I'm attempting to implement volumetric lighting as a post-processing effect, and I'm having issues sampling from a shadowmap. I've used a command buffer to create a global texture containing the shadowmap (taken from the scene's directional light). The texture is named "shadow", which I input to the shader as a sampler2D. This is what the texture looks like when sampled with screen coordinates (to show that it's working correctly):
However, when I use the function UNITY_SAMPLE_SHADOW (on line 68):
float shadowTerm = UNITY_SAMPLE_SHADOW(shadow, shadowCoord);
I am confronted with this error:
Shader error in 'Custom/PP': undeclared identifier 'samplershadow' at line 68 (on d3d11)
Does anyone know what this might mean, and how I can fix it? I need to have results by Wednesday, and this issue is severely hindering my progress. Thanks in advance for any help, and please ask if you need more information on the issue.