Skip to main content
added 204 characters in body
Source Link
tempdev nova
  • 1.6k
  • 8
  • 31

Edit: The above described mathematics are correct however I noticed, that when you multiply specular by 0.08 the right sites of both equations are equal, so we get the identity F(0)=0.08*specular.

You can implement these equations using math nodes.

You can implement these equations using math nodes.

Edit: The above described mathematics are correct however I noticed, that when you multiply specular by 0.08 the right sites of both equations are equal, so we get the identity F(0)=0.08*specular.

You can implement these equations using math nodes.

Mod Moved Comments To Chat
deleted 10 characters in body
Source Link
tempdev nova
  • 1.6k
  • 8
  • 31

But if you look very very closely you may notice some aliasing at the borders between metallic and dieletric parts, why is that? As you can see in my node tree I used a value of 0.2 in my greater than node which is the condition to determine whether or not a material is dielectric or metal. Remember how I said that dielectrics have F(0) values ranging between 0.04 and 0.08 and metals have F(0) values ranging between 0.6 and 1? So there should be kind of a forbidden zone between 0.08 and 0.6, which are values usually only semiconductors have. However this is only true for the physical properties of materials. When taking a picture we only have a finite resolution, that is a pixel is actually going to cover a whole area of the material. In this area there may be both dieletrics and metals. The F(0) values of the pixel is usually just the average value of these two components weighted by the area of the pixel they cover, which means that even in physically "correct" images we may get values in the forbidden zone. That means finding out what pixel is metal or not is actually always fiddly and sometimes even impossible. You can of course adjust the value in the greater node to have the least aliasing visible. This

This issue with the finite resolution of the camera is also why metalness maps have values between 0 and 1. Since the Principled BSDF just lerps between (mixes) two different shaders; one for dielectrics and one for metals, a value of 0.3 doesn't mean that a material somehow something exotic that is neither a metal nor a dielectric. It also doesn't mean that the material is a semiconductor, in fact almost all CG software including Blender ignore the existance of semiconductors. It It actually just means that a pixel is covering 30% metal and 70% dielectric. Due to the slight discrepancy between the pixels we compute as metalic and the ones that are actuallyactual metallic values we get aliasing at the borders.

ThereBut there is a way to reducaereduce that aliasing drastically however! If you have the corresponding metalness map to a set of specular maps you can actually use that instead of computing the metalness, but don't expect the aliasing to go away completely.

But if you look very very closely you may notice some aliasing at the borders between metallic and dieletric parts, why is that? As you can see in my node tree I used a value of 0.2 in my greater than node which is the condition to determine whether or not a material is dielectric or metal. Remember how I said that dielectrics have F(0) values ranging between 0.04 and 0.08 and metals have F(0) values ranging between 0.6 and 1? So there should be kind of a forbidden zone between 0.08 and 0.6, which are values usually only semiconductors have. However this is only true for the physical properties of materials. When taking a picture we only have a finite resolution, that is a pixel is actually going to cover a whole area of the material. In this area there may be both dieletrics and metals. The F(0) values of the pixel is usually just the average value of these two components weighted by the area of the pixel they cover, which means that even in physically "correct" images we may get values in the forbidden zone. That means finding out what pixel is metal or not is actually always fiddly and sometimes even impossible. You can of course adjust the value in the greater node to have the least aliasing visible. This issue with the finite resolution of the camera is also why metalness maps have values between 0 and 1. Since the Principled BSDF just lerps between (mixes) two different shaders; one for dielectrics and one for metals, a value of 0.3 doesn't mean that a material somehow something exotic that is neither a metal nor a dielectric. It also doesn't mean that the material is a semiconductor, in fact almost all CG software including Blender ignore the existance of semiconductors. It actually just means that a pixel is covering 30% metal and 70% dielectric. Due to the slight discrepancy between the pixels we compute as metalic and the ones that are actually metallic we get aliasing at the borders.

There is a way to reducae that aliasing drastically however! If you have the corresponding metalness map to a set of specular maps you can actually use that instead of computing the metalness, but don't expect the aliasing to go away completely.

But if you look very very closely you may notice some aliasing at the borders between metallic and dieletric parts, why is that? As you can see in my node tree I used a value of 0.2 in my greater than node which is the condition to determine whether or not a material is dielectric or metal. Remember how I said that dielectrics have F(0) values ranging between 0.04 and 0.08 and metals have F(0) values ranging between 0.6 and 1? So there should be kind of a forbidden zone between 0.08 and 0.6, which are values usually only semiconductors have. However this is only true for the physical properties of materials. When taking a picture we only have a finite resolution, that is a pixel is actually going to cover a whole area of the material. In this area there may be both dieletrics and metals. The F(0) values of the pixel is usually just the average value of these two components weighted by the area of the pixel they cover, which means that even in physically "correct" images we may get values in the forbidden zone. That means finding out what pixel is metal or not is actually always fiddly and sometimes even impossible. You can of course adjust the value in the greater node to have the least aliasing visible.

This issue with the finite resolution of the camera is also why metalness maps have values between 0 and 1. Since the Principled BSDF just lerps between (mixes) two different shaders; one for dielectrics and one for metals, a value of 0.3 doesn't mean that a material somehow something exotic that is neither a metal nor a dielectric. It also doesn't mean that the material is a semiconductor, in fact almost all CG software including Blender ignore the existance of semiconductors. It actually just means that a pixel is covering 30% metal and 70% dielectric. Due to the slight discrepancy between the pixels we compute as metalic and the actual metallic values we get aliasing at the borders.

But there is a way to reduce that aliasing drastically! If you have the corresponding metalness map to a set of specular maps you can actually use that instead of computing the metalness, but don't expect the aliasing to go away completely.

added 4004 characters in body
Source Link
tempdev nova
  • 1.6k
  • 8
  • 31

So what is the correct way to do it? TheSo what is the correct way to do it?

The correct way to do it is to convert your specular workflow diffuse and specular maps to the proper metalness workflow maps, before plugging it into the appropriate inputs of the Principled BSDF.

How do you do it? TheHow do you do it?

The first step is to separate create a metallic map from you specular map. If your maps are PBR then there should be a huge difference of the RGB values between the dielectric (usually values ~0.04-0.08) and metallic parts (usually values >0.4) SO to create the metallic map just use a math node set to greater than 0.4. Plug that into the metallic input of the Principled BSDF.

Congrats you're done!

To demonstrate everything:

First of all credits to https://www.poliigon.com/texture/metal-spotty-discoloration-001/3225 for providing the free textures.

Metalness workflow:

Albedo map: enter image description here

Metalness map: enter image description here

Final render: enter image description here

Node tree:

enter image description here

Specular workflow:

Diffuse map: enter image description here

Specular map: enter image description here

The metalness computed from the node tree: enter image description here

Final render: enter image description here

Node tree:

enter image description here

What you may notice is that the final render of the metalness and specular workflows are really... similar. This is because although the specular workflow gives you more control over the IOR value sof dielectric parts as, the F(0) value is usually between 0.04 to 0.08 you usually won't notice that much of a difference.

What about aliasing? Well I used 4K textures so there is no aliasing with either the specular or metalness workflows. It is true however that with lower resolution textures the metalness workflow shows more significant aliasing that specular one's which is also one of the greatest drawbacks of the metalness workflow.

But if you look very very closely you may notice some aliasing at the borders between metallic and dieletric parts, why is that? As you can see in my node tree I used a value of 0.2 in my greater than node which is the condition to determine whether or not a material is dielectric or metal. Remember how I said that dielectrics have F(0) values ranging between 0.04 and 0.08 and metals have F(0) values ranging between 0.6 and 1? So there should be kind of a forbidden zone between 0.08 and 0.6, which are values usually only semiconductors have. However this is only true for the physical properties of materials. When taking a picture we only have a finite resolution, that is a pixel is actually going to cover a whole area of the material. In this area there may be both dieletrics and metals. The F(0) values of the pixel is usually just the average value of these two components weighted by the area of the pixel they cover, which means that even in physically "correct" images we may get values in the forbidden zone. That means finding out what pixel is metal or not is actually always fiddly and sometimes even impossible. You can of course adjust the value in the greater node to have the least aliasing visible. This issue with the finite resolution of the camera is also why metalness maps have values between 0 and 1. Since the Principled BSDF just lerps between (mixes) two different shaders; one for dielectrics and one for metals, a value of 0.3 doesn't mean that a material somehow something exotic that is neither a metal nor a dielectric. It also doesn't mean that the material is a semiconductor, in fact almost all CG software including Blender ignore the existance of semiconductors. It actually just means that a pixel is covering 30% metal and 70% dielectric. Due to the slight discrepancy between the pixels we compute as metalic and the ones that are actually metallic we get aliasing at the borders.

There is a way to reducae that aliasing drastically however! If you have the corresponding metalness map to a set of specular maps you can actually use that instead of computing the metalness, but don't expect the aliasing to go away completely.

So what is the correct way to do it? The correct way to do it is to convert your specular workflow diffuse and specular maps to the proper metalness workflow maps, before plugging it into the appropriate inputs of the Principled BSDF.

How do you do it? The first step is to separate create a metallic map from you specular map. If your maps are PBR then there should be a huge difference of the RGB values between the dielectric (usually values ~0.04-0.08) and metallic parts (usually values >0.4) SO to create the metallic map just use a math node set to greater than 0.4. Plug that into the metallic input of the Principled BSDF.

Congrats you're done!

So what is the correct way to do it?

The correct way to do it is to convert your specular workflow diffuse and specular maps to the proper metalness workflow maps, before plugging it into the appropriate inputs of the Principled BSDF.

How do you do it?

The first step is to separate create a metallic map from you specular map. If your maps are PBR then there should be a huge difference of the RGB values between the dielectric (usually values ~0.04-0.08) and metallic parts (usually values >0.4) SO to create the metallic map just use a math node set to greater than 0.4. Plug that into the metallic input of the Principled BSDF.

Congrats you're done!

To demonstrate everything:

First of all credits to https://www.poliigon.com/texture/metal-spotty-discoloration-001/3225 for providing the free textures.

Metalness workflow:

Albedo map: enter image description here

Metalness map: enter image description here

Final render: enter image description here

Node tree:

enter image description here

Specular workflow:

Diffuse map: enter image description here

Specular map: enter image description here

The metalness computed from the node tree: enter image description here

Final render: enter image description here

Node tree:

enter image description here

What you may notice is that the final render of the metalness and specular workflows are really... similar. This is because although the specular workflow gives you more control over the IOR value sof dielectric parts as, the F(0) value is usually between 0.04 to 0.08 you usually won't notice that much of a difference.

What about aliasing? Well I used 4K textures so there is no aliasing with either the specular or metalness workflows. It is true however that with lower resolution textures the metalness workflow shows more significant aliasing that specular one's which is also one of the greatest drawbacks of the metalness workflow.

But if you look very very closely you may notice some aliasing at the borders between metallic and dieletric parts, why is that? As you can see in my node tree I used a value of 0.2 in my greater than node which is the condition to determine whether or not a material is dielectric or metal. Remember how I said that dielectrics have F(0) values ranging between 0.04 and 0.08 and metals have F(0) values ranging between 0.6 and 1? So there should be kind of a forbidden zone between 0.08 and 0.6, which are values usually only semiconductors have. However this is only true for the physical properties of materials. When taking a picture we only have a finite resolution, that is a pixel is actually going to cover a whole area of the material. In this area there may be both dieletrics and metals. The F(0) values of the pixel is usually just the average value of these two components weighted by the area of the pixel they cover, which means that even in physically "correct" images we may get values in the forbidden zone. That means finding out what pixel is metal or not is actually always fiddly and sometimes even impossible. You can of course adjust the value in the greater node to have the least aliasing visible. This issue with the finite resolution of the camera is also why metalness maps have values between 0 and 1. Since the Principled BSDF just lerps between (mixes) two different shaders; one for dielectrics and one for metals, a value of 0.3 doesn't mean that a material somehow something exotic that is neither a metal nor a dielectric. It also doesn't mean that the material is a semiconductor, in fact almost all CG software including Blender ignore the existance of semiconductors. It actually just means that a pixel is covering 30% metal and 70% dielectric. Due to the slight discrepancy between the pixels we compute as metalic and the ones that are actually metallic we get aliasing at the borders.

There is a way to reducae that aliasing drastically however! If you have the corresponding metalness map to a set of specular maps you can actually use that instead of computing the metalness, but don't expect the aliasing to go away completely.

Source Link
tempdev nova
  • 1.6k
  • 8
  • 31
Loading