Community Tutorial: Shadow catcher Render pass

hey,

I’ve been looking for a Shadow catcher as a Movie render layer, and I think I figured it out. Please let me know if it works or if you have a better solution.

  1. make a Post Process material (see shadow catcher image)
    This material takes the scene lighting (postproces00) and subtracts the Diffuse. Both are desaturated.
    Lerp this with Black…you can do white and reverse the subtraction, but I think this works better as you get a cleaner image.
    The alpha takes any object that has the Custom Depth turned on.
    This material is then added as a PostProcess Deferred rendering output.

This will give you a Black image with White shadows on any object that has the Custom Depth turned on. If it’s turned off then will be Black.

Enjoy.

https://dev.epicgames.com/community/learning/tutorials/ByW6/unreal-engine-shadow-catcher-render-pass

5 Likes

incredibly helpful, thank you!

Hello,

Firstly, thanks for sharing this.

I followed this as best as I could.

Made the post process material as seen in your image, assigned it to the post process volume as a post process material, ticked custom depth on all meshes that are casting/recieving shadows.

Do I need to also assign the material to all those meshes?

Feel like I am missing something here if any help could be provided.

hey SamGeeee,

you shouldn’t need to assign a material to the objects as it’s a post process. You will want the ground to have custom depth turned off and the “objects/ shadow casters” to have it on…or vice versa.

You will want this setup as a deferred render pass, that way its doesn’t effect the Beauty layer.

Let me know if its still not working for you…its definitely a hack.

Hi Nick. I’m curious about this post. I have a scenario where I have an alembic geometry cache import of a character which I’ve imported to Unreal from Blender. I’m using UNREAL for a forest environment with the character walking through the forest.
For other reasons, I do not want to deal with the materials and shader differences between Blender and Unreal, so I’ve elected to use cryptomatte masks and composite the plate EXR’s from UE with the masks and EXR output of the characters from Blender in Davinci Resolve.

What I need to happen is for the forest tree shadows to fall on the alembic objects in UE (they do), but isolate those shadows in a MRQ pass somehow and add that “shadow pass” to the final compositing step. The alembic cache in UE can be ANY material that would support a “shadow catcher”, because I’m going to overlay it in the DR compositing step anyway.

Is your trick appropriate for this scenario? SImce even UE 5.1 does NOT seem to have a simple shadow catcher pass, I’m looking for something like this.

Super helpful, thanks @NickLAMR

Have been trying this technique using the Pathtracer and a post process on my camera to try composite the shadow pass, with my object above a backplate. For some reason, the actual shadow catcher plane seems to be captured too and not only thee shadow of the object.

Have you run into this issue before?

I’ve attached an example:

Hi , I faced the same issue and managed to find a way around it. Under the “SceneTexture:PostProcessInput0” node, try switching the Scene Texture ID to other PostProcessInput. Also, thanks @NickLAMR for the tips

This is great - thanks so much, @NickLAMR.

I’m having an issue with the renders not producing a contact shadow - just a cast shadow - is there a way to implement this?

Also, I’m only using an HDR to light the scene - no direct light or anything.

Thanks,

Matt

Hi there! First of all thank you for all the infos. Let’s say that I need to catch even colored shadow. How could I obtain that?

I´m searching for the MASK node but I cant find it on the nodes in UE 5…any suggestions?.. BTW I did put the material to my objects first and works like a black hole for the messhes asigned with this material,… but a realized that I need to just put as a render pass at the deferred option at the render queue XD

Hello there! I am using 5.1 and am trying to render a table with its shadow as well - or as two separate parts as long as I have the shadow. What is the 0.0.0.0 node in yellow in the image above. Does anyone know? Thank you any help is appreciated.

Hold “3” and left click anywhere one the material graph and it will create a contant 3 vector for you. you can also create a contant 4 vector by Holding “4” and left clicking anywhere on the material graph.

@NickLAMR nice tuts man! Really appriciate ur time and effort.
I hv an issue when i render the material with MRQ ( hv enabled it inside the deffered render passes ) the passes are empty when i open it in, what did i do wromg?

Hi all, this looks like it’s the solution to a problem that I’m facing, but is there an updated flow for this that will work within UE5.2? This seems like a simple material but having issues mapping your sample nodes to what’s available in UE5.2.

If there is a tutorial (or asset) someplace that someone could point me to that also covers this could someone please share?

God Bless You! Thx a lot!

  1. Maybe you know how to create refraction render pass material ?
  2. The second issue I faced gathering info for further composing is - my niagara effects in my case - fontains and waterfall - in object ID (cryptomatte) render pass look like white planes. Can I get visualy a crypto mask like idk a tree mask look like or not? thx in advance

Hie did you find a solution to the empty pass? cause I’m also facing the same issue, things on viewprt look good

Thank you for sharing your approach to creating a shadow catcher in your movie render layer. It sounds like you’ve come up with a clever solution using a Post Process material and Custom Depth. Your steps seem well thought out, and I appreciate you sharing this method.

I don’t see any immediate issues with your approach, and it’s great that you’ve explained the reasoning behind each step. Using a Post Process material to achieve the shadow catcher effect can be a practical way to control the appearance of shadows in your rendered scenes.

If you encounter any challenges or limitations with this method, or if you discover any optimizations or alternative techniques, please feel free to share your findings. It’s always valuable to learn from different approaches and experiences within the creative community.

Thank you again for sharing your solution, and I’m sure others in the community will find your insights helpful.

1 Like


Made some improvements to the shadow catcher pass. Added a node to applyx^(1/2.2) to apply inverse tonemapping to the PostPrcess0 image and a round node to make it 1/0 output since I wanted to use it as a mask.

not working


object material looks black

Hey thanks for the PPM. I was wondering if there is a way to get it to work in Pathtracer?