Car Paint nodes explanation
Posted: Wed Mar 09, 2016 1:33 am
Hi all,
By request of Lightwave3D (the Kray user, not the software), I'll share a little "car paint" nodes setup here. Let's start simple and expand on this in next steps. The result of this first step is shown here: Okay now. Nodes always look complicated at first, but when you start to break things down into smaller components they are usually fairly easy to follow. Let's give it a try!
Basically what is going on in car paint is that you have a top coat of glossy varnish, and underneath is a paint coat in the color of the car, often in metallic paint. The top coat is very glossy, and the bottom paint looks very "matte", or with a very blurry reflection.
Explaining this in another way: a ray of light hits the top varnish coat of the car first. This coat is transparent, so the situation is simple: a part of the light is reflected, and the part of light that is not reflected is allowed to continue on and hit the second layer, the paint coat.
So let's recreate this using nodes!!!
First of all, you'll see in the node tree, that there is a ClearCoat fresnel calculation on top. This give the correct amounts of reflection for the glossy top coat, with an index of refraction of 1.45. The ClearCoat reflection is perfectly sharp, so we create a reflection "shader", and we multiply the fresnel value with the reflection shader (of the ClearCoat) which results in the correct total reflection for the glossy topcoat.
Let me explain a bit more why I work like this. The fresnel value tells lightwave HOW MUCH reflection there is for a given spot on our object, but not how sharp or blurry the reflection is. The reflection shader tells lightwave HOW SHARP the reflection is for a given spot (and how it is colored, and how much glancing stretch if you use this), but not how much reflection there is. To get the final reflection, you need to multiply HOW the reflection looks with HOW MUCH reflection there is. That is what the "ClearCoat Total Reflection" multiplier does. This multiplier is a VECTOR multiplier, because the reflection shader expresses a color value (RGB), and if a value has more than 1 component, you need to use a vector multiplier instead of a simple scalar multiplier.
Okay, now let's do exactly the same thing for the paint layer that lies under the glossy topcoat (the ClearCoat):
Create a Fresnel node ("Paint Fresnel"), with a value of 2.2 for a nice metallic reflection value, and create a reflection shader ("Paint Reflection (Blurry)") with blurriness set nice and high. I use the reflection shader from DP Kit, and I suggest you do the same because it allows you to set the number of samples you want to use, which is always handy. I set the blur amount to 250% and samples to 10. If you use the native LW reflection shades I think blurriness of 60% is okay (the value for the DP Kit reflection shader always needs to be a lot higher for the same effect).
Then, turn on the "tint refractions" for the reflection shader of the paint (I know, that should be "tint reflections" but it's spelled wrong in the node), and create a color node with the paint color. Then connect this paint color node ("Paint Color" in my setup) to the color input of the reflection shader for the paint. Now, as we did for the clearcoat layer, use a vector multiplier node to multiply the AMOUNT of the paint reflections with the SHADING of the paint reflections ("Paint Total Reflection").
Okay, now we have TWO reflections: one for the top glossy clearcoat, and one for the paint coat. We are going to add these two together, but first we need to make one more change to keep things "physically accurate", sort of:
The top coat get 100% of the light that falls on the surface. The paint coat however, does not get all of the light, because a part is reflected on the top coat. This means that only the part of light that is NOT reflected from the top coat goes on to the lower paint coat! Luckily the fresnel node has a handy "Inverse" output, that outputs the inverse of the reflection value, and this is the amount of light that goes on to the paint coat. If, for a given spot on the surface, the top coat reflection is 20%, then 80% of the light goes on to the paint coat. In this situation the fresnel result for the top coat would be 0.2 and the inverse would be 0.8. Since only the 80% (in this case) goes on to the paint coat we need to multiply the light going to the paint coat by 0.8.
This is hard to do with nodes, but that is no problem: we can also just multiply the output of the paint coat by 0.8, or better said by the inverse of the top coat fresnel value (since this means "the amount of light not reflected, so going through to the paint coat").
So, we need to multiply both the "Paint total reflection" node, and the inverse value of the "Paint Fresnel" node by the inverse of the ClearCoat fresnel. By the way: the top coat was 100% transparent, so there the inverse fresnel value meant how much light was let through the transparent coat. The paint coat is 100% opaque, so here the inverse fresnel means the diffuse value (= everything that is not reflected).
And that's about all I need to explain. So the paint fresnel INVERSE value (= the paint diffuse component) is multiplied by the ClearCoat inverse fresnel value, and the the paint total reflection is also multiplied by the same ClearCoat inverse fresnel value. The diffuse value can use a simple scalar multiplier, because it multiplies two scalars, but the "paint total reflection" is in RGB value so needs a vector multiplier.
Then the end is simple! Connect the base paint color to the color input of the final Surface node of the material, connect the multiplied diffuse of the paint coat to the diffuse input of the surface, connect a scalar 1 value to the reflection input of the surface node, and add the ClearCoat Total Reflection and the multiplied Paint Total Reflection (= "Paint Reflection * "rest" lighting) with a vector add node, and connect this last one to the Reflection shading input of the surface.
That's it! My fingers are tired
Object, scene and surface attached. Any questions?
By request of Lightwave3D (the Kray user, not the software), I'll share a little "car paint" nodes setup here. Let's start simple and expand on this in next steps. The result of this first step is shown here: Okay now. Nodes always look complicated at first, but when you start to break things down into smaller components they are usually fairly easy to follow. Let's give it a try!
Basically what is going on in car paint is that you have a top coat of glossy varnish, and underneath is a paint coat in the color of the car, often in metallic paint. The top coat is very glossy, and the bottom paint looks very "matte", or with a very blurry reflection.
Explaining this in another way: a ray of light hits the top varnish coat of the car first. This coat is transparent, so the situation is simple: a part of the light is reflected, and the part of light that is not reflected is allowed to continue on and hit the second layer, the paint coat.
So let's recreate this using nodes!!!
First of all, you'll see in the node tree, that there is a ClearCoat fresnel calculation on top. This give the correct amounts of reflection for the glossy top coat, with an index of refraction of 1.45. The ClearCoat reflection is perfectly sharp, so we create a reflection "shader", and we multiply the fresnel value with the reflection shader (of the ClearCoat) which results in the correct total reflection for the glossy topcoat.
Let me explain a bit more why I work like this. The fresnel value tells lightwave HOW MUCH reflection there is for a given spot on our object, but not how sharp or blurry the reflection is. The reflection shader tells lightwave HOW SHARP the reflection is for a given spot (and how it is colored, and how much glancing stretch if you use this), but not how much reflection there is. To get the final reflection, you need to multiply HOW the reflection looks with HOW MUCH reflection there is. That is what the "ClearCoat Total Reflection" multiplier does. This multiplier is a VECTOR multiplier, because the reflection shader expresses a color value (RGB), and if a value has more than 1 component, you need to use a vector multiplier instead of a simple scalar multiplier.
Okay, now let's do exactly the same thing for the paint layer that lies under the glossy topcoat (the ClearCoat):
Create a Fresnel node ("Paint Fresnel"), with a value of 2.2 for a nice metallic reflection value, and create a reflection shader ("Paint Reflection (Blurry)") with blurriness set nice and high. I use the reflection shader from DP Kit, and I suggest you do the same because it allows you to set the number of samples you want to use, which is always handy. I set the blur amount to 250% and samples to 10. If you use the native LW reflection shades I think blurriness of 60% is okay (the value for the DP Kit reflection shader always needs to be a lot higher for the same effect).
Then, turn on the "tint refractions" for the reflection shader of the paint (I know, that should be "tint reflections" but it's spelled wrong in the node), and create a color node with the paint color. Then connect this paint color node ("Paint Color" in my setup) to the color input of the reflection shader for the paint. Now, as we did for the clearcoat layer, use a vector multiplier node to multiply the AMOUNT of the paint reflections with the SHADING of the paint reflections ("Paint Total Reflection").
Okay, now we have TWO reflections: one for the top glossy clearcoat, and one for the paint coat. We are going to add these two together, but first we need to make one more change to keep things "physically accurate", sort of:
The top coat get 100% of the light that falls on the surface. The paint coat however, does not get all of the light, because a part is reflected on the top coat. This means that only the part of light that is NOT reflected from the top coat goes on to the lower paint coat! Luckily the fresnel node has a handy "Inverse" output, that outputs the inverse of the reflection value, and this is the amount of light that goes on to the paint coat. If, for a given spot on the surface, the top coat reflection is 20%, then 80% of the light goes on to the paint coat. In this situation the fresnel result for the top coat would be 0.2 and the inverse would be 0.8. Since only the 80% (in this case) goes on to the paint coat we need to multiply the light going to the paint coat by 0.8.
This is hard to do with nodes, but that is no problem: we can also just multiply the output of the paint coat by 0.8, or better said by the inverse of the top coat fresnel value (since this means "the amount of light not reflected, so going through to the paint coat").
So, we need to multiply both the "Paint total reflection" node, and the inverse value of the "Paint Fresnel" node by the inverse of the ClearCoat fresnel. By the way: the top coat was 100% transparent, so there the inverse fresnel value meant how much light was let through the transparent coat. The paint coat is 100% opaque, so here the inverse fresnel means the diffuse value (= everything that is not reflected).
And that's about all I need to explain. So the paint fresnel INVERSE value (= the paint diffuse component) is multiplied by the ClearCoat inverse fresnel value, and the the paint total reflection is also multiplied by the same ClearCoat inverse fresnel value. The diffuse value can use a simple scalar multiplier, because it multiplies two scalars, but the "paint total reflection" is in RGB value so needs a vector multiplier.
Then the end is simple! Connect the base paint color to the color input of the final Surface node of the material, connect the multiplied diffuse of the paint coat to the diffuse input of the surface, connect a scalar 1 value to the reflection input of the surface node, and add the ClearCoat Total Reflection and the multiplied Paint Total Reflection (= "Paint Reflection * "rest" lighting) with a vector add node, and connect this last one to the Reflection shading input of the surface.
That's it! My fingers are tired

Object, scene and surface attached. Any questions?