We all know that object reflection depends on the viewing angle and going from 0° to 90° we can observe that it is growing in intensity. This change in reflectivity peaks at 90° when any surfaces reflectivity becomes 100%. This is by no means a linear transition but let's stay away from the shitty math for now (we will get this opportunity a bit later, though).
Let's now define what the term F0, usually used in game engines, means: F0 corresponds to objects reflectivity at a 0° viewing angle, is measured in percentage and its scale can go from 0 to 1(for example an F0 of 0.4 means 40% reflectivity). Up until now, we have been working with IOR (index of refraction) and Fresnel IOR and most of the time we tend to use the same figure in both slots (IOR and Fresnel IOR, in general, aren't exactly the same but for the purpose of this text, we will leave them at that). F0 is quite more appropriate for working with reflections and we can easily convert it to IOR or vice versa with a formula:
IOR = (1+sqrt(F0)) / (1-sqrt(F0))
F0 = ((absolute value((IOR-1) / (IOR+1)))^2)
So if an object reflects ~ 5% (Polycarbonate Plastic) at the 0° viewing angle its F0=0.05 so respectively its IOR=1.58 - this is the number we can now put in the Fresnel IOR slot.
We can also us a colour in the IOR slot and to find out its value we have to determine what's called a 1/IOR. This is more or less self-explanatory - we divide 1 by the IOR we just found out (1/1.58) and end up with 0.63 (which is a colour value in floating point). In the end, we can also find the colour in RGB simply by multiplying our 1/IOR by 255 - we end up 161,161,161 as our RGB representation of F0.
So for PolyCarbonate Plastic (PC) we have:
Lets take those calculations for other material like the Iron:
(F0 can be found in the Refractive Index Database where it's called R in Reflection Calculator Section) At the bottom, you can find a Google Sheet with some math already done for you.
So why for the love of god do we need all this math? We are artists, alright but we work with computers and they see the world in numbers. We are striving to make photorealistic CG, so we need to understand how these computers operate and from time to time to do a few simple equations.
Let's have another bite of theory and we can afterwards see how we can use our maths in practice.
We need to first understand how the Reflect slot works and what it does in combination with Fresnel Reflections turned on.
If we input an RGB value of 255.255.255 (pure white) in the Refl. slot our material will reflect 100% at 0° (F0=1) and 100% at 90° viewing angles. If we instead input 128.128.128 (mid gray) we will get 50% reflectivity at 0° but also 50% at 90°. We already know that all surfaces become 100% at a 90° viewing angle which means the last material we've made is not physically correct. If we try the same procedure with Fresnel Reflections enabled we will find that our Reflection colour acts in the same way - it can be explained as a filter that is applied atop the IOR. There are occasions where we will need a different reflection colour than pure white for example when we try to replicate dirt, dust, fur or some SSS effect, but the conclusion is that most of the time we can keep our reflection colour at pure white for the reflective surfaces.
Let us now finally apply some of our new knowledge into something practical and create this simple material.
We will focus mainly on the process of replicating adequate reflection properties.
We are going to observe 5 (+1 bonus) ways to build it (will not upload separate previews as they look almost the same):
Falloff Map in the Reflect Slot
We disable Fresnel Reflections and put a Falloff Map with a curve* similar to the curve in the Refractive Index Database (after we input a Wavelength number of 0.55 we can find the reference for the curve in the "Reflection Calculator" tab of the site - we are looking at the non-polarised/green curve only). We also need to CC the Falloff Map with a gamma of 2.2 since we are using Linear Workflow tick-box in V-Ray (and it doesn't apply gamma correction to Falloff Maps). We then mix the two Falloffs with a Mix Map so we can have two distinct materials.
*Note that we actually have a Falloff Map with two Output Maps. It's just a preference of workflow but in this case, I'm using a standard Falloff Map and then apply the curves in separate Output Maps. You can alternatively use just two Falloff Maps while editing the output curve inside of them.
VrayFakeFresnel Map
Similar to the previous example but instead of using a Falloff Map we are now using VrayFakeFresnel Map which also needs to be CC'd with gamma 2.2.
IOR
Another way to approach the creation of this material is by using an Output Map. We need to put a pure black and white mask here for this workflow to work properly. Then we need to enable the Colour Map in our Output and adjust the Black and White points which will correspond to the black and white areas in the mask we've applied. So let's say we have an IOR of 6.17 for the black areas in our mask - our Black Point just needs to move vertically then from 0 to 6.17. For our IOR of 1.57 for the white areas we do the same procedure - just select the point and move it vertically from 1 to 1.57. Finally, we connect this Output Map to the IOR map slot. Don't forget to enable Fresnel Reflections (keep the link on, otherwise the IOR slot will only work for the Refractions).
Alternatively, we can use a Mix Map with two VrayColorMaps where we can directly type the IOR values in the R, G and B channels (second image).
The only issue here is that the IOR Map in both cases is not human readable and it can't be baked (except if you save it in floating point format like .exr or .hdr)
1/IOR
Again, very similar to the previous example but instead of using IOR values we now use 1/IOR values. In other words, the Black and White points in our Output Map will be respectively 0.16 and 0.63. Same goes for the RGB values in our VrayColourMaps if we use the Mix Map method mentioned above. This time we can even loose these VrayColourMaps and just use the colour slots of the Mix Map - we just need to convert our 1/IOR values to RGB values (in our case 40,40,40 and 161,161,161). The most significant difference with the aforementioned method, however, is that now we put our map in the Fresnel IOR slot (don't forget to unlink it to enable it), the reason being that when using values below 1 in the IOR slot it breaks. We now also create a human readable map which can be baked and saved as an 8bit image.
VrayBlendMtl
Basically, this is the most logical way in terms of real life - we make two different materials which are then blended with a mask. For this example, materials can be made with a Falloff Map or by using IOR as the important part here is the process of blending.
1/IOR baked (extra one):
Same method as 1/IOR but this time texture maps are rendered in separated PNGs or JPEGs. In theory, this way helps save some RAM, gives faster render times and in general speeds things up (for example we have no need of the VrayBumpTexture now). On the other hand, we lose some flexibility. Maps come baked like this from Substance Designer. Painter, Mari or other external texturing/painting software.
Which one to use?
Whichever you like... but keep in mind that 1/IOR is getting more and more popular these days - Substance Painter/Designer and other similar programs work with it. You need it for converting Metalness maps to work in Vray, so get used to it.
Bottom line notes:
All of these methods produced very similar end results but quite different previews in the material editor. :)
If you would like to add some colour in the reflection (for materials like Gold or Copper) put it in the Reflection Slot. If you are using IOR methods be careful to always keep the Value in HSV to 255 or insted one of the RGB channels to 255 for correct 90° reflections.
Maps, Previews and Shader trees and material library.
Best Regards
Rostislav M.
Version 1.0