Coatings with thickness and absorption, how to?

My method has just been using fresnel to mix base layer with top coat, but the base layer is further darkened by a constant (thickness) and angle (absorption) factor. But I think the real world is a bit more complicated than this, ref a couple of papers.

How far can we take this by only creating a top coating layer? Other than darkening by mix shading with nothing, no other effects should go on with the bottom layer. I basically just want a coating shader group I can insert between principled (and it’s broken top coat roughness anyway) and material output (additional utility nodes ignored).

Has anyone done this?

Has anyone tried to go all the way, affecting what happens to the bottom layer due to the transmissive effects of the topcoat?

Unfortunatelly is not that simple… for example, coating also changes the IOR of the bottom layer, so the coating layer must know the bottom layer configuration to make the correct changes. This can be done in OSL where you can see all the data that is transmited by the shader socket (i know that you don’t use it), or make a python node that can evaluate the bottom layer nodes and figure which changes must be done.

I assume you mean the change of interface? Like not being air/substance but coat/substance, changing the substances’ ior, thus changing its glossy contrib? Could we just modulate that on the substance specular (Principle’s specular socket)?

But when I look at surfaces with heavy coat, you can see that also the diffuse is darkened (not noticeable on thin coats, but I’m talking about 2-10mm coats - thick resin). Or am I just imagining this? Should I just treat it like a wet surface with darkened more saturated diffuse overall?

I’m hoping to create a node group I can insert, since the Principled coating roughness remain broken. And at that, maybe improve a little on it with darkening and thickness controls, but I’m not sure what rules to apply.

  1. Absorption isn’t linear. It’s an exponential function. Can’t remember exactly, I think it’s something like light making it through an absorptive layer is proportional to e^-distance.

  2. If you want to try to create pseudo-thickness, the angle is best captured by distance=thickness/abs(dot(incoming, normal)). This isn’t real-- it doesn’t capture occlusion or curvature, so it gives you infinity where incoming dot normal = 0. It’s accurate for an infinite plane viewed from any angle, not a real mesh. Note also that smooth shaded models can have a silhouette with negative incoming dot normal, which pushes the thickest part of the coating slightly off the silhouette, where it doesn’t belong, but as your vert count approaches infinity, that problem goes away.

In reality, a clearcoat layer has actual volume; a better representation would use a displaced copy of the mesh. In addition to absorbing light, its specular also casts shadows on the underlying mesh. And any clearcoat layer thick enough to worry about absorption + angle also has noticeable refraction effects that can’t be hacked in.

Actually mapping out the thickness of a clearcoat layer (taking into account curvature + occlusion) would require at least a 4D texture. Not very practical.

Not sure about how to do IOR differences with principled / Blender style Fresnel. I tend to use Schlick Fresnel ( https://en.wikipedia.org/wiki/Schlick's_approximation ) to feed a manually-built mix, and if you do that, you can specify both IOR (underlying surface) and medium IOR (clearcoat) for purposes of the underlying Fresnel.

I’ve no idea. I don’t think we could, but i’m no expert on the Principled Shader (nor a fan).

It might be darker, but it also can be lighter… depends on the angle between the Incoming and the outgoing rays. With bigger angles less light is reflected, and low angles reflect more light (coating can make the bottom layer to have some retroreflectancy, thought very diffuse).
Of course this depends also in other factors, like the porosity of under substance,

With nodes alone, I don’t think you can create such a setup. It depends on the changing attributes of the bottom layer, and that means understanding the properties of it. (using the porosity as example, there’s not really a way to analyse some node_tree and figure which values are related to porosity, and therefor no fixed rule to tweak those values).

Again, this is a bit easier in OSL, or by using python to rebuild the node_tree… but either way are difficult to have some universal coating shader. :frowning:

The optics are almost the same as a (the) thinfilm shader does.correct me if i am wrong,but the clearcoat ior and the substrate doesent change.these are constant ,why should it change?.what change is the transmitted light result from the phase function.with the thinfilm math you can calc( by given clearcoat ior )how much refraction (based on view angle)you get,and how much transmission.
then the transmissed light gets a colorshift based on wavelength and thickness,simple sayed.

and about darken effect.a car coating that looks darker at grazing angles is called flip flop effect or coating.the effect is build from the flat pigment and particles in the substrate color.if you look from the side you see the edges from the flat particles,that makes the color appear darker,vs if you looking a 0 degrees you see the flat particles (maybe metallic)that reflects them more at that angle.(like little micro mirrors,or pigments)

you can fake the darken (high flop)effect simply with a color mix rgb and the fac driven by a costum ior curve as example.this color result put into your principled shader color input.

on top you can make a mix shader with ior or curve node as fac with your shader and glossy shader for clear coat as usally.

But it does change… IOR are constant when the material interfaces with vacuum and we normally simplify by letting air to have the same ior as vacuum… But when we have an interface with another substance, the result ior of our bottom material is divided by the ior of the coating layer.
That’s why optic fibers use coatings with an ior different from the kernel ior, or why air under water has an ior of ~0.75.

This got way more complex than I intended. Principled doesn’t simulate coating thickness in any shape or form, you have to do that on the parameters driving it I guess. But pxrsurface does have a thickness parameter.

I just want to darken the principled based on some coating thickness parameter. I’m asking is it safe/reasonable/plausible to add a portion of it from a constant thickness factor and another portion of it based on angle. I did finish this setup at home yesterday, but I don’t have it available here.

sure,as i have written.

the color mix rgb for the darken efffect for the substrate/colorpaint ,and then a mix shader with glossy for clear coat on top.

you can make the mix rgb fac angle based,with a ior or a custom curve ect.you can use even a formula to fake absorption as fac.but on a coating this seems to be overkill,the distance is to small and overall almost the same thickness,that absorption variations are hardly very visible.except for thinfilm effect,there you get color changes with different thickness.

what you describe is what happens to the lightray.i agree then.but not to the material,the ior from air is roughly 1 and water 1.33 if it hits the ground of sand maybe with ior 1.5 reflects back through the water 1.33 and exit in the air with ior 1 again.in between the lightray gets reflected,refracted transmissioned,absorbed/scattered ect and then the way back to the exit.but there is no ior change.unless you mean the same, if the light travels trough different materials it travels trough differend ior and hit different ior,then yes.

optic fibers materials makeing the use of total internal reflection,to get almost no signal loss.

It’ll be a hack, but everything in CG is a hack anyways. Like rasterizer refraction, it’s something that will behave properly given certain meshes and certain camera angles, but not given others.

Well, there’s no bending of the light ray, but CG lighting isn’t realistic anyways; there’s no such thing as a “diffuse photon” in reality. But it affects the fresnel. Something opaque, at 1.33 IOR, submerged in something with 1.33 IOR, will have no specular. The same object in a 1.0 IOR medium will reflect. This is why we don’t see the individual layers of real-life laminate: there is no IOR transition between the layers, only at the top where it meets air (or whatever).

if you have a equation from the physic optics ,then you can render it.of course if a render engine should behave as real lightwaves then the renderengine should do calculations with waves.

for the most part the fresnel is enough to look realistic for reflections,except for some engine limitations as gratings or microroughness ie.

to make a fake/approximate absorption clear coat/car paint is simple,it depents what exactly you want to archieve,and how accurate should it be.

about the laminate.these are all developed and researched methods,specialy with clear coats.in the car industry mercedes benz has some special clear coat with ior higher than 2 to give the carpaint a even shinier reflections.