[RESOLVED] How to make objects invisible but that can still cast shadows?

Started by dream3, May 16, 2019, 06:30:36 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

dream3

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?

Finema

Hi
You can use Emissive material for the objects and check Not visible for the camera.
See my screenshot. I join a sample .bip.

germannick


dream3

Quote from: Finema 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.

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?

Finema

Quote from: dream3 on May 17, 2019, 06:55:49 AM
Quote from: Finema 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.

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  :(

Bruno F

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.


Quote from: dream3 on May 17, 2019, 06:55:49 AM

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?

DMerz III

 :) 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.


dream3

Gee, you guys are awesome. Thank you so much all of you :)

dream3

Quote from: DMerz III 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.

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.