Cycles: Materials, RGB Curves and PBR-rendering [UPDATED]

Since rgb curve manage amount of input and output color, is there some “coefficients for patches of reflected lights”? I mean amount of reflected light for any camera angle, for our material. So, we can set up a physically based material, which reflects light just like in real life. May be there are some curves settings for such materials as steel, already?

And if i want to create my own material, for example copper, where do i get its physical properties concerning light reflectivity, and how do i transform this properties into an RGB curve?

Rference IOR, nk, curves… http://refractiveindex.info/
Check Metal Shader @ Chocofur: https://chocofur.com/page/chocofur-metal-shader-for-blender-2-79

thank you.

Does it mean, that i can simply set up curves, like here


for Al (Aluminium) taking values from this diagram?


yup :D… was just as surprised, how easy it is to set up & achieve great results

Great! This is just so amazing that i’m totally happy ))

I’m confused about how this is supposed to work.

The optical constant reference tables/graphs given in the screenshot above appear to be plotting refractive index vs wavelength, whereas plugging the RGB curve into the layer weight slot mixing between glossy and diffuse gives reflectivity vs angle of incidence.

I don’t see how copying the curve from the optical constants graph into the RGB curves graph mimicks the physical reality of what that data is describing.

ups, my bad… am getting sloppy lately… i mimic the lower graph
http://i.imgur.com/NOVNzKx.png

also using Wavelength of 0.564 (as it’s used for TheaRenderer; don’t know what length to use for Cycles)

thanks for noticing moony

Makes much more sense now :smiley:

Hello again ) I see than refractive index site now has option “for 3D Artists”. Does it mean i can just select this option and material, and mimick my RGB Curves node according to curve represented in graph?

This approach works very good for plastics and any kind of material where the wavelength doesn´t influence the curve a lot.

For a lot of metals, esspecially things like copper where the shape of the reflectance curve is very dependant on the wavelength it makes sense to create three of these shaders - one with a completely red glossy shader, one with a completely green and one with a completely blue glossy shader and add these shaders together.

Each of the shaders is fitted with an RGB curve like you showed in the first post. Get the curve from at a red wavelength (around 0.685) and apply it to the red glossy shader. Do the same for the green and blue glossy shader (~0.532 and ~0.472) and you´ll get a pretty neat starting point for your metal shader.

You can either eyeball the curves or manually input Angle of incidence values on refractiveindex.info and copy the non polarized value to a point on your cuve. Note that you have to recalculate the value as the curve on refractiveindex.info goes from 0 - 90 while the RGB curve in Blender goes form 0 to 1. But usually eyeballing is enough.

Thank you. Do you have an example of such shader?
UPD:
I try to create my own.


Is it resemble copper?



I guess there are problems with roughness. May be there are correct physical values for this parameter too?

And still don’t understand how to translate 0-90 to 0-1, and need an example. But it is the end of a day and i’m too tired.

Using wavelength values for R-G-B from wavelength in nm to RGB/hexadecimal converter based on efg’s Computer Lab: Spectra:
R = 0.65 µm
G = 0.51 µm
B = 0.44 µm

*1 µm = 1000 nm

Inputting those values into http://refractiveindex.info/ wavelength and using the low end graph, taking into account only non-polarized values (green curve) for each color channel, this is the result (or by sliding on the curve and manually typing those entries into RGB Curves node):


This image is manipulated. Every curve represents non-polarized curves in respective color channel.

Translating angle (0-90°) to decimal (0-1) values one can use simple cross calculation as with calculating percentage. Example:
Looking for decimal value of 25° angle:

90° = 1
25° = x

90x=25 >>> x = 25/90 >>> x=0’27777…

So decimal value of 25° angle is 0’27777.

Here are comparative results (fresnel VS facing) to see what is correct based on measurements (facing looks correct - notice the reflectance on the edges 90°)
http://i.imgur.com/Jm85MWE.gif
There’s also noise added for roughness.
Here’s how nodes look:

… and here’s the LayerWeightFacing.metal+rough.IOR.RGB.curve.blend
Hope you can learn something.

@alive-one
you better use color mix instead of three diffuse shader, should mean less calculations.

@burnin
what?! hey why are you pluggin Generated texture coordinates (a vector output) into layer weight’s “blend” input? it’s nonsense to me. Actually unplugging it gives proper result

@alive-one
Use only non-polarized curve values
on IOR info page - for every color curve, input different wavelength values, so you get…

@lsscpp
Yes, proper way is NOT TO USE Texture Coordinate nodes.
It felt strange to me too, but visual results (node wrangler view) at that time was just the opposite (guess had some bug somewhere) now it works OK.
Edited post. Thanks.

Here´s the way I do it. Every Color (R,G and B) gets it´s own mix shader which consists of a glossy shader blended into a diffuse shader. This ensures that you get the reflective falloff right for every color. If you simply mixed the curves you´d get an average of the three falloffs. What you wan´t though is the three colors having different falloffs each.

The glossy and diffuse are blended via RGB curves which consist of values I get from refractiveindex.info at the wavelengths: R:685, G:532, B:472.
This example is copper from the 3D artist shelf, metals book, copper page on refractiveindex.info.
Only use the non-polarized curves (which btw are nothing else than the average of the two polarized curves).

The three mix shaders are then added to each other.

Don´t forget to set the Roughness to the same number in all shaders.

The material example ball on the left is the pure copper shader which I generated with the node tree shown bellow. The right example ball is the same shader only with a couple of procedural maps in the bump slots and some wear&tear and dirt&dust with the shininess attribute.

If this same thing can be done without using two shaders per color channel and if that method renders faster I´d be very interested.



1 Like

Hey Burnin, thanks for the wavelength to rgb converter and your setup.
I just tried your approach with putting all three curves into a single rgb curve node and it looks identical to my setup. It renders a bit faster (3:37 vs 3:58) and is a lot less cumbersome to set up.

I had tried using a curve node like you did before but with plugging it into the Frac of a mix node which mixed a glossy and a diffuse shader. It didn´t work of course because Frac only accepts a value and not a color/vector.

^Mathematically it makes no difference, only mechanically/processing wise is less intensive :wink:

Fac stands for Facing or “layer mixing” (A vs B ie: transparency, opacity) no vectors or colors could apply there without further math to exclude specific values.

I allways assumed it stood for “Factor”. Not sure how I managed to get that “r” into the equation, though. :slight_smile:

Lumpengnom it is a factor! (fac * closure + (1-fac) * closure)

i’ve created a node for this setup (but without the curve of course) just type the refractive index in and go! (maybe someone find this useful and burnin thx for the infos!)

screenshot:


nodes: