Home Technical Talk

Can someone explain this metallness/PBR thing to me.

2

Replies

  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    You're right, i can't get rid of it completely either. Though adjusting the Levels Midpoint for both the albedo and metallic mask, and upping the resolution can get rid of it almost to a point of not being noticeable.
    Another good trick is to give the normals some height in that area, hides the issue too.
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    I'm not having the borders issue in UE4 so it's probably something in marmoset.

    Marmoset may not be as lenient as UE4 for values between metal and non-metal. I believe in UE4 values in the middle interpolate the results of the two models.
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    That's what Marmoset does too I assume. I am thinking there might be an in-shader way to fix it.
  • EarthQuake
    Options
    Offline / Send Message
    Yeah TB2 uses grey value as a blend as well. Could you post an image of the asset in both UE4 and TB2 so I can pass this onto our engineers?
  • Scizz
    Options
    Offline / Send Message
    Scizz polycounter lvl 11
    So if I have a model, say, a wooden chair, no metal on it whatsoever, I don't even need a metalness map, and I can just set a constant value of 0 to the metalness input in UE4? Then, the only maps I would need are my albedo, normal, and roughness maps? The actual seat on the chair for example, would be more towards white because that's what's used the most thus it wouldn't be as glossy as say, the back where nothing touches it and it keeps its sheen. The back would be a more towards black?
  • Xoliul
    Options
    Offline / Send Message
    Xoliul polycounter lvl 14
    yes. to everything.
  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    @ stevston89 and Xoliul

    I actually had a feeling it was something to do with the transition between the maps, that's why I was being careful to have a pretty sharp transition. Yes there are a lot of scratches in the transitional area but they are all very sharp, so it doesn't really make sense to me.

    edit: erm here's what I mean
    UtUNcyS.jpg

    Edit: Moreover, when I stuck the dirt in the metalness channel I wasn't getting artifacting around it, wouldn't that mess it up too?
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    Getting the artifacting in UE4 as well with a very dark albedo for the insulator. Don't think it's a TB2 issue.

    Rrwt8ow.jpg
  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
    Does something that's pure white and black work better? Like this?

    Xk8NNoN.png
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    Sort of, it decreases the radius of the 'halo' but also makes it noisier and more aliased, as one would expect.

    6H3YGBM.jpg
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    Anyways whatever, doubt this is going tobe a game-breaker in any way. Like Xoliul was saying, as long as we adhere to the 'correct' values for shit it shouldn't be an issue.
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    I think I figured out what might be going on, but I could be wrong. I was able to get the same issue.

    I think the problem is when you use the texture for the base color. Both the metal and non-metal shaders are getting the same base color value to work with at any given point.

    If you were actually mixing two different materials they would each have their own base color value and you would only mix the end result.

    For example if you wanted a material that blended in the middle into 50% gold flecks and 50% dark-blue plastic flecks, you wouldn't just combine the gold and dark-blue color and then apply it to the metal and non-metal shader models. You would keep using the gold for the metal model and the dark-blue for the non-metal and combine the overall result 50/50.

    Like I said I'm not sure of this but it makes the most sense to me at the moment.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    Hmmm, well if I understand correctly what you mean, I was using a different base color for each material. I went very dark on the plastic albedo but kept the metal albedo a midtone.
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    When using the metalness workflow you will always get that halo whenever you have a dark non metal next to a bright metal. It's because metalness shader affects albedo values. When transitioning you have more diffuse light showing overall. Because the values are not 100% the metals diffuse start to show through which is much brighter than the non metal. So you get the halo. Personally I think the metalness workflow has a few more draw backs that make me want to use the reflectance workflow.
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    @Count_Vader
    Were you using material layers or were you doing everything in the same shader?
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    Same shader.

    Also, what is a reflectance workflow?
  • EarthQuake
    Options
    Offline / Send Message
    Same shader.

    Also, what is a reflectance workflow?

    I think he meant specular map workflow. Specular and metalness maps are both inputs to set reflectance or reflectivity.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    Yes I did mean the specular map input, but people usual assume that it isn't PBR when it is. Reflectance is just the term I have heard from other engines.
  • EarthQuake
    Options
    Offline / Send Message
    stevston89 wrote: »
    Yes I did mean the specular map input, but people usual assume that it isn't PBR when it is. Reflectance is just the term I have heard from other engines.

    These are all just terms for basically the same thing, none of them are more or less physically based or anything like that. If its PBR or not depends on how the shaders are written, and if you're using calibrated art content and things like that, not what your inputs are named.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    Speaking of calibrated art content, is there a way for someone like me (working at a portfolio, not studio) to get access to an extensive chart of material values, like are there free ones available out there?

    edit: never mind ,just found the dontnod one. gotta learn to google before asking questions.
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    Yeah. I understand. I just feel that there is a misconception that metalness is the only PBR workflow when it isn't. You can still use diffuse/ spec/ gloss workflow your textures just need to be authored differently and more consistently.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    Well it seems to me the metalness thing just 'locks' certain things in place more, like a failsafe/idiot-proof switch.
  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
    Well it seems to me the metalness thing just 'locks' certain things in place more, like a failsafe/idiot-proof switch.

    Yeah there's a few things that need more specular control than "is this metal or not?" Things like mud or "wet" materials need higher reflectivity.
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    The point of metalness is to make things faster and cheaper. You have a mask that isn't that detailed vs a full color and wide value range map. It's a bit cleaner, but there is less control.
  • EarthQuake
    Options
    Offline / Send Message
    stevston89 wrote: »
    Yeah. I understand. I just feel that there is a misconception that metalness is the only PBR workflow when it isn't. You can still use diffuse/ spec/ gloss workflow your textures just need to be authored differently and more consistently.

    Yeah absolutely, in TB2 we support both spec maps and metalness, and both are PBR. Its just different ways to arrange the information really.
    Well it seems to me the metalness thing just 'locks' certain things in place more, like a failsafe/idiot-proof switch.

    Yep, thats what it is. Its also a way to optimize the content so you can use less texture memory.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    How is energy the energy conservation principle handled in the non-metalness workflow though?

    Also it seems like UE4 has eliminated the whole spec/gloss thing alltogether in favor of roughness and metalness.

    But again two days ago i didn't even really know what any of this stuff was, so I could be totally wrong.
  • EarthQuake
    Options
    Offline / Send Message
    How is energy the energy conservation principle handled in the non-metalness workflow though?

    Also it seems like UE4 has eliminated the whole spec/gloss thing alltogether in favor of roughness and metalness.

    But again two days ago i didn't even really know what any of this stuff was, so I could be totally wrong.

    Gloss is the same thing as roughness, can't say this enough times.

    Energy conservation affects highlight intensity vs spread in the same manner with gloss and roughness maps, which again, are the same thing.

    For specular map input as reflectivity, energy conservation acts as a fail safe to prevent artist from using unrealistic values, like 0.5 diffuse and 1.0 spec (which means an object reflects 1.5x the light that hits it, physically impossible). So the diffuse map is automatically darkened if the reflectivity is high.

    For metalness, non metalics get a very low reflectance value, so its the same sort of failsafe to prevent incorrect values. For metalics, the diffuse is darkened to zero. So again, basically the same concept, just a little different implementation.
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    Roughness = gloss. They do pretty much the same thing.

    Energy conservation is shader based it just means there is the no more light reflected out than received.

    UE4 removed the "spec/gloss" workflow because they wanted to keep things cheap and pretty much everything except for metals has a fairly similar reluctance ( specular reflection level).
  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
    UE4 has specular and metalness. Both metalness and specular workflows use gloss/roughness.
  • EarthQuake
    Options
    Offline / Send Message
    stevston89 wrote: »
    Roughness = gloss. They do pretty much the same thing. Energy conservation is shader based it just means there is the same amount of light reflected out as received. UE4 removed that because they wanted to keep things cheap and pretty much everything except for metals has a fairly similar reluctance ( specular reflection level).

    UE4 certainly has energy conservation, its built in to the roughness compontent. Tighter highlights are more concentrated and intense, while darker highlights are more spread out and dim (the same amount of light is hitting the surface, its just a question of how its scattered).

    The metalness workflow essentially has energy conservation built in as well.

    So I wouldn't say its accurate at all to say they removed energy conservation in UE4. Its just not an exposed variable, because there is little reason for it to be.
    ZacD wrote: »
    UE4 has specular and metalness. Both metalness and specular workflows use gloss/roughness.

    No, the spec map thing in UE4 is legacy stuff and doesn't really do what you think it does. One of the Epic guys mentioned they might pull it entirely to avoid confusion there. Its not really a workable alternative to metalness, like it is in TB2, at least as far as I am aware.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    I thought the purpose of a roughness map was to not only save on memory but also to ensure that highlight brightness:radius ratio stays consistent as dictated by the laws of energy conservation.

    So I am authoring a spec map that is then modulated by a gloss map, do I need to manually ensure that I am using values that will not mess it up (ie so I don't have like, a super broad but also a super bright highlight).

    Same I guess goes for the albedo/spec relationship. If I am not using metalness worfklow, do I need to "manually" manage the relationship between these values (ie NOT having an object reflect 1.5x the light that hits it) or is there like a checkbox I can use to prevent this?
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    @ Earthquake - Oh no I was refering to the spec/reflectance workflow. Should have been more clear.
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    I just tested the single shader vs using material layers and I got the same results, but I'm almost positive the issue is that rather than calculating the two materials separately and blending those values they're blending the inputs as well.

    Rrwt8ow.jpg

    Notice in Count Vader's image how the adjacent colors for both the materials are darker than where they're combined. If they were interpolating between the two colors that would make no sense, but what's probably happening is they inputs are being blended as well. A lighter base color will make the non-metallic shader get lighter faster than a corresponding metalic shader in most areas.
  • ZacD
    Options
    Offline / Send Message
    ZacD ngon master
    EarthQuake wrote: »
    No, the spec map thing in UE4 is legacy stuff and doesn't really do what you think it does. One of the Epic guys mentioned they might pull it entirely to avoid confusion there. Its not really a workable alternative to metalness, like it is in TB2, at least as far as I am aware.

    Didn't realize that (or test non-metalness PBR enough to notice).

    Hopefully they address that issue or add a (legacy) tag, or even better, a real specular workflow for PBR.
  • EarthQuake
    Options
    Offline / Send Message
    I thought the purpose of a roughness map was to not only save on memory but also to ensure that highlight brightness:radius ratio stays consistent as dictated by the laws of energy conservation.

    So I am authoring a spec map that is then modulated by a gloss map, do I need to manually ensure that I am using values that will not mess it up (ie so I don't have like, a super broad but also a super bright highlight).

    Same I guess goes for the albedo/spec relationship. If I am not using metalness worfklow, do I need to "manually" manage the relationship between these values (ie NOT having an object reflect 1.5x the light that hits it) or is there like a checkbox I can use to prevent this?

    Only with old-school non PBR shaders. Any pbr shader that uses specular maps or metalness maps has energy conservation in some way with the spec, and gloss as well.
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    From my understanding the UE4 specular is a make-shift for IOR. It wouldn't be used like the old specular.
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    @ count vader - Pretty much all PBR shader should have energy conservation built in. Marmoset has a check box if you would like to turn it off.

    @ Gestalt - yes but in the example the color of the metal in the albedo map will be brighter than the non metal color. Metalness makes all metals have a black diffuse. Darkening the metal in the albedo will just make it reflect less light. It is still an error in the blending. If you made the metal black in the albedo the halo would go away.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    EarthQuake wrote: »
    Only with old-school non PBR shaders. Any pbr shader that uses specular maps or metalness maps has energy conservation in some way with the spec, and gloss as well.

    Understood, thanks.
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    What I'm saying is that the materials should be blended and not their inputs (the base colors should never blend).

    If you have a dark base color for the non-metal and a light base/reflection/whatever for the metal, blending those base values to a gray and then plugging that into the separate shader models isn't going to give you something in the middle. As you said the base color is used differently for the non-metal than the metal and for the non-metal that grey is going to make it overall brighter and as it becomes more metal it will become dark again.

    If you were to plug in the same base color value for both metal and non-metal (and thus not have the input blending issue) you'll get two different materials but none of the weird interpolation.
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    @ Gestalt - The shader is at fault. It was designed to do exactly what it does. I don't think it could do what you are saying. The blending you are talking about is what UE4 has, but you need to setup multiple materials to do it and a shader to blend them together. Which is a lot more expensive and a lot more work than just doing the spec/ reflectance workflow.
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    I tried setting up the materials as two separate material functions blended as material layers (matlayerblend_standard) and got the same issue. If there were a workflow for blending materials it would be that (each of the material functions are unique materials). Hopefully a new blend mode emerges if it's possible.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    This is kinda off topic with the respect to the current discussion, but since it ties directly to the PBR thing I wanted to ask. With a material values chart (the dontnod one in particular) I'm still unclear as to what I'm supposed to actually "do" with the values. Are they meant to provide an upper limit or base for the intensity of roughness/spec on different materials?

    If I have a material with roughness variation (ie dirt/scuffs) how do I ensure the brightness of all these layers stays within the acceptable range?

    Is it going to make my textures 'better' if I follow this? (I know it's not going to magically make them good out of nowhere, I meant like assuming a pre-existing texturing skill/ability).
  • stevston89
    Options
    Offline / Send Message
    stevston89 interpolator
    @ Count Vader - The values you see for roughness/ spec are measured from real world materials. Those values should be what you are using for your maps. You can toy with them if you want different visuals, but that wouldn't technically be correct.

    You can either visually decide if it looks right or pull from real world values.

    The benefit is you will be able to standardize material making. It will be a bit easier to get your models looking good and your materials will stay consistent.
  • Count Vader
    Options
    Offline / Send Message
    Count Vader polycounter lvl 12
    Gotcha. Is there a way to take full advantage of them in photoshop? Like do I just establish the corresponding value for whatever material I'm defining as the base layer of that channel/layer group?
  • Gestalt
    Options
    Offline / Send Message
    Gestalt polycounter lvl 11
    You can use the values in photoshop but keep in mind whether your images are being imported as linear or not.

    @perna
    The solution (I think) is to have separate shader models blended together with masks rather than having metalness maps. This would probably cost more (each shading model involved has to be calculated on its own) but given that there are only really two models for the standard material (metal and non-metal) I don't think you'd really need to do more than calculate those two (you could probably combine all the metals and non-metals).
  • BuLL
    Options
    Offline / Send Message
    You have to quite simply put more thought into your material selection & preparation..ie.Is a metal a bare metal or is it coated in any way..Is a scratch bare metal or has it oxidised?..Oxidised means it`s coated.It`s not bare metal no more.

    Metalness maps...If it`s bare metal,then u paint it white,If it isn`t ie(an insulator) it`s painted black.

    Albedo..As said before use real world values but that is down to your own judment (practice in other words)Albedos tend to verge on old specular highlight values rather than old diffuse.

    Roughness/Gloss...This is the Daddy of all maps now.This determines bare metal & non bare metal glossiness & also roughness..ie.Stainless is particularly glossy but also has underlying tones,scratches, etc..

    So to summarise.
    Albedo....Real world values..Colour,determined on wether a material is a bare metal or not.

    Metallic map...Black or white,which is determined on your observations of the Albedo materials.(black=insular / white=bare metals.

    Gloss/Roughness...How shiny the Albedo colour should be.

    Examples.
    Diff/spec/gloss.

    https://www.dropbox.com/s/1u5lysfwpf2dj5t/ak74_d.jpg?dl=0

    https://www.dropbox.com/s/hva9cn9cm6rx3bv/ak74_s.jpg?dl=0

    https://www.dropbox.com/s/xp0q1i2ospxzn49/ak74_g.jpg?dl=0

    Result..

    https://www.dropbox.com/s/ls1xhvthh77oom8/screenshot002.png?dl=0

    Albedo/Metalness/Gloss.

    https://www.dropbox.com/s/i5rgkm5o30c7c08/ak74_d_pbr.jpg?dl=0

    https://www.dropbox.com/s/vo9huxvvrnb0r5f/ak74_metal.jpg?dl=0

    https://www.dropbox.com/s/xp0q1i2ospxzn49/ak74_g.jpg?dl=0

    Result.

    https://www.dropbox.com/s/c1zfed9wdzax7n4/screenshot001.png?dl=0

    On this occasion I found that the gloss values weren`t far of,so left them the same for this demonstration.The difference is spec vs metalness.
    Obviously there`s far more less work involved in producing a metallness map vs a specular map.Hence the benefit & more accurate material definition.
    Hope that`s helpful chaps;)
  • FelixL
    Options
    Offline / Send Message
    FelixL polycounter lvl 4
    I don't see how the metalness model is an improvement over regular diff/spec/roughness in any way, both from a workflow perspective and from a memory perspective.

    In pretty much all real-world cases, you would need a metalness map, because the materials in a texture are never 100% metal. Dirty metal, partly painted metal, metal with dust on it would already require a metalness map.

    So for mixed materials you'd need:

    Oldschool diff/spec workflow: RGB diff + RGB spec
    Metalness workflow: RGB basecolor + grayscale metalness

    Since there is still no texture format that I know of that saves greyscale textures with a lower memory footprint than RGB textures, you wouldn't even save memory. This is assuming that RGB+A is the same memory footprint as two RGB as it was before.

    What am I missing? How is it advantageous?
  • cryrid
    Options
    Offline / Send Message
    cryrid interpolator
    Since there is still no texture format that I know of that saves greyscale textures with a lower memory footprint than RGB textures, you wouldn't even save memory. This is assuming that RGB+A is the same memory footprint as two RGB as it was before.

    What am I missing? How is it advantageous?
    It combines an RGB diffuse and and RGB specular into a single image, and the metalness map can be packed in with the roughness. It may not work out well for all materials, but I can see there being a benefit for the ones it does work with.
2
Sign In or Register to comment.