Shadow Matte

   2253   9   3
User Avatar
Member
3 posts
Joined: Dec. 2014
Offline
Hi guy's, absolutely loving Karma and Karma XPU, so fast and stable, just wondering
if the shadow matte is in the future, as I really need the shadow on a plane using a
spherical environment map, I tried the Plate method, but it just didn't do it for me.
Thanks for this wonderful piece of software.
T.
User Avatar
Member
1336 posts
Joined: March 2009
Offline
As a workaround (for now) you can do the following:

Render a beauty pass of your shadow catcher, and render a beauty unshadowed AOV.
(Then you have basically one with and one without the shadow).

Use for example COPs or another software like Nuke to subtract them from each other.
The result is the shadow.
Martin Winkler
money man at Alarmstart Germany
User Avatar
Member
467 posts
Joined: Aug. 2013
Offline
Hi. I looked at how Renderman doe it and it pretty much the same idea as well. I was hoping the backgroundplate LOP would do the trick but the shadow pass also has the reflection in it. Best
User Avatar
Member
29 posts
Joined: Feb. 2014
Offline
Hi - one option that I've had some success with (when using the backgroundplateLOP) is to flag off the diffuse, reflect, and primary ray visibility on the objects you want to cast shadows. Looks like that will prevent the unexpected reflections appearing in the shadow matte. Hope that's helpful

Attachments:
karma_shadowPass_vis.hip (947.6 KB)
Screenshot 2021-11-23 115021.png (416.3 KB)

User Avatar
Staff
203 posts
Joined: Feb. 2008
Offline
Currently the shadow aov contains both the shadows and reflection occlusion.

The background plate aovs are meant to be composited such as:
Beauty over (plate * invert(shadow) + diffuse + reflection + emission).

The default background shader currently has metallic set to 0 and reflectivity set to 1 with a roughness of 0.3
In order to get diffuse shadows only on the background, dive in the hda and set the principledshadercore reflectivity parm to 0.

We're looking at separating the reflection occlusion into its own pass as well as disabling the glossy reflection aov disabling reflections on the shader. This should help make it more obvious, and a little more straight forward if you are only after diffuse shadows.

The compositing will then be:
Beauty over (plate * invert(shadow + reflection occlusion) + diffuse + reflection + emission).

One of the added benefits of separating the reflection occlusion into its own aov is that it seems to fix an issue with a 100% reflective background currently still letting some of the plate through - this is noticeable when the background shader metallic and reflectivity parms are set to 1, and more obvious still when the roughness is set to 0.

Here is an example COP network showing how to put the passes together with the background shader metallic parm set to 0.4 to make the reflections more obvious.
Edited by npetit - Nov. 25, 2021 00:55:50

Attachments:
BGPlateComp.png (3.9 MB)

User Avatar
Member
467 posts
Joined: Aug. 2013
Offline
Hi Npetit. This is much better. I know I have a ticket with you. I will try to mock up my examples and send them over to you next week. One thing I should mention is in my custom reflection pass I am outputting direct reflection and indirect reflection. Dome light HDR's show up in the direct and reflections of the characters/objects show up in the indirect. The main one I am using is indirect reflection.

Best

Mark
Edited by Mark Wallman - Nov. 25, 2021 05:33:08
User Avatar
Member
29 posts
Joined: Feb. 2014
Offline
Thanks Nick - the adjustments in 19.0.450 are great, helps a lot with the usability. Quick query though - the reflection occlusion doesn't quite look like I was expecting. Appears to match the placement of the shadow rather than the reflection hits; is that expected?

Attachments:
out.gif (322.7 KB)

User Avatar
Staff
334 posts
Joined: Sept. 2016
Offline
Hi. This is expected result. "Reflection Occlusion" might be a bit confusing label here... It's actually shadow pass from glossy BSDFs. This certainly *can* be used to generate more traditional-looking reflection occlusion pass (ie ambient occlusion but using glossy BSDF lobe) by using ambient lighting set up (ie a dome light without envmap), but otherwise it will take the current lighting set up into consideration.
So in your particular example, there's just the directional light, and the glossy lobe doesn't line up with the light direction, so no light source is actually being occluded (except for the tail edges of the BSDF lobe due to roughness, but since the light direction for glossy reflection is same as light direction for diffuse, its shadows will resemble that of diffuse lobe's)
User Avatar
Member
29 posts
Joined: Feb. 2014
Offline
Thanks for clarifying dlee - I see the result you describe with a pure white dome light.
Long term, if it is possible to get that sort of specular ray hit occlusion out in the same render as the other outputs that would be great.
cheers
OneBigTree
Member
374 posts
Joined: Nov. 2010
Offline
Is there any real solution to this yet? Like an actual matte/shadow shader?
  • Quick Links