C4D: Custom (Conductive & Dielectric) Fresnel

comments 9

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


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!


Leave a Reply