Shadow catcher, possible ? Oo

Hey,

Nice job getting the basic shading to work. The technique above is viable but as you noticed will not scale all that well with lots of dynamic objects and lights.

I am not sure why just capturing the render target dynamically was not updating and you had to set material again. Seems like it could just be a bug with the blueprint setup, unless you are relying on some secondary shader pass to convert the depth map to the black/white shadowmap result. I think in my post I was always keeping it as a depth map so it would work live in any material without any updates.

I highly recommend you take a look at the new Composure sample in the Epic Launcher. There is an example of a shadow catcher setup in there using proper lights. It is using the composure plugin but I also helped another person set up a shadowcatcher a few days ago without composure.

The gist of the more ‘robust’ way to do this is to instead use a white flood mesh and set that mesh to be only visible to a Scene Capture. he scene capture can be pointed down at the ground orthographically. Then you set any shadow casters to ‘cast hidden shadow’. Then you can hide them and the shadow will render onto the white shadow catcher ground.

The trick is making the shadow catcher ground not render in the main view. Technically it should be possible via the ‘owner only see’ flag, but that wasn’t working recently. So instead I just did something a bit hacky that checked if the camera vector was straight down (ie dot(CameraVector, 0,01) and check abs value), and collapsed the shadowcatcher in the vertex shader by adding negative worldposition.

Its also possible to handle that visibility problem more gracefully by manually hiding the shadow catcher every frame, then unhiding it just before the scene capture updates and then re-hiding it.