Chaos Corona Forum

Chaos Corona for Cinema 4D => [C4D] General Discussion => Topic started by: TeoRossi93 on 2019-02-26, 12:17:15

Title: How to separate objects+shadows from the whole scene?
Post by: TeoRossi93 on 2019-02-26, 12:17:15
Hi guys,
I'm rendering an interior scene and I would like to split objects into the room + their shadows from the rest of the scene.
In the attached image you can see an example of what I mean, I would like the 3 metallic spheres and their shadows to be rendered in a separate layer.
Is it possible in any way? Shadow catcher does not seem to be the solution since it works with backplate only.
Title: Re: How to separate objects+shadows from the whole scene?
Post by: TomG on 2019-02-26, 15:26:16
Might be worth mentioning what you want to do with this approach, because the solution below may not do what you want :)

You can use a mask layer to create masks for the spheres. This would then let you remove them from the Beauty pass (and by copying that pass and inverting the mask, leave them in another layer). You could then use the Shadow pass (see https://corona-renderer.com/wiki/render_elements) and a linear add to the beauty pass will remove the shadows from it (but all shadows, so you'd need to manually mask that pass to leave it just the sphere shadows). You could then add another layer with the Shadow pass alone (manually masked to be just the spheres again), and then subtract it from the Beauty pass to put shadows back in.

This would let you make post processing adjustments to the spheres and to the sphere shadows without affecting the Beauty pass.
Title: Re: How to separate objects+shadows from the whole scene?
Post by: TeoRossi93 on 2019-02-26, 15:40:35
Tricky workaround but it's fine, the fact is that the actual interior I'm working on is more complex then the previous example...
I thought that it was possible to do something with some corona feature :(
Title: Re: How to separate objects+shadows from the whole scene?
Post by: TomG on 2019-02-26, 15:47:06
Not really - Corona is oriented to being physically realistic, in that the scene, objects, materials, lighting etc. should be like you were setting up an actual physical space. And just as it would be impossible in a physical space to have some objects not in the photo without actually physically removing those objects from the space, similar things apply to Corona.
Title: Re: How to separate objects+shadows from the whole scene?
Post by: TeoRossi93 on 2019-02-26, 17:51:01
I know Tom...
Unluckily my client wants all objects separate from the floor (yeah, retarted request).
I don'w know what he's going to do, whatever.
Title: Re: How to separate objects+shadows from the whole scene?
Post by: TomG on 2019-02-26, 18:03:53
A strange request from the client, yep - I wonder if they think they can move the objects around in post, which likely won't work due to shadows falling on surfaces of different shapes (floorboards), perspective, etc.

Unfortunately, the only way I can think of doing it is the workflow above - if anyone can think of another clever idea, let us know!
Title: Re: How to separate objects+shadows from the whole scene?
Post by: romullus on 2019-02-26, 19:20:31
You could try following workflow - hide all objects that needs to be rendered separately, render the scene, add shadow catcher to material override, unhide previously hidden objects and add them to override exclussion list. Set shadow catcher to for compositing mode, add previous render as its backplate and render again. This probably won't work with highly reflective objects, like chrome spheres, but with more ordinary materials, that could do the trick.