Jump to content
PhasmaCeritus

shadow catcher material

Recommended Posts

Hi,

I was wondering if anybody made a material that catches shadows but doesn't cast any (no self shadowing).

I am working with ray-traced shadows and ray-traced rendering if that makes any difference.

Thanks for ideas!

Share this post


Link to post
Share on other sites

two ways to do this. the first is to use a normal 'shadow matte' vop and set the 'shadow mask' on your light to exclude the object you don't want to self shadow.

the other way is to do it in your shader with isshadowray() switching the opacity of the object off for shadows.

here's what that looks like:

post-4364-129753820194_thumb.jpg

  • Like 3

Share this post


Link to post
Share on other sites

Dude,

you'r awesome :)

Thanks!

two ways to do this. the first is to use a normal 'shadow matte' vop and set the 'shadow mask' on your light to exclude the object you don't want to self shadow.

the other way is to do it in your shader with isshadowray() switching the opacity of the object off for shadows.

here's what that looks like:

Share this post


Link to post
Share on other sites

Hi guys,

 

By using the "isshadowray" solution the object stops casting shadows over the other objects as well. Is that what it actually does or I'm messing something?

 

How to turn off only the self shadow but keep cast shadows over the other objects?

 

 

I want to render pyro smoke that's occluded by mate object which cast shadows over the smoke. That's fine.

Now I want to output a render pass (mantra image plane) that contains only the smoke's shadow cast over the matte object.

I need both yellow frames to render at once not by using takes or any technique that needs to execute a second render.

 

shadowmatte_graphic1.jpg

 

 

Thanks!

Edited by dickagm

Share this post


Link to post
Share on other sites
Guest tar

Try;

 

Uncheck 'Enable Shadows' on:

/shop/mantrasurface/surfaceModel/computelighting1/pbrlighting1

SelfShadowPhantom.hip

post-8321-0-64951900-1398547074_thumb.pn

Edited by tar

Share this post


Link to post
Share on other sites

Thanks for the reply and the hip file Marty!

 

That's a nice trick to control the self shadows with mantra surface, in my opinion that attribute should be exposed at upper user control level in to the mantra surface gui because it should have a common use in a complex compositing situations :) unfortunately the matte shadow node is still outputting with the self shadows included.

How can I combine the use of this trick with the use of matte_shadow node?

 

For now what I have achieved that's looking very close to what I need is the use of "isshadowray" combined with the matte_shadow node, unfortunately it completely stops the shadows casting of the object.

What I need so far is to stop somehow only the self shadows of the "matte_shadow" node, because I'm outputting my shadow pass using this node, I'll appreciate any additional workarounds of this issue.

 

 

Thanks!

Share this post


Link to post
Share on other sites
Guest tar

Is it possible to upload a very simple file showing what you want? 

 

Using the unchecked Enable Shadows and in Mantra using the 'direct_shadow' Vex Variable works for outputting a shadow pass without self-shadow.

 

Thanks!

post-8321-0-44785900-1398624479_thumb.pn

post-8321-0-54287000-1398624593_thumb.pn

SelfShadowPhantom2.hip

Edited by tar

Share this post


Link to post
Share on other sites

Hi Marty,

 

Here is the scene. There's a simple smoke sim and there are 3 takes:

 

main - where everything is visible (to get sense of the scene)

take1 - is where my beauty pass is exactly as I wanted (the smoke is cut by the matte object and have received shadow cast from the mate object as well) but the SHADOW_MATTE pass contains the self shadows of the matte object (which is the thing I don't want :) )

take2 - is where the beauty pass have loosed the shadow cast from the matte object (by use of isshadowray with the matteshadow nodes), but on cost of that the MATTE_SHADOW pass now contains only the smoke shadow cast over the matte object which is the exact thing I want from this pass

 

so I want to have in one render the beauty result from take1 (smoke, cut by matte object, recieve shadows from same matte object)

and shadow_matte result from take2 ( only the smoke's shadow cast over the matte object ).

 

 

Really appreciate your help Marty!

Thanks!

matte_shadow_test.hipnc

Share this post


Link to post
Share on other sites

After some more try outs it looks like there's no way to turn off the self shadow of a matteshadow shader? Is that possible if I write my own VEX shader for mantra, if so I'll appreciate any tips about the variable I'll have to play with to control the shadows?

 

I have old memories about mental ray shader that can separate the individual ray components like, primary rays, secondary rays, reflection rays, shadow rays and so on... which makes possible to tell the shader what to do with the shadow rays only or the ones you need. It was used mainly to control the sampling behind transparent objects like glass windows but I guess the same concept will be applicable to the matteshadow shader that I need.

 

The issshadowray node looks like the rayswitcher I'm talking above, so I only need a way to check the object's id at rendertime and if the shadow ray that is cast over certain object is caused by the same object then to dismiss it.

 

 

Thanks!

Share this post


Link to post
Share on other sites

Hi all!

Did anyone solve the problem?

 

thank you

 

Edit: using what afandina suggested actually works (be sure to exclude the object you don't want selfshadow from the light shadow mask)

selfshadow.hipnc

Edited by WLVL

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×