Only Shadows Material - Will it ever be implemented in Blender ?

I know we can get a shadows catcher with nodes…its not so hard… but having a material that does just that would be faster, like the old blender render had one…

just want to know if this a planned feature the way it has to be done now with nodes is the way is going to stay ?..

thanks

Since a shadow pass exists, i don’t think writing a shader that only receives the shadow is something very complex for a programmer. But I am not a programmer, so i don’t know.

An AOV pass that has only shadows is easy. A material that gets only shadows from other objects is not quite as simple in a path tracer. Shadowing in a path tracer is not a result of lights casting them onto objects, but rather an automatic effect of objects being in the way of lights. Meaning objects don’t “receive” shadows, shadows are more just a happy accident of the ray/path tracing algorithm. Creating a material that is only visible when there is another object between it and a light source is not entirely trivial to do, or it would already be done. There are other things to take into account, too (surface properties of shadow material, GI, etc.) Not that it’s impossible either, other’s have such a material, it’s just not been high on the list of priorities.

… and something else to consider along those same lines, m91, is that when you do need “shadows only,” an algorithm cheaper than ray-tracing might produce acceptable-enough shadows to composite into the shot, even if the lighting itself was done some other way.

Is this correct? No. Does it look like shadows look, well enuf to sell the shot? Yeah. Usually.

Also, once you know closely-enough where the shadows fall, and you’ve isolated them in the compositor, you can do other things with those areas – for example, add a small tint of light to them (RGB node to produce it, AlphaOver with the attenuated shadow information as a mask, etc.) and you have the plausible effect of that area receiving some indirect light from somewhere … say, blue-sky in yellow sunlight. Shadows, more than light, establish the effect of “this is 3D” (and so on …) to me. They’re also big consumers of computer-time, and too-many shadows (even though all of them are technically “correct”) can clutter-up a shot to me. (Backdrop walls, for instance.) You can even put a shadow-only spotlight to cast (just) a shadow precisely where you want it to fall, and suppress shadows from everything else. A cheaper form of lighting might do, if shadows are dealt with separately.

I agree completely, which is why I currently comp BI shadows onto Cycles renders when they’re needed.

A shadow catcher material would definitely be nice to have.

When I was working on the sIBL GUI addon I spent a fair amount of time trying to workout a Material only solution for a shadow catcher with Blender’s current tools but never really came up with one that worked

i don’t think writing a shader that only receives the shadow is something very complex for a programmer.
all renderers started with a matte option in them because it’s essential to fast workflow, i don’t see why it shouldn’t be a priority! instead of swapping render engines then compositing, you use one matte material.

also i’m surprised that there is no OSL shader that could do this that already been made at least, but hey: you can’t ask devs to develop something they don’t think its a necessity.

Jed, the setup you have in sIBL GUI is very effective, if somewhat limited. I found that node setup very handy and have used it in other places. it would be nice to have true shadows cast, but the AO only effect also works.

Thanks for that!

Would be awesome.

The problem with the ‘Shadows’ pass in Cycles is that it will still include shadows and shading that an object will cast onto itself, which is no good if you want to isolate the shadow cast onto terrain by ONLY a CHOSEN object without any shading or shadows cast by the terrain onto itself or from other objects.

So this is how I solve it; shadow catching in Cycles. It is a bit complicated but the time spent setting it up really pays off when rendering lots of frames.

Let’s say you have:

Layer 1:
A model of an undulating Terrain with a tall rock that extrudes up from the terrain resulting in a single mesh that casts a shadow onto itself. This is the main problem.

Layer 2:
A sphere that casts a shadow onto the terrain.

Layer 3:
A cube that casts a shadow onto the terrain

The end result we want, is for ONLY the shadow cast by the sphere onto the terrain to be seen, with all its graduating transparency, completely surrounded by total transparency so that it is easy to comp onto (lets say) a real world photo of the terrain that the terrain model was based on. We DO NOT want the shadow or shading cast by the terrain model onto itself (that is already on the photo!) and we do not want the shadow of the cube.

Create a Render Layer called ‘allShadows’ with all Layers renderable under Render Layers ‘Scene’, but only Layer 1 outputting to image under Render Layers ‘Layer’, then render the Shadow pass of this out, giving you the terrain with the shadow of the sphere and cube and also the shading/shadow that the terrain model casts onto itself. The actual sphere and cube will not be visible.

Create another Render Layer called ‘noLayer2Shadow’. This is exactly the same as ‘allShadows’ except we click the ‘Exclude’ for Layer 2. The Shadow pass of this will give you the same as above except the sphere’s shadow will not appear on the terrain.

In your compositor, use a mix node set to ‘Difference’ to find the difference between the two above shadow passes – the only difference between the two is the shadow cast by the sphere – so the result of this difference mix is an image of only the sphere’s shadow cast on the terrain and all else is white – the cube’s shadow is gone, and most importantly, the shading and shadow that the terrain casts onto itself is also gone – we just have a white image with the sphere’s shadow as cast onto the terrain on it.

If there is any unwanted surrounding noise, use a Colour Ramp node to to act as ‘Levels’ to get rid of it and narrow it down only to the sphere’s shadow.

Feed the result of 4 into the ‘Set Alpha’ node’s alpha input, leaving the image input as a plain colour that defines the colour of sphere shadow. Now the Sphere’s shadow will be degrees of transparency within a totally transparent surround.

Use other Render Layers to put the objects back on top of the shadow (‘Alpha Over’ node) but you can still independently control the sphere’s shadow!

This can also be done to some extent with other passes like Diffuse and Glossy passes.


Oh my… realistic you are a genius!! I tried that method and it took some fiddling, but it works great once you get your head around the compositing and render layers! One of the best parts of this method is that it works with emission material shadows as well! We don’t have to go back to using lamps if we want a shadow pass! Fantastic! Thank you so much realistic!

Cool solution although a bit complex.
It would be cool to make the shadow pass indexable (word?) like the material id pass.
Shadow id pass?

ad3) actually the result of the difference is quite opossite, it’s black image with light shadow of the ball, is it ok?

Hi folks , I have now added a diagram to my orginal post to help explain.

InverseTelecine,
Yes, you can use this method for any kind of isolation you want. I once used it on all the Diffuse/Glossy, Direct/Inderect etc passes in order to isolate reflected colour of a red cube onto a white terrain.

Zimek,
You just need to use an Invert node. However with my idea above, having shadow as white actually works when fed into a Set Alpha node to set the shadow in an transparent surround. I added a new screenshot above to illustrate.

Thank you !

Hi everybody, is there still no simple Material or OSl way of doing this?
To me the compositor is black magic, and i would love to have a simple material option, like in Blender internal…
How do other renderers deal with it? any expiriences?
keyshot can definetly do that…

I don’t know if anyone noticed but a Cycles shadow catcher shader was on Ton’s list of to-dos for 2015… so it’s not ignored anyway.

I thought last time it was someone’s todo list, it was for DingTo to implement it.

I don’t recall a single case where Ton has touched the Cycles code or plans to, it’s not really ‘his’ area at the moment.

I believe he was referencing this post by ton – http://www.blender.org/press/18-anticipated-blender-development-projects-of-2015/

The Cycles render engine now has more or less the features we want (although baked rendering and ‘shadow catcher’ material is still high on the list).