Author Topic: [RESOLVED] How to make objects invisible but that can still cast shadows?  (Read 1630 times)

0 Members and 2 Guests are viewing this topic.

Offline dream3

  • Newbie
  • *
  • Posts: 7
Hey guys,

I am trying to setup a scene where I need some cast shadows in some specific places. My idea was to place various objects that are invisible to camera but that would still block the environment light and cast a shadow. However, I can't seem to accomplish that. I've heard that it is indeed possible though.

Can anyone confirm whether this is doable or not?
« Last Edit: May 20, 2019, 10:31:33 am by Bruno F »

Offline Finema

  • Hero Member
  • *****
  • Posts: 822
  • Designer
    • Delavallade Design
Re: How to make objects invisible but that can still cast shadows?
« Reply #1 on: May 16, 2019, 09:53:24 pm »
Hi
You can use Emissive material for the objects and check Not visible for the camera.
See my screenshot. I join a sample .bip.

Offline germannick

  • Jr. Member
  • **
  • Posts: 67
Re: How to make objects invisible but that can still cast shadows?
« Reply #2 on: May 17, 2019, 05:23:54 am »
 8)

Offline dream3

  • Newbie
  • *
  • Posts: 7
Re: How to make objects invisible but that can still cast shadows?
« Reply #3 on: May 17, 2019, 06:55:49 am »
Hi
You can use Emissive material for the objects and check Not visible for the camera.
See my screenshot. I join a sample .bip.

Heyy thank you so much!

I just have two follow up questions if you dont mind:

1- Does the intensity and the color affect the outcome in any way?

2- The object still appears in the "shadow" render pass, is there anyway to prevent that from happening?

Offline Finema

  • Hero Member
  • *****
  • Posts: 822
  • Designer
    • Delavallade Design
Re: How to make objects invisible but that can still cast shadows?
« Reply #4 on: May 17, 2019, 08:08:51 am »
Hi
You can use Emissive material for the objects and check Not visible for the camera.
See my screenshot. I join a sample .bip.

Heyy thank you so much!

I just have two follow up questions if you dont mind:

1- Does the intensity and the color affect the outcome in any way?

2- The object still appears in the "shadow" render pass, is there anyway to prevent that from happening?

Sorry, i don't know  :(

Offline Bruno F

  • KeyShot Support
  • Full Member
  • *****
  • Posts: 169
Re: How to make objects invisible but that can still cast shadows?
« Reply #5 on: May 17, 2019, 02:21:39 pm »
Hello dream 3,

See my answers below:

1. For best results, ou can keep the intensity at 0 and set the color to black.
2. There is no way to prevent an Emissive from appearing in the shadow pass. Perhaps you can render two images and compose later? I'm not familiar with post so I can't really recommend anything else here.



Heyy thank you so much!

I just have two follow up questions if you dont mind:

1- Does the intensity and the color affect the outcome in any way?

2- The object still appears in the "shadow" render pass, is there anyway to prevent that from happening?

Offline DMerz III

  • KeyShot Beta
  • Hero Member
  • *****
  • Posts: 825
  • David Merz the Third
    • MerzTheThird
Re: How to make objects invisible but that can still cast shadows?
« Reply #6 on: May 17, 2019, 08:06:57 pm »
 :) The emissive trick is nice, but if you ever want a trick that doesn't require turning your material into a completely new shader, you can turn on the experimental features (you have to edit the keyshot .xml file on your computer, search for experimental, turn 'false' into 'true' save, reopen KS).

Then you have 3 new nodes in your material graph, one being the ray mask node. (under utilities)

Plug this into your opacity channel on any existing material, turn off all of the check boxes except, shadows, and either back or front faces (I can't remember, might depend on your normals). Either way, play around with the different combos and you should get it to only cast a shadow but the object will be invisible.
This also will make the object invisible in the shadow pass (at least it did for me in my experiment).

Hope that works for you!

edit; here's proof, before and after, and the nice thing is it will preserve your color cast onto the ground if your object has color and you turn on Global Illum with some extra bounces.

« Last Edit: May 17, 2019, 08:29:06 pm by DMerz III »

Offline dream3

  • Newbie
  • *
  • Posts: 7
Re: How to make objects invisible but that can still cast shadows?
« Reply #7 on: May 17, 2019, 08:48:25 pm »
Gee, you guys are awesome. Thank you so much all of you :)

Offline dream3

  • Newbie
  • *
  • Posts: 7
Re: How to make objects invisible but that can still cast shadows?
« Reply #8 on: May 19, 2019, 09:42:27 pm »
:) The emissive trick is nice, but if you ever want a trick that doesn't require turning your material into a completely new shader, you can turn on the experimental features (you have to edit the keyshot .xml file on your computer, search for experimental, turn 'false' into 'true' save, reopen KS).

Then you have 3 new nodes in your material graph, one being the ray mask node. (under utilities)

Plug this into your opacity channel on any existing material, turn off all of the check boxes except, shadows, and either back or front faces (I can't remember, might depend on your normals). Either way, play around with the different combos and you should get it to only cast a shadow but the object will be invisible.
This also will make the object invisible in the shadow pass (at least it did for me in my experiment).

Hope that works for you!

edit; here's proof, before and after, and the nice thing is it will preserve your color cast onto the ground if your object has color and you turn on Global Illum with some extra bounces.

Actually, for me it is almost perfect. I've done some testing and it there are still some artifacts in the shadow pass unfortunately. The only thing I did was to add the ray mask, toggle show back and show shadows. Not sure if Im missing something or a bug due to it being experimental.

See the weird square shape in the right side.

« Last Edit: May 19, 2019, 09:45:43 pm by dream3 »