Glass BSDF (Dispersion IV) Update

User avatar
Mario Tran Phuc
Posts: 158
Joined: Mon Nov 14, 2016 4:03 pm

Glass BSDF (Dispersion IV) Update

Post by Mario Tran Phuc » Tue Jul 25, 2017 4:39 pm

Custom Glass_Dispersion_IV.jpg
Custom Glass_Dispersion_IV.jpg (751.03 KiB) Viewed 2840 times
Latest Build:
Glass BSDF (Dispersion IV).cyg
(83.23 KiB) Downloaded 353 times

Hey together! Many of you probably have experienced that the default Glass BSDF of Cycles generates flat shadows, blocks light and reduces brightness of objects inside of the geometry.

Fortunately you can regain the light transmission and kill glass shadows with a common workaround adressing shadow rays with the light path node.

I found that you can get back the outer shadows with the transmission depth attribute but the shadows are still flat and miss a "realistic" shinethrough effect.

With the help of Raphael Rau ( http://www.silverwing-vfx.de/ ) I was able to create a "fake shadow falloff" to mimic the fresnel based light absorption of glass. The custom Facing Ratio group inside was kindly provided by Raphael (big thanks!).

Here a quick video tut about what this custom glass bsdf can do:
https://vimeo.com/227219575


Custom-Glass-comparison.jpg
Custom-Glass-comparison.jpg (855.07 KiB) Viewed 3258 times
Custom-Glass_fakeshadows_mtp_v001.c4d
(1.29 MiB) Downloaded 252 times
Glass BSDF (Custom).cyg
(36.98 KiB) Downloaded 194 times
This technique isn't that accurate as there is no easy way to connect the rgb curve with an IOR but with those few sliders you have some nice options to quickly art-direct the look of your glas.

Cheers,

Mario
Last edited by Mario Tran Phuc on Wed Aug 02, 2017 10:39 am, edited 22 times in total.

User avatar
Martin
Posts: 545
Joined: Sat Dec 17, 2016 12:03 pm

Re: Glass BSDF (Custom) for Fake Shadows

Post by Martin » Tue Jul 25, 2017 5:50 pm

Good one, big thanks!

heyBear
Posts: 181
Joined: Sun Nov 27, 2016 10:54 pm

Re: Glass BSDF (Custom) for Fake Shadows

Post by heyBear » Tue Jul 25, 2017 6:10 pm

That's a fantastic upload. Many thanks!

User avatar
Samurai JKM
Posts: 32
Joined: Fri Apr 28, 2017 8:36 pm

Re: Glass BSDF (Custom Timesaver)

Post by Samurai JKM » Tue Jul 25, 2017 9:09 pm

This is great stuff! Thanks

User avatar
Brandroid
Posts: 168
Joined: Thu Feb 23, 2017 8:48 pm

Re: Glass BSDF (Custom Timesaver)

Post by Brandroid » Wed Jul 26, 2017 2:21 pm

Super useful. Thanks Mario!

kasezo
Posts: 39
Joined: Mon Mar 13, 2017 5:36 pm

Re: Glass BSDF (Custom Timesaver)

Post by kasezo » Wed Jul 26, 2017 2:41 pm

looks very good. thank you.

docphibs
Posts: 28
Joined: Sat Nov 26, 2016 6:30 pm

Re: Glass BSDF (Custom Timesaver)

Post by docphibs » Wed Jul 26, 2017 9:22 pm

Raphael is a beast. Thanks so much for sharing.

docphibs
Posts: 28
Joined: Sat Nov 26, 2016 6:30 pm

Re: Glass BSDF (Custom Timesaver)

Post by docphibs » Fri Jul 28, 2017 3:35 pm

Man - I really wish I understood some of cycles math nodes more in depth. This is so confusing to me haha. :shock:

You may find my screen shot here hilarious but... I honestly don't get what's goin on just with these first three nodes... Someone explain the math behind this... why it's piped to a white to black value... and then subtracting the original ior again from that value.

Also confused how subtracting a color value from a numerical value... I would assume with that mixrgb that it would still equal ".45" there since it is pure white (1) and pure black (0).

I get extremely confused so quickly when it comes to math nodes... especially when I see them adding light paths. Especially when I've seen "maximum" used to operate on light paths.... anyways maybe this isn't the right spot for this but I figured since it's about this shader why not post it here.

Thanks guys!
Attachments
confused.PNG
confused.PNG (79.13 KiB) Viewed 2948 times

docphibs
Posts: 28
Joined: Sat Nov 26, 2016 6:30 pm

Re: Glass BSDF (Custom Timesaver)

Post by docphibs » Fri Jul 28, 2017 3:40 pm

... maybe i'm wrong... the mixrgb doesn't equal 0.45... it equals .55? since it's inverting the value from white to black, instead of black to white...

heyBear
Posts: 181
Joined: Sun Nov 27, 2016 10:54 pm

Re: Glass BSDF (Custom Timesaver)

Post by heyBear » Fri Jul 28, 2017 4:38 pm

I'd be interested to gain a better understanding of how those math nodes work too. It seems very counter intuitive.

User avatar
Mario Tran Phuc
Posts: 158
Joined: Mon Nov 14, 2016 4:03 pm

Re: Glass BSDF (Custom Timesaver)

Post by Mario Tran Phuc » Fri Jul 28, 2017 5:46 pm

docphibs wrote:
Fri Jul 28, 2017 3:40 pm
... maybe i'm wrong... the mixrgb doesn't equal 0.45... it equals .55? since it's inverting the value from white to black, instead of black to white...
heyBear wrote:
Fri Jul 28, 2017 4:38 pm
I'd be interested to gain a better understanding of how those math nodes work too. It seems very counter intuitive.
Hehe, those mixRGB nodes are only implemented so that i can use the Fac for slidding between 0-1 in the Nodegroup controls. (Also I haven't found an option to set input ranges yet) It's just to make it as easy to use as possible.

The first substract is used to start appearing the Fresnel Shadow when you go higher than IOR 1 otherwise it would have started at 0. The MixRGB j is ust to be able to use a Fac from 0-1. This part is works like a little pulley as the direct link to the IOR didn't have enough shadow intensity (used a visual reference)

User avatar
Martin
Posts: 545
Joined: Sat Dec 17, 2016 12:03 pm

Re: Glass BSDF (Custom Timesaver)

Post by Martin » Fri Jul 28, 2017 6:25 pm

Mario Tran Phuc wrote:
Fri Jul 28, 2017 5:46 pm
(Also I haven't found an option to set input ranges yet) It's just to make it as easy to use as possible.
These might help you.
And then you can steal sliders from other nodes for the main group if needed.
Attachments
Range Mapper.cyg
(8.62 KiB) Downloaded 39 times
Range Cut.cyg
(4.27 KiB) Downloaded 35 times
Range Mapper1.JPG
Range Mapper1.JPG (34.3 KiB) Viewed 2926 times
Range Mapper2.JPG
Range Mapper2.JPG (38.61 KiB) Viewed 2926 times
Last edited by Martin on Fri Jul 28, 2017 7:05 pm, edited 3 times in total.

docphibs
Posts: 28
Joined: Sat Nov 26, 2016 6:30 pm

Re: Glass BSDF (Custom Timesaver)

Post by docphibs » Fri Jul 28, 2017 6:41 pm

that link to the range mapper.cyg is broke :/

also thanks for the explanation i really appreciate it. I still have a lot to learn with this still.

User avatar
Martin
Posts: 545
Joined: Sat Dec 17, 2016 12:03 pm

Re: Glass BSDF (Custom Timesaver)

Post by Martin » Fri Jul 28, 2017 6:51 pm

docphibs wrote:
Fri Jul 28, 2017 6:41 pm
that link to the range mapper.cyg is broke :/
Try again.

docphibs
Posts: 28
Joined: Sat Nov 26, 2016 6:30 pm

Re: Glass BSDF (Custom Timesaver)

Post by docphibs » Fri Jul 28, 2017 7:08 pm

that did it - Thanks Martin!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest