Shadow catcher surface shader

Started by Ashley, September 04, 2015, 05:40:11 PM

Previous topic - Next topic

Ashley

Hi,

I am trying to isolate ground shadows from 3D volumetric clouds.

In the render elements I'm not able to get this pass, although there are several passes (AOVs) that are working.
I'm just missing a clean way to extract the shadows.

EDIT
Or at least is there a way to colorize the cloud shadows?

Any advise appreciated :-)
Thnx

Matt

#1
We don't have an output for actual shadow mattes yet. I know there are some situations where you really need a shadow matte, but in most cases there are other ways to do this. Shadows are just the absence of direct light, where only indirect light remains. So if you adjust the Surface Indirect element (tgSurfIndirect), you can adjust the shadows.

To do this, you can subtract tgSurfIndirect from the beauty element, colour correct tgSurfIndirect, then add it back in.

It does slightly affect the sunlit parts too because they are the total of both direct and indirect light, but has the most noticeable effect in the shadows. You can also use the same trick to adjust the non-shadowed parts, by working on the tgSurfDirect element instead.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Ashley

#2
Hi Matt,

I had tried a similar approach, but I need to be able to separate specific shadows.
One thing I tried was to export then re-import the terrain as a piece of geometry, and give it a lambert shader. (Tried the constant surface shader but it doesn't receive shadows).
I set its diffuse to white and turned the cloud visibility off and set the object node to not cast shadows.

This 'should' of worked in theory but the geometry still casts shadows. Have I missed a step? or is this a bug?
Essentially I think it was the surfDirect pass that gave me the closest result, but unable to disable object cast shadows, so of course you get all the shadows combined.

Thnx for the reply.

EDIT
When I say the object still casts shadows, what I mean is self casting. The shadows are removed from the surrounding terrain but they still shade the object, self casting.
If there was a way to disable that but allow the object to catch shadows, we'd have a solution.

Matt

Unfortunately there isn't a way to disable the self-shadowing or self-shading that happens due to surface normal. I will need to write a dedicated shader (or output element) to do this.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Matt

If you render two images, one with cloud shadows and one without, then you might be able to take the difference to get some kind of mask. The difference will be stronger where the surfaces are facing more towards the sun, but it might be useful.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

Ashley

Thnx for your suggestions but they are not viable options.



Ashley

I think what will work is rendering the scene from a top down camera.
If I disable the terrain and turn the visibility of the clouds off, thus Isolating the cloud shadows.
I will then need to re-project this back onto the geometry outside of TG or I could do so inside TG and use it as a RGB pass and render from main camera.

I'll post an example of this, to help others but mostly to illustrate how much a shadow pass/material is needed. ;-)

Thnx

bobbystahr

Quote from: Ashley on September 07, 2015, 11:18:30 PM
I think what will work is rendering the scene from a top down camera.
If I disable the terrain and turn the visibility of the clouds off, thus Isolating the cloud shadows.
I will then need to re-project this back onto the geometry outside of TG or I could do so inside TG and use it as a RGB pass and render from main camera.

I'll post an example of this, to help others but mostly to illustrate how much a shadow pass/material is needed. ;-)

Thnx

Dunno if this is helpful as I can't access TG3 atm, but have you looked into the newer I think I recall, 2D shadow casting features in the clouds?
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Oshyan

That's not going to help Bobby, it's just an optimization for rendering, it doesn't actually output any shadow masks or anything.

- Oshyan

bobbystahr

Quote from: Oshyan on September 08, 2015, 02:35:26 PM
That's not going to help Bobby, it's just an optimization for rendering, it doesn't actually output any shadow masks or anything.

- Oshyan

Cool. was but a shot in the dark.....too bad it doesn't as it seems it might be a handy thing to have in he toolbox.
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Ashley

Hmmm my idea didn't work, or rather it would only work on shadows cast from high angles, and on limited  types of terrain.
Thnx for the idea bobbystahr but I think what I'm after isn't possible.

I'm curious if there is any development towards having this feature in TG?

Cheers

Matt

I looked into this today, and it turned out to be simple to write a shader to do this.

I can send you a plugin, as long as you only need it on Windows. Would that work? We will also roll it into the next proper TG3 update.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

bobbystahr

Quote from: Matt on September 12, 2015, 04:15:37 AM
I looked into this today, and it turned out to be simple to write a shader to do this.

I can send you a plugin, as long as you only need it on Windows. Would that work? We will also roll it into the next proper TG3 update.

Matt


Now this is how a forum works...thanks for the attention Matt
something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Ashley

Quote from: Matt on September 12, 2015, 04:15:37 AM
I looked into this today, and it turned out to be simple to write a shader to do this.

I can send you a plugin, as long as you only need it on Windows. Would that work? We will also roll it into the next proper TG3 update.

Matt

Wow I am super impressed :-)
Thank you for looking into this, yes a plugin would work I'm using the Pro anim version on windows.

You're the best Matt
Cheers!