Author Topic: How to separate objects+shadows from the whole scene?  (Read 3172 times)

2019-02-26, 12:17:15

TeoRossi93

  • Active Users
  • **
  • Posts: 136
    • View Profile
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.
Matteo Rossi 3D - https://www.teorossi.it/

2019-02-26, 15:26:16
Reply #1

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5546
    • View Profile
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.
Tom Grimes | chaos-corona.com
Product Manager | contact us

2019-02-26, 15:40:35
Reply #2

TeoRossi93

  • Active Users
  • **
  • Posts: 136
    • View Profile
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 :(
Matteo Rossi 3D - https://www.teorossi.it/

2019-02-26, 15:47:06
Reply #3

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5546
    • View Profile
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.
Tom Grimes | chaos-corona.com
Product Manager | contact us

2019-02-26, 17:51:01
Reply #4

TeoRossi93

  • Active Users
  • **
  • Posts: 136
    • View Profile
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.
Matteo Rossi 3D - https://www.teorossi.it/

2019-02-26, 18:03:53
Reply #5

TomG

  • Administrator
  • Active Users
  • *****
  • Posts: 5546
    • View Profile
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!
Tom Grimes | chaos-corona.com
Product Manager | contact us

2019-02-26, 19:20:31
Reply #6

romullus

  • Global Moderator
  • Active Users
  • ****
  • Posts: 8889
  • Let's move this topic, shall we?
    • View Profile
    • My Models
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.
I'm not Corona Team member. Everything i say, is my personal opinion only.
My Models | My Videos | My Pictures