Advertisement

You're blocking ads, which pay for BlenderNation. Read about other ways to support us.

Blender 3D tip — Realistic Specular value in Principled shader

11

Metin Seven writes:

I love Blender 3D. It's a deservedly popular and successful open source 3D editor. Together with ZBrush it's my most important tool for 3D creation. Since version 2.79 Blender includes the Principled shader, enabling you to create most material types using a single shader node. I'm happy to share a little tip for a slightly more realistic result.

The reflectivity of a material created with the Principled shader node is usually a balance between three values: Specular, Roughness and IOR. IOR is an abbreviation of Index Of Refraction, and indicates how much light rays are bent when they are reflected or refracted.

Every material has an average IOR value. For really accurate results each wavelength of a real-world material has its own IOR value, but an average IOR value usually suffices in the world of 3D.

Higher IOR values increase the light bending effect. In the case of reflections, this causes a surface to generally become more reflective. For example, shiny metals usually have a higher average IOR value than plastics.

A great online resource of IOR values for all kinds of materials is the IOR List at Pixel and Poly.

The Specular value of Blender's Principled shader is usually left to the default value of 0.5, but for a more realistic result there's a formula to make the Specular value realistically interact with the IOR:

  • Specular = ( ( IOR − 1 ) / ( IOR + 1 ) ) ² / 0.08

Some examples, applying this formula:

  • Water: IOR = 1.33, Specular value = 0.25
  • Glass: IOR = 1.5, Specular value = 0.5
  • Diamond: IOR = 2.417, Specular value = 2.15

To automate this formula for the Principled shader I've made a little node setup that processes an IOR input value to the correct Specular value:

As shown in the screenshot:

  1. Group the formula node setup to a single group node with a value input slot, and label it 'IOR to Specular'.
  2. Connect the IOR to Specular formula node group to the Principled shader's Specular input slot.
  3. Connect an Input ➔ Value node to both the node group's input slot and the Principled shader's IOR input slot. For clarity, enter 'IOR' as the Value input node's label.

For clarity: this node setup translates a material's IOR value to the Principled shader's Specular value, while the Principled shader's own IOR value only applies to refraction (the Transmission setting in the shader), but it's convenient to already plug the IOR value into the IOR slot as well, in case you want to add refraction (Transmission).

Now all you have to do is look up the correct IOR value for each of your materials and enter that in the IOR Value input node. Note that you'll still need to adjust the Roughness value, but this node setup adds a little bit of realism to the Principled shader.

Below you can see two test renderings I made using Blender's Suzanne test-monkey, with a Roughness value of 0.5. As you can see, the interaction between the IOR value and the Specular value causes a sheen of specularity to appear, without using the Principled shader's Metallic or Sheen option.

Metin Seven, metinseven.nl

About the Author

Metin Seven

Dutch illustrator and 3D designer ( metinseven.nl ). Former Blender Technical Artist, news cartoonist, comic creator, TV show animator, magazine editor and 16-bit game developer.

11 Comments

  1. How would you handle a multi material shader?
    With a si gel image you can have metal and dielectric materials with différents roughness values.

    Can a b&w image be translated in différents Ior values?

    • I guess, if you want to translate a b&w image to IOR values it depends on how you want it to be translated:

      If somehow linear, like grey values from black to white should result in IOR values of 1 to 2 for example, then the easiest way would be to take the b&w image and add 1 with a math node. Or if they should maybe translate to IOR values of 1.2 to 3.0, then the operation would be b&w * 1.8 + 1.2 to get the IOR.

      More difficult would it be if you want to translate the b&w image non-linear, like black should be 1.33, white is 1.45, a grey value of 0.5 is an IOR of 2, a grey value of 0.7 is an IOR of 1.24 and so on.

  2. Michael Gembicki on

    Why do you need the value node, won't it just be an unconnected socket number field that you can change on the node group node?

Leave A Reply

To add a profile picture to your message, register your email address with Gravatar.com. To protect your email address, create an account on BlenderNation and log in when posting a message.

Advertisement

×