shadow_matte problem

   13665   16   2
User Avatar
Member
23 posts
Joined: Sept. 2015
Offline
Hi everyone, I switched to Houdini from Maya and RenderMan and I am now facing a problem with shadow matte or shadow catcher etc…

Over a week of searching the web, reading tons of threads with no luck.
Simple scene, place sphere over floor grid, one light casting shadows over the sphere to the floor, camera background image. In Maya and RenderMan using the holdout_workflow result is done immediatelly. The holdout_shadows pass contains just the shadow as it should be. But the Houdini shadow pass is emty even in alpha channel.

Again, I searched the web over the week, so the last chance I have is to carefuly ask here. How to achieve this simple thing like Mayas background shader, RenderMans holdout_shadows in Houdini?
Edited by - Oct. 1, 2015 06:06:35

Attachments:
shadow_catcher_maya_01 copy.jpg (319.8 KB)

User Avatar
Member
23 posts
Joined: Sept. 2015
Offline
And Houdini output - picture bellow is “C”, direct_shadow pass has only some shadows on the sphere but not the floor ones. Aplied just shadow_matte material to the floor.

Attachments:
houdini_shadow_matte.jpg (164.0 KB)

User Avatar
Member
23 posts
Joined: Sept. 2015
Offline
And here is my simple scene with floor image included:

Attachments:
shadow_catcher_houdini.zip (219.1 KB)

User Avatar
Member
333 posts
Joined: Oct. 2012
Offline
maybe this helps you:



or with 2 takes:
https://vimeo.com/112209857 [vimeo.com]



Maybe someone knows an easier way?
User Avatar
Member
23 posts
Joined: Sept. 2015
Offline
Doudini, thanks for answer. Where do I get the “ShadowCol (1,0,0,) and ”bind1 (shadow)“? In the shadow_matte are few different nodes. Under TAB I found binf node, but it is ”bind1(parm)"… I don't get it, why it is so complicated…

The video you sent me a link to, it is not quite right. I don't want to define floor material like him, I just need to catch shadows. And the problem with the solution in the video is, that it is working only when his teapot is way above the shadow plane, because his shadows are full and not cutout - see my first - in the holdout_shadows pass the original sphere has cut out hole in the floor shadow - that is correct. Do you know what I mean? And his solution is working only woth separate background image and will not work when using for example environment with image background.

In other words it must be some easier solution, all renderers have it quite easy…
User Avatar
Member
333 posts
Joined: Oct. 2012
Offline
the bind and matte shadow are in vex shader context. With the bind you can export custom Channels. Im not too sure what will be the best way in houdini but Anyway here is another option using 2 takes: (for diffuse and your shadow)

for the shadow matte take:

1. add a Shadow Matte Shader in shop.
2. assign shadow matte shader to plane.
3. set sphere to matte shading
4. render and make sure you go check the Alpha channel where you will have the Shadow Mask with the Sphere cut out.

you will have to render the pass separate.

I agree with you there should be a better option, at least the Shadow Matte Shader should work in the direct_shadow pass which it does not for some reason.
User Avatar
Member
333 posts
Joined: Oct. 2012
Offline
sry for my english,

please find attached my example.
on the top right of houdini you find the takes list dropdown where you can switch from rendering diffuse or the shadow. Or just setup 2 render nodes one for each take and connect them.

For the shadow make sure to check the alpha channel. color channel will be all black.

I hope this will help?

Attachments:
ShadowMatte.hipnc (154.4 KB)

User Avatar
Member
23 posts
Joined: Sept. 2015
Offline
Hi Doudini, your English is good, don't worry
I tried your scene, the shadow is nicely cutout, but the problem will be with the compositioning when using Environment light with image background. I used your scene, slightly modified and I am posting it in next post. And please look at it and test it (use Cam1) and please let me know how to do the result look like on my next picture. All I want is to achieve result as on my render from Maya and RenderMan I did now - see this image:
Edited by - Oct. 1, 2015 15:59:02

Attachments:
shadow_catcher_maya_01_environment.jpg (159.3 KB)

User Avatar
Member
23 posts
Joined: Sept. 2015
Offline
And my scene is here. I inscluded the environment image to the environment light so update it.

Attachments:
shadow_catcher_Teresa.zip (5.2 MB)

User Avatar
Member
333 posts
Joined: Oct. 2012
Offline
you have modified the wrong take when you made the changes to the hip file. Should have worked from the Main Take to adjust cam position for example. When making changes to the scene always do it on the main take.

Also I see what you mean with the plane cutting out the environment map, for that you can put: -primary in Render Visibility (Phantom) and this will solve it.

But anyway, I modified the file so the bg is separated in its own pass so there is no need to do this. So you will have 3 render nodes. Rendering the bg, main object and shadow.


Check the IMG context to see the rendered result where the bg, shadow and sphere are combined.

I also added a second plane without the Shadow Matte Shader which enables indirect diffuse. Render Visibility is set to -primary. Without it there was no indirect diffuse since the Shadow Matte shader.

let me know if it helps

Attachments:
shadow_catcher_Teresa.zip (7.9 MB)
Screenshot-33.png (374.5 KB)

User Avatar
Member
23 posts
Joined: Sept. 2015
Offline
I have modified the “Main” because I just wanted to prepare the base scene for you, so you can do miracles

Yes yes yes, thank you very much! Now it looks it is doing what I want. But why is it so complicated?
I made a short composition of your renders in Nuke because Nuke I understand better than comp in Houdini. Your solution is clean, I like it.

I am now diging through your scene to understand all you did so I can replicate it in the future. One small question, where did you get or how exactly did you created your “v_shadowmatte1” material?

Can I ask your for text detail of all steps what to do exactly? I saw a lot of posts over other forums as well asking for the same thing. You can make it as a base step by step tutorial for all others. I know it take some time to do it, bu tit can help a lot of people.

Thanks again very much…

Attachments:
Screen Shot 2015-10-02 at 6.37.33.png (61.1 KB)

User Avatar
Member
23 posts
Joined: Sept. 2015
Offline
So finally I've figured that all out. It is in fact simple. Just using 2 takes, one for separating the shadows under the car, second for the beaty pass of my car. One ROP network, inside 3 render nodes - first for shadow pass (with extra pass direct_shadow), second for the beauty pass of the car and third just an environment background. There is no need to use shadow_matte material. For my floor plane alias shadows catcher I used a built-in Material Builder, tweaked the shader little bit to be close to the env asphalt. Rendered and then comp in Nuke. In Nuke I have two ways how to comp it, (1) first using the shadow material defined in Houdini and (2) second using constant or anything you want. In Nuke you have free hands.

Yes, it would be nice to have a possibility to see the result of shadows in preview render immediately without need to comping it, like for example RenderMan, V-Ray etc. offers.

If you wanna test it yourself, I attached the whole scene, images, renders and Nuke comp file into one zip in the next post.

Only one problem I still didn't solved - in my beauty pass of the car alone without the floor plane and environment, the environment is still visible in the windows and it should not be there.
Edited by - Oct. 2, 2015 04:55:06

Attachments:
Screen Shot 2015-10-02 at 10.19.05 copy.png (111.8 KB)

User Avatar
Member
23 posts
Joined: Sept. 2015
Offline
Final comp result:

Attachments:
nuke_comp copy.jpg (301.0 KB)

User Avatar
Member
23 posts
Joined: Sept. 2015
Offline
And here are all scene and comp files for testing. Hope it will help someone… Just replace my env image with some of yours.
Big thanks to Doudini for pointing me the right direction

Attachments:
stirling.zip (22.4 MB)

User Avatar
Member
35 posts
Joined: Jan. 2016
Offline
Thank you so much for comming back with the solution! Yes, it helps someone

All the best.
---
http://madfusion.eu [madfusion.eu]
https://linktr.ee/loogas [linktr.ee]
User Avatar
Member
174 posts
Joined: March 2014
Offline
Hi,

Are you Aware of the Direct Shadow image plane and Indirect Shadow Image planes ???
In you're ROP you add an image plane and choose them in the list.
So you can keep you're original materials in place…

but… that's not totally complete because for example in Softimage i was capable of doing all that in a single pass!

Used to set manually the A component to the RGB output to 0 in the material so i can get a transparent ground while getting the SHADOW planes FILLED.
In Houdini seems we can't touch the resulting BSDF (yellow port) and so we can't alter the A component….

How can we do that ?

User Avatar
Member
8 posts
Joined: June 2016
Offline
Thank you so much guys! I finnaly got it,i was thinking it had something to do with materials,but now i see even without any materials it works.
  • Quick Links