I am trying to create a shadow catcher setup that will only render the part of the object which above the shadow plane. For an object that is partially below the shadow plane, I want the final render to only contain the portion of the object which is above the plane and the shadow. All of the tutorials I have viewed render the entire object which only works for objects that are intended to be 100% above the surface. This doesn’t work for the case that you want an object embedded in the ground. For example, if you want to render a rock that is half buried in the ground with a shadow to place into a photograph.
Is this possible to do? I am thinking that it may be possible with render pass indexes used to mask what is below the plane. However, I can’t seemed to wrap my brain on how to make it work. Does anyone have a node setup example to do this?
Please use the appropriate support forums for support questions rather than just posting in the first forum you see.
Thread moved to Support / Compositing and Post Processing
You could create a shadow catcher setup (https://www.youtube.com/watch?v=99NTQUUGWUY), then use another object as a mask for the area you don’t want shadows. In compositing you could mask to all of the area except the object you rendered as a matte.
This sort of thing can be done with compositing, e.g using “Z-Depth” to exclude anything that is beyond the plane.
However, if a crashed spaceship is half-buried in the dirt, you really should make a duplicate of that spaceship model and rip-away all of the geometry that can’t be seen. Just like the sets that were used to film all those spaghetti Westerns, nothing that will not be seen on-camera should even exist, because otherwise the computer will consider it in its rendering calculations, and that wastes time. (The complete surfaces that are “sticking below the ground” will necessarily be completely present, but not one surface should even exist if that surface is completely buried.)
You can still use compositing techniques to efficiently bring the ground and the spaceship together, but you ruthlessly eliminate unnecessary calculations that otherwise would take place.