Access shadow buffer in material

Hello all;

Is it possible to sample shadow information in a material?

I baked two textures for an object - one ambiently lit, and one brightly lit. I’d like to blend between the two based on the shadow buffer, so emissive textures can still respond to shadows.

Does anyone have any suggestions on how to go about doing this?

Just simply put brightly lit to base color node and ambiently lit to emissive. Then it should work just like you want.

I was looking at custom shaders, custom depth maps, and all kinds of other over-engineered ideas, and hadn’t considered the simplest solution.

Many thanks :o