Home Technical Talk

PBR: The Problem with Greyscale Metalness

2

Replies

  • HapZungLam2
    Offline / Send Message
    HapZungLam2 polycounter lvl 7
    I often tell myself material can be either metal or non metal.  Set it to 1 if metal 0 if not.  Pretty straight forward and there shouldn't be an arguement.  (Aside from some artist mentioned that "artist desire")

    I myself do run into some problems to have absolute 1 or 0 when I setup textures in Painter.

    eg.
    - I have an 100% chrome metal (metalic map as 1)
    - I want to add a thin layer of dust (metalic map as 0)
    - I have a grunge or gradient map to mask out my dust layer

    The result that substance painter gave me on my output is that there are some greys on the transition blending at my metalic map.  I put those maps in to my renderer and it looks fine.

    I just can't wrap my head around on the PBR scientific explaination but I know there has no material that is half metal half non metal.  But I 've just created one. :P
  • metalliandy
    Offline / Send Message
    metalliandy interpolator
    I just can't wrap my head around on the PBR scientific explaination but I know there has no material that is half metal half non metal.  But I 've just created one. :P
    Though it's not half metal the state between conductor (metal) and dielectric (non-metal) is a semiconductor. Quartz crystals, rust, silicon are all common semiconductors, though most shaders don't account for them specifically. They generally have a higher reflectivity than dielectrics, but nowhere near the amounts we see in conductors (something like 8% :)
    https://en.wikipedia.org/wiki/Semiconductor




  • Nuclear Angel
    Offline / Send Message
    Nuclear Angel polycounter
    Thank you @radiancef0rge for creating this thread and comprehensive first post,  a great read that helped clear some things up for me.

    And @somedoggy great writeup, and thank you for the well written information, very nice discussion with loads of great resources. Even though some of it is way beyond my knowledge. 
  • mttjss
    Offline / Send Message
    mttjss polycounter lvl 11
    Hello guys. Great discussion. A lot of this goes well over my head, but I am trying to learn.

    I come from a gaming background, but now work in Architectural visualization using VRay, so this stuff takes a slightly different approach. I still try and use a metal/roughness workflow, but the ultimate goal is to have as photo-realistic materials as possible.

    I am going to read through all of this again and then a 3rd(or maybe even 4th time) until I understand it. 

    My questions are with IOR and Specular Color. With IOR is this used and implemented in a game engine in any way? Could you use a curve node to get the falloff?
    Would you still use Specular Color in a PBR Metalness workflow? TBH - never understood Spec Color completely as well. I know specular is not all 0-1 gradients, but how this works in the real world. An example of Spec color would be nice.

    Thanks guys. Great thread - bookmarked for daily reading.
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    If you're using Vray then you don't have to concern yourself with the metal/rough workflow. If creating your textures in a metal/rough environment like substance then you can use the Vray export preset which will convert your maps for use in Vray: diffuse/reflection/glossiness/etc. the roughness channel in Vray is to map diffuse roughness rather than reflection roughness and not to be confused. Your gloss map in Vray is just an inverted roughness map.

    As I mentioned earlier in the thread, the metal lerping is redundant in a Vray workflow as the metal map can be used as a mask for blended-layered shading. So if your material was a rusted, painted metal with dirt and dust, it would be 5 separate materials with completely different parameters/maps, and separately masked. You can, of course, still use the metal lerping in Vray in a single material but you will encounter the issues discussed in this thread.

    IOR is essentially the fresnel falloff of the reflections(and how light is absorbed/reflected/refracted as it hits a surface) and can be implemented in a game engine to a limited extent(UE4 has a fresnel node) There are different ways to set up IOR in Vray: the simple 'hack' is to unlock the IOR and crank it up/down for more/less reflections. Up as high as 50 or so for chrome. Then there is the more accurate method, publicly championed by Grant Warwick, where you adjust the RGB falloff curve to mimic realistic IOR values. Specular colour is a very old offline trick, pre-physical shading/lighting/ray-tracing days. Metal has no diffuse component but certain metals(gold/copper/bronze/etc) can take on the colour of the diffuse component as it was back in MentalRay when you'd enable 'metal' and copy/paste/slightly brighten the diffuse value to the reflection colour. This can be done in Vray by adjusting the RGB fresnel curve I mentioned above, to favour different metals.

    With Vray materials, as of 3.0, GGX was implemented and is generally switched on for every material.

    As for specular being used in the metal/rough workflow, this is what a lot of the thread is about, really. At the end of the day nobody is going to be checking your pixel values with scientific instruments :) Epic's recent Infiltrator demo uses metal/rough materials and has specular values plugged into a lot of them.

    I have seen so many varied methods of shading/lighting over the years by many, many great artists, some of their methods completely at odds with others, yet all the final renders looked great. So I wouldn't worry about it too much. Just get in there and experiment. Make some art. If it looks good then it is good. This 'PBR' stuff is nothing new in CG. They've been trying to mimic it since Alvy-Ray-smith had no grey hair....
  • mttjss
    Offline / Send Message
    mttjss polycounter lvl 11
    Hey Musashidan - thanks for the great response. I actually think I understood a lot of it. ;)

    I have a little understanding or using IOR values for different types of materials and Grants use of Fresnel curves to get the right falloffs for the reflection.
    I have even used the GGX shader a little (thought I thought this was strictly for metallic materials??).

    Noone will take a microscope to my work and nit pick it, but at the end of the day I am trying to make things look as real as possible,  but also as quick and easy to implement. I do a lot of exterior renderings with foliage and then metals and plastics, so I have to deal with all types of looks and lightings and materials. Just mostly want a thorough understanding of it all and then implement the best way possible.

    Not that I would use it too much, but I was mostly interested in creating accurate specular with alloys. I will experiment with the RGB curves to see what I can get. I will check out the Infiltrator demo as well in uE4 - if I can get it to run on my archaic PC. ;)


    On another note - using a PBR workflow, I am curious about the need for a diffuse texture other than faking specularity color and highlights. Maybe i am not understanding this as much either, but is it feasible to have a workflow where you do not use a diffuse map at all for any material? Is there cases where you really still need the diffuse?

    Again, I need to read more of this thread again.  Thanks for all the input.
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    mttjss said:
    Hey Musashidan - thanks for the great response. I actually think I understood a lot of it. ;)

    I have a little understanding or using IOR values for different types of materials and Grants use of Fresnel curves to get the right falloffs for the reflection.
    I have even used the GGX shader a little (thought I thought this was strictly for metallic materials??).

    GGX should be used for all your materials(unless, of course, you're using SSS) It's just a much more realistic BRDF model than the older Blinn/Phong/Ward shaders, and gives a much better representation of the fresnel falloff. If you haven't already, I would definitely recommend grant's course. He really does go in-depth with his shader explanations/construction.


    I will check out the Infiltrator demo as well in uE4 - if I can get it to run on my archaic PC. ;)

    Don't hold your breath.....It doesn't take kindly to the archaic... :)


    On another note - using a PBR workflow, I am curious about the need for a diffuse texture other than faking specularity color and highlights. Maybe i am not understanding this as much either, but is it feasible to have a workflow where you do not use a diffuse map at all for any material? Is there cases where you really still need the diffuse?

    The diffuse/albedo is basically reflected light so yes, it is important. Even for metals, although they don't have a diffuse component, we still put maps in there for surface variance/breakup. I don't think there are many scenarios where you wouldn't use a diffuse map(except for water, a mirror, clear glass, etc)So you might use different values of light/dark grey to mimic steel or aluminium. Even a solid colour with a grunge map multiplied will give some variance. Also, specular was a legacy map in offline rendering which was supposed to fake the reflections from lighting. But that was pre-raytracing. With ray-tracing the entire scene is reflected based on each shader's reflection properties. The advent of the Disney PBR approach has changed things in games, for certain, but offline rendering PBR is essentially the same as it has been for years bar the introduction of GGX(although the new ART renderer that ships with Max2017 uses the metal/rough approach)

    I am the opposite of you in that my background is originally using offline renderers so I've found it quite easy to adopt the real-time PBR metal/rough workflow. But it seems that a lot of artists with a real-time background and new to offline rendering often seem to get confused and mix the 2 up. Again, I would highly recommend grant's course if you haven't already taken it. It's sure to clear a lot of things up for you. Just clear your mind of the metal/rough PBR thing whilst watching it..... :)

    Also, as Arch-vis is now your thing you should check out Ronen Bekerman's site. He has some great info on there and is always up to date tech-wise. http://www.ronenbekerman.com/

  • josh_lynch
    Offline / Send Message
    josh_lynch interpolator
    I dunno about you guys, but I am very visual, so seeing images along with the text really helps drive it home. Allegorithmic put out some fantastic PBR guides a while back and both of the guides discuss all of these topics at length. They do of excellent job of looking at it from a both Spec/Gloss and Metalness/Roughness workflows.

    Here are the links to download the guides. Volume 1 | Volume 2

    If I may, as previously mentioned by @perna, complete either / or isnt completely accurate. With respect to a "Metalness/Roughness" workflow the guides discuss how dust / dirt / rust come into play in the metallic map. In PG 11 of Volume 2 it is stated "1. Black (0.0) is non-metal and white (1.0) is metal. There can be transitional grayscale values to account for oxidation or dirt."

    As others have stated each engine expects to be fed certain data and each studio will establish standards. Its about consistancy, not an absolution.
  • HapZungLam2
    Offline / Send Message
    HapZungLam2 polycounter lvl 7
    Though it's not half metal the state between conductor (metal) and dielectric (non-metal) is a semiconductor. Quartz crystals, rust, silicon are all common semiconductors, though most shaders don't account for them specifically. They generally have a higher reflectivity than dielectrics, but nowhere near the amounts we see in conductors (something like 8% :)
    https://en.wikipedia.org/wiki/Semiconductor
    That brings up my other question that I always have.  What value should I put in my metalic map for semiconductor?  I assumed 50% grey won't be ideal.

    I put black on my metalic map for rusted metal.  Its definitely incorrect scientifically

  • Mant1k0re
    Offline / Send Message
    Mant1k0re polycounter lvl 8
    Great read, although the debate gets very confusing at some point. But I don't think the average joe (that would be me) needs to get that deep into the theoretical aspect of it.

    One thing I still find confusing though is the presence of a specular output in Unreal's material editor, especially since someone in this thread mentions it is used by Epic themselves now. I vaguely remember watching Epic intro series to UE4 a couple years ago and hearing something along the line of "this is legacy stuff, it's better left alone".
  • radiancef0rge
    Offline / Send Message
    radiancef0rge ngon master
    It's used as a masking function on specularity. So it is really a cavity map. Anything above 50% grey gets extra highlights everything below gets AO. 
  • Mant1k0re
    Offline / Send Message
    Mant1k0re polycounter lvl 8
    Thanks Radiance, I can't believe I didn't come across this information earlier. Much appreciated.
  • metalliandy
    Offline / Send Message
    metalliandy interpolator
    That brings up my other question that I always have.  What value should I put in my metalic map for semiconductor?  I assumed 50% grey won't be ideal.

    I put black on my metalic map for rusted metal.  Its definitely incorrect scientifically

    Off the top of my head I would say that the majority of Semiconductors are closer to dielectrics in terms of reflectance so something like rust would be passable as black with a greyscale transition.
    There are some exceptions such as Magnetite which has a similar lustre to something like Iron, so I would make it a conductor personally.
  • Jerc
    Offline / Send Message
    Jerc interpolator
    I think the 0 or 1 rule actually still applies depending on the granularity of your workflow.

    I know in Painter I will often decompose my workflow into pure materials, each layer being a pure metal or a pure dielectric material (rust, dust, oxide, paint, whatever). A slightly worn out metal material will be made of 3 or 4 layers of pure materials stacked on top of each other resulting in a complex and rich metalness map.

    Of course the final composited material will have tons of intermediary greyscale values but I've never seen anywhere an argument for pure binary metalness on a final composited material. The metalness workflow tends to make these transitions a little crappy looking but it's the role of the artists to take those in consideration and make the appropriate decisions.

    Then if you're working with scanned data, the 0 or 1 aspect is out the window since you already have a flawed or non-pure material in the first place as your source.
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    It's used as a masking function on specularity. So it is really a cavity map. Anything above 50% grey gets extra highlights everything below gets AO. 
    A good example of this being the bronze materials: at one point in the graph the base colour is split off twice and lerped several times through both V3 and an AO/Shade map back into itself before the final lerp is plugged into both the base colour and specular outputs.
  • Prutsirs_JayJay
    So, if I understand correctly. This implies that the 0 or 1 metalness only idea is wrong, and pleny of metals can be between 0/1 depending on dust. Some metals can even be 0 i'd assume? Like the cast iron on a cast iron skillet?
  • ZacD
    Offline / Send Message
    ZacD ngon master
    The 0 or 1 idea is generally right, as long as you're aware of transitions, layering, paint, patina, rust, etc, happening on top of the metals. A cast iron would be metallic if you broke a skillet in half and looked on the inside. 

    The only materials I commonly see that are in between 0 and 1 (before layering on details) are semi-metallic paints. 

  • metalliandy
    Offline / Send Message
    metalliandy interpolator
    So, if I understand correctly. This implies that the 0 or 1 metalness only idea is wrong, and pleny of metals can be between 0/1 depending on dust. Some metals can even be 0 i'd assume? Like the cast iron on a cast iron skillet?
    It helps to think about this kind of stuff in layers. Pure conductors and dielectrics will always be 1 or 0 and the confusion arises when you have oxidisation or other similar process on top of the metal, in which case you would use the value for the rust/dust or grime rather than the underlying metal itself. Cast iron would still be authored as metal, but with a lower smoothness/higher roughness than something like polished iron or steel. Any rust, dust or grime on the cast iron would be authored as a dielectric because it's obfuscating the conductor.

    In your cast iron skillet example you might have something like the following if it were in layers.
    Cast Iron (conductor)> Rust (semi-conductor but authored as dielectric with a greyscale transition)> Dust (dielectric)> Fresh, deep scratches (conductor).

    Consistency and plausibility are much more important than absolute accuracy. If you are looking for absolute accuracy then the specular workflow is much better than metalness, but it's also way more expensive so generally we live with the compromise.
2
Sign In or Register to comment.