Shadow problem with cutout opacity

Shadow problem with cutout opacity

JakobAppleby
Enthusiast Enthusiast
1,009 Views
8 Replies
Message 1 of 9

Shadow problem with cutout opacity

JakobAppleby
Enthusiast
Enthusiast

Hey i have a problem with shadows when it comes to using cutout opacity driven by a distance node.

It seems to kill my shadows entirely. Distance shader seems to be the culprit since plugging in a flat utility shader or a ramp with no input works as intended.

 

Attached a test scene and my result with that scene

 

Untitled 4.jpg

0 Likes
1,010 Views
8 Replies
Replies (8)
Message 2 of 9

lee_griggs
Autodesk
Autodesk

Quick question. Why are you doing this?

Lee Griggs
Arnold rendering specialist
AUTODESK
0 Likes
Message 3 of 9

JakobAppleby
Enthusiast
Enthusiast

Because i have a setup that includes a lot of materials that turn invisible when an object gets close, a sort of see through effect. Is it a strange thing to do? Should i be using transparency instead? Ive got over 40 materials that all fade out with the distance shader into cutout opacity, but it breaks the shadow even when the distance trace isnt even close

0 Likes
Message 4 of 9

lee_griggs
Autodesk
Autodesk

Interesting. I was wondering if there was an alternative way of doing that like projecting a ramp to the opacity but if you have over 40 materials I can see why you would seek an alternative solution. Could you upload a simplified scene so that we can test whether it is a bug or not?

Lee Griggs
Arnold rendering specialist
AUTODESK
0 Likes
Message 5 of 9

JakobAppleby
Enthusiast
Enthusiast

The rar file in the original post is the test scene that i screenshotted. 

 

Its basically taking the distance from the ground object and putting that either straight or through a ramp into the cutout opacity.

In my project i have a car that becomes transparent when a set of planes go through it, looks really good except the shadows

 

Let me know if you need a zip instead.

 

 

0 Likes
Message 6 of 9

JakobAppleby
Enthusiast
Enthusiast

At first i thought it had something to do with the amount of ray depth, but the scene in the first post shows that it its not working correclty. 

0 Likes
Message 7 of 9

JakobAppleby
Enthusiast
Enthusiast

If i flip the output from the distance shader around with the ramp i get this, which is also wrong but the shadow is there atleast, though not a correct shadow

(And if i flip the black and white output in the distance shader itself i get the same result but no shadow at all)

 

CutoutOpacityProblem_02.jpg

0 Likes
Message 8 of 9

lee_griggs
Autodesk
Autodesk

Apparently, this is expected behavior. It is happening here because the distance shader currently early exits returning nothing when evaluated for a shadow ray. We will look into it. Meanwhile, maybe you could project a ramp to the opacity instead?

Lee Griggs
Arnold rendering specialist
AUTODESK
0 Likes
Message 9 of 9

JakobAppleby
Enthusiast
Enthusiast

Alright, for now i will either try to get it working with just a ramp or do some comping in post .

 

Would be cool to have it work 👍