C4D: Custom (Conductive & Dielectric) Fresnel

comments 9
Resources

Ever wondered how to get conductive Fresnel inside of Cinema 4D? Ever wondered what conductive Fresnel is after all? Look no further – we’ve got you covered.

Fresnel – that formula that drives the behaviour of reflections in Plastic, Glass, Paint – heck anything glossy. It was discovered by a french guy called Augustin Jean Fresnel and basically says “a given substance will reflect more light at a higher angle of incidence” or: “Use Fresnel’s formula to make things reflect more around the edges” (grossly oversimplifying here…).

Funny thing about Fresnel: There is actually more than one way to calculate that amount of reflected light. And the two main cases are for conductive (this will conduct electricity) and dielectric (this won’t conduct electricity) materials. The case we all know is the dielectric Fresnel. It’s awesome when modeling plastic, glass, porcellain or even shiny wood. But what about trying to set up copper, aluminum or gold with a fresnel shader?

It simply isn’t possible with the built in tools in Cinema 4D (at least not when relying purely on the tools that you’ll find in the material system). Even worse there also isn’t any conductive Fresnel in Octane. Xpresso and python to the help. What Octane allows you to do is to take a Falloff node, set it’s index to 1.0 (thus it becomes a linear falloff) and drive a gradient with this Falloff. What you have to “just” do now is set up your gradient so it drives the Falloff’s values according to the Fresnel formula.

Thankfully I didn’t have to come up with the algorithm to generate that gradient ramp. All I had to do was port it to Python & Xpresso. And here it is – I also included some presets. If you wanna dive into the code: It lives inside that Xpresso tag and inside those two python nodes. The first one is just there to take care of the preset values. The second node is where the actual calculation of the gradient happens.

If you’d like to look up complex Fresnel values, head over to refractiveindex.info. The values you wanna keep an eye out for are these:

n,k for these Wavelenghts:
Red: 680nm
Green: 530nm
Blue: 470nm

Download .c4d project file

Download .c4d project file – Version with added gamma slider. Default gamma is 2.2

Screenshots

Custom_Fresnel__0006_Layer 1
This is what you see when opening the project. Look out for the null with that Xpresso tag.

Custom_Fresnel__0005_Layer 2
Yes. This one.

Custom_Fresnel_closeup__0003_Layer 2
On the top you’ve got some preset Values to chose from.

Custom_Fresnel_closeup__0002_Layer 3
Metals. Mostly.

Custom_Fresnel_closeup__0001_Layer 4
If you like to fiddle around with the conductive Fresnel – tick this checkbox and go wild with the n&k values.

Custom_Fresnel_closeup__0000_Layer 5
Tick the last checkbox to get a standard (boring) dielectric Fresnel.

Custom_Fresnel__0001_Layer 6
This part is there purely for the preset values.

Custom_Fresnel__0000_Layer 7
And this is where all the calculations happen.

Liked it? Take a second to support Moritz on Patreon!
Become a patron at Patreon!

9 Comments

  1. David Gruwier

    Tthe ability to use real world wavelengths is neat, and this is useful in Octane. However, since R16 you’ve been able to do conductive fresnels using reflectance. You have to rely on the presets, and it only works with the built-in renderer, but it’s there.

    You can also use a falloff shader inside a filter shader, then match the RGB curves to those found on refractiveindex.info, which is not very accurate but will at least get you there.

    So it’s certainly to do conductive fresnel with built-in tools 😉

  2. This looks like a great tool, thanks for sharing! Can this be translated to Arnold using the Facing Ratio?

  3. iNevestenko

    Thanks! Can this be translated to Corona or Standart Render C4D?

  4. You can definitely do this in C4D by default- just add any non-legacy layer to the Reflectance channel and scroll down to “Layer Fresnel” and it’s all in there. Still a very helpful tutorial though thank you!

    • Cool! But I am not 100% sure if you could use Reflectance Channels in Octane Shaders. Any thoughts on that? Thx for the hint!
      Cheers,
      Mo

  5. This is so interesting and useful blog about custom conductive dielectric fresnel. This is really a informative blog for all peoples who wants to know about this. Thanks for sharing with us.

Leave a Reply