Diffuse to Albedo in Photoshop

polycounter lvl 4
Offline / Send Message
Jack M. polycounter lvl 4
Hey fellow polycounters,

Here's a tutorial I made recently on how to make an albedo map from a diffuse map. With this transition to PBR I have found cgtextures.com to be fairly useless because 99% of the textures are not taken with a polarizing lens. With this technique you can remedy that and still get some pretty good albedo maps from diffuse maps.

If anyone has crits, suggestions, tips, or otherwise, feel free to leave feedback for me.

https://www.youtube.com/watch?v=KKQZN3eoKUo&list=UUfyvlGW2gDNh5YH6CFh7BtQ

Replies

  • Dominick
    Thank you Jack M. for this useful tip. Though albedo map and diffuse map are pretty much the same thing. I'm sure "How to Make an Albedo Texture from a photo" is what you really meant.
  • ZenDavis
    http://www.marmoset.co/toolbag/learn/pbr-practice

    An albedo map defines the color of diffused light. One of the biggest differences between an albedo map in a PBR system and a traditional diffuse map is the lack of directional light or ambient occlusion. Directional light will look incorrect in certain lighting conditions, and ambient occlusion should be added in the separate AO slot.

    The albedo map will sometimes define more than the diffuse color as well, for instance, when using a metalness map, the albedo map defines the diffuse color for insulators (non-metals) and reflectivity for metallic surfaces.
  • Jack M.
    Offline / Send Message
    Jack M. polycounter lvl 4
    Spot on Zen.

    The main reason I said diffuse instead of just photos is because many people like myself have built up a library of custom tiling textures or other textures that they may want to fix for the pbr system. I just thought diffuse texture was a little more all-encompassing than photo.

    I also thought saying photo could be misleading as a photo taken with a polarizing lens is still a photo, but it's pbr friendly.

    Either way thanks for the input Dominick. I'm also glad you found it useful :)
  • Maximum-Dev
  • Jack M.
    Offline / Send Message
    Jack M. polycounter lvl 4
    1) In short no. There should be no lighting information at all. No AO, and no cavity information. There can be a hint added, but it's better to be safe.

    Wood grains for example naturally have a slightly darker color in the crevices while the more exposed portions are less saturated and lighter. One reason for this is how light works in the real world. The sun tends to bleach things. Therefore the crevices of an object that receives less light would remain more saturated than surfaces that would be exposed for long periods of time to the light.

    Assuming that is correct then you would end up having an albedo map with changes in tonal values as well as color that would match those kinds of weathering effects. However, these values would be less saturated, have less contrast, and no shadow information (AO, Cavity, or highlight information) compared to a diffuse map.

    2) Yes that is the average micro surface value for marmoset (inverted for Unreal). You want to keep the median at those numbers and then adjust the min/max values for the black and white values in your roughness map to give a good looking roughness effect. Keep references up, and you should be able to make a good looking physically accurate roughness map.

    3) All renderers are different even if they use the same scientific principles. It's just unavoidable. With that being said marmoset does render things differently than unreal. In marmoset you need an almost black albedo value in order to make a physically accurate metal.

    In unreal however you'll get a very strange effect if you do this. That is because it's using a metalness workflow while marmoset is using a specular based workflow (same as cryengine from what I understand). When making a metal in Unreal, it uses the diffuse to calculate the reflection color of the material. So if you make it nearly black your reflections will be nonexistent.

    With that being said I have found marmoset to be more of an obstacle than a helper when trying to make things for unreal. If anyone has any suggestions for getting marmoset to be useful for using in conjunction with Unreal PLEASE COMMENT.

    On the other hand substance has proven to be fairly accurate in rendering similarly to Unreal in my experience.

    4) You can buy a variety of differently textured satin materials in real life. Some are more rough while others are pretty shiny. I think they just wanted to get one rough and one shiny one in there for reference.

    The reason for the colored reflectivity maps is pretty simple. In real life a blue object is blue because it absorbs all wavelengths of light except for blue. This gives it it's blue color. So if blue is the only thing reflected then even if an object is very rough it's still reflecting color. The only object that reflects white for example is a white object (sounds redundant I know). Therefore a better question to ask is why so many people don't create colored reflectivity maps (roughness maps are different in unreal (you don't need or want color because it does all this automatically)).

    I prefer my science with a pinch of Bill Nye: https://www.youtube.com/watch?v=9rTYolCf5kk

    To properly achieve the reflectivity color you simply desaturate your albedo slightly.

    That was a lot of information so if someone has a problem with one of my answers feel free to correct me.
  • leleuxart
    Offline / Send Message
    leleuxart polycounter lvl 5
    Jack M. wrote: »
    1)In unreal however you'll get a very strange effect if you do this. That is because it's using a metalness workflow while marmoset is using a specular based workflow (same as cryengine from what I understand). When making a metal in Unreal, it uses the diffuse to calculate the reflection color of the material. So if you make it nearly black your reflections will be nonexistent.

    With that being said I have found marmoset to be more of an obstacle than a helper when trying to make things for unreal. If anyone has any suggestions for getting marmoset to be useful for using in conjunction with Unreal PLEASE COMMENT.

    In the most recent TB2 update, they've included the GGX BRDF, which is closer to UE4 and CE3.6. Also, TB2 can use the metalness workflow(like UE4) and the spec workflow(like CE3.6). You also just need to make sure your maps are imported into UE4 as linear/sRGB. I believe TB2 automatically sets the maps that need to be in linear to linear.
  • Nam.Nguyen
    Offline / Send Message
    Nam.Nguyen polycounter lvl 4
    I think there are some misunderstanding in this thread.

    1. Metallness and Specular are different workflow, but they're not real different, actually they being use to calculate the same thing, which is specular value. While in specular workflow, the spec value is pick from the spec map. Metalness map is simply a mask define the material is metal or not, if metal, the spec value will be pick from albedo, if not, spec value is assign to the most common value for "non-metal" material (linear: 0.04 sRGB: 0.06). There very few non-metal material has an unique spec value.
    Metalness is use to simplify the workflow, that's it.

    2. Alot of people seems to have a misconception about AO map and PBR. None of the document that I've read about PBR said that : don't use AO, no AO, AO is bad, . . . they only said "no light information" which mean no highlight and shadow like you see when light hits an object, only "base color" should be on the albedo map.
    One example when you can use AO map is on an old object with alot of dirt, oil, . . . in concave area, you can manipulate the AO or cavity map to represent those area


    And Maximum-Dev, for your questions;

    1. Those are call micro-occlusion, for example the occlusion around a bolt on your hardsurface asset, the engine can't calculate that, because it's on normal map. not real intersected geometry. You can use them on your Albedo map, but they should not be black but should match the hue of base color

    2. Kind of median, but no need to over complicate things roughness is simple, smooth or rough. A real surface is not perfect there's always noise, dirt, scratch, . . . and they have different roughness level.

    3. Toolbag is good tool, as I mentioned above and what leleuxart said, you can work with TB and get a pretty similar result to UE4. Of course there're some difference but nobody just working with TB and then throw in UE4 without looking twice. So, throw it away is silly.

    4.
    - Both are satin, but not the same, there're smooth and rough satin, that's why they have different roughness value,

    - I suggest you google it, quite a long read

    - Those are Measured value, each material has it own value
  • Jack M.
    Offline / Send Message
    Jack M. polycounter lvl 4
    Hey guys,

    thanks for the heads up on marmoset leleusart. I'll be sure to check it out ASAP. As far as I understand UE4 imports it as default linear/sRGB, however something I forgot to mention in the tutorial is you must change some photoshop settings.

    edit> color settings.
    RGB: RGB needs to be set to sRGB
    Gray: Gray Gamma 2.2
    Spot: Dot Gain 20%

    I will edit the youtube video ASAP as well to include this information in the description.

    - Nam.Nguyen

    Thanks for the clarification on the spec/metalness workflow.

    Regarding your points on AO there is a lot of documentation that says to leave AO or cavity information specifically out. They do however say you can use it to add a slightly darkened tint of the albedos main color.

    Cryengine Documentation
    http://docs.cryengine.com/display/SDKDOC4/Physically+Based+Rendering

    Quote from cryengine documentation
    Usually the diffuse map should not contain any lighting, shading or shadowing information, as all this gets added dynamically by the engine. In case some pre baked ambient occlusion is required, it has to be stored in a dedicated AO map (currently the diffuse channel of a Unified Detail Map is interpreted as AO).

    (This little tidbit of information also explains the custom AO slot in Unreal Engine 4's material editor, and marmoset toolbag 2's material settings)

    Remember me documentation
    https://www.fxguide.com/featured/game-environments-parta-remember-me-rendering/

    Quote from remember me docs
    Finally, there can be too much occlusion. Macro occlusion is not going to work, however micro-occlusion which can’t be handled by the engine can be baked. The micro occlusion should not be dark but rather just a tint of the albedo as it is supposed to emulate a bounce of light.

    And a PBR discussion in the UE4 forums that further explores AO in pbr
    https://forums.unrealengine.com/showthread.php?13453-PBR-Implications-for-texture-creation
  • Nam.Nguyen
    Offline / Send Message
    Nam.Nguyen polycounter lvl 4
    Let me be more clear about this

    I'm not talking about add the "Ambient occlusion information" into Albedo map.

    I'm talking about manipulating the AO, cavity map to make the details in concave area of you final texture.

    and what you quoted is pretty much what I've said
    Jack M. wrote: »
    Quote from cryengine documentation
    Usually the diffuse map should not contain any lighting, shading or shadowing information,...



    Nam.Nguyen wrote: »
    they only said "no light information" which mean no highlight and shadow like you see when light hits an object
  • Jack M.
    Offline / Send Message
    Jack M. polycounter lvl 4
    I see what you're saying. My mistake. I was very tired when responding to your comment and clearly overlooked a quite a few things.
  • EarthQuake
    leleuxart wrote: »
    In the most recent TB2 update, they've included the GGX BRDF, which is closer to UE4 and CE3.6. Also, TB2 can use the metalness workflow(like UE4) and the spec workflow(like CE3.6). You also just need to make sure your maps are imported into UE4 as linear/sRGB. I believe TB2 automatically sets the maps that need to be in linear to linear.

    Right, TB2 can be set up to give an almost exact match to UE4 when loading the same maps and shader models. You can use the UE4 preset material to quickly add a material with all the correct options. If anyone has issues with this workflow please let me know.

    [ame=" 2 | 2.05 Update - YouTube[/ame]

    To the satin/satin question above: Sorry, this is my fault, the blue material is actually a glossy plastic tarp material. The image there has the incorrect name, I should fix that.

    In general though, gloss/roughness simply varies based on any number of factors. There is no value that you always use, you have to use your better judgement.

    As far as colored spec goes, this is an issue we are aware of as well. I believe it is due to using early megascan tech for the values. We want to update the chart at some point but haven't had the time.
  • Jack M.
    Offline / Send Message
    Jack M. polycounter lvl 4
    Thanks for that information EQ!
  • EarthQuake
    No problem, I just got a chance to watch the video and had some notes:

    First off, the chart, A = albedo, M = microsurface (gloss scale in this case), and R = reflectivity (specular color/intensity in this case) this is written on the image itself on the bottom too. In the video you mention that m = metalness and R = roughness which is not correct. Generally for rock (unless it had a high metal content) metalness would be 0. Roughness, if using the roughness scale (black = glossy, white = rough) would be the microsurface value inverted.

    In addition to that, the albedo value for rock there, is for specifically the type of rock in that scan. Rock comes in all sorts of different colors, so you can't really just set your albedo value for any rock to the albedo value there. Its not an absolute value that all rock must be, its simply an example of a rock texture. Further, all of the materials there are simply examples of a specific material, and are not ridged rules that must be follow for every type of rock, metal, plastic, etc. In real life there will be tons of variance based on tons of different factors. This is especially true with gloss/roughness (just different words for the same concept), it will simply vary a huge degree by the specific content of the surface, in other words, the microsurface.

    Now, to the actual process shown in the video. There is one problem with inverting the texture and setting it to soft light. While yes, this will decrease lighting contrast, it also decreases overall contrast as well. There are certain areas in that rock texture that have much more contrast before you do your adjustment (like the light colored areas of the rock), the reason for this is not due to the lighting, but because the light areas are actually a brighter material. So you may want to create a layer mask to make sure you're not reducing contrast where it doesn't make sense to do so.

    Hope this helps.
  • Deadity
    EarthQuake wrote: »
    No problem, I just got a chance to watch the video and had some notes:

    Generally for rock (unless it had a high metal content) metalness would be 0.

    Hope this helps.

    What difference would the metal content make in a rock? Aren't metals usually oxide compounds in rocks and thus dielectric materials. Unless they are noble metals like gold or platinum they would still have a metalness of zero.

    Or am I completely misled on this one?
  • EarthQuake
    Deadity wrote: »
    What difference would the metal content make in a rock? Aren't metals usually oxide compounds in rocks and thus dielectric materials. Unless they are noble metals like gold or platinum they would still have a metalness of zero.

    Or am I completely misled on this one?

    Yeah sorry I should have clarified, unless you have some raw metal like gold popping out of the rock, in which case those areas would be flagged as metal. But really that isn't rock, its simply a separate material in those places anyway so you have a good point.

    I'm not really a geology export, but what about something like this?
    DSC00001_zps93edaaff.jpg
  • Maximum-Dev
    Offline / Send Message
    Maximum-Dev Polycount Sponsor
    Thanks all for guiding me and specially you EQ for shining some light on the thread.
    So I have a question raised in my mind.

    1. I have a bar which is made out of metal but is painted of course with orange and white so it makes me to use a black metalness map right? (But for some scratches that has cut smoothly into the surface).

    2. You also have a painted metal preset in your chart. Well it has it's own median. Judging by my model having 2 different major colors on it, i have to have separate median values for those parts correct? (using masks of course) and as I understand you are not able to scan whatever material exists in the real life, not going into whole the color range but some basic colors like white and orange paints on the model I wonder where the median should lie.


    Bar.jpg


    Thanks a ton for the replies.
  • EarthQuake
    When you're texturing its important to remember that you're only defining the top layer. So paint on top of metal is just paint really, the reflectivity value for white and orange paint is probably exactly the same. The gloss level might vary depending on how glossy the paint is for each.

    If there is raw metal below the paint that is reveled with scrapes and scratches, those areas would be tagged as metal. However, if those areas are heavily rusted, you would tag them as not metal, as rust isn't metal anymore (rust used to be metal).
  • Deadity
    EarthQuake wrote: »
    I'm not really a geology export, but what about something like this?
    DSC00001_zps93edaaff.jpg

    I believe that rock is zink sulfide ore, which would make it a dielectric or an insulator. Sulfide compounds don't conduct electricity but they might take the form of shiny crystals. Not everything shiny is a metal. You could polish coal to make it look shiny but it would still be a dielectric material.

    EDIT: Actually it's a semiconductor. Still not a metal though. Oxides and sulfides shouldn't be considered metals.
  • Jack M.
    Offline / Send Message
    Jack M. polycounter lvl 4
    Thanks for the tips EQ on the your previous post regarding the mistake in the video. I'll be sure to note those things in the description.

    The following posts were quite helpful in clearing up some pbr questions as well.
  • ArtbyV
    Offline / Send Message
    ArtbyV polycounter lvl 3
    I'm trying to get accustomed to working in PBR and this tutorial helped me wrap my head around a few things that I was just missing. Thanks! Looks like you have a lot of helpful stuff posted which I'll definitely be using. Subbed.
  • Jack M.
    Offline / Send Message
    Jack M. polycounter lvl 4
    Hey ArtbyV,

    I'm glad you liked the tutorial. I'm always tying to make some when I learn some new stuff that I think people would like to see so keep an eye out.
  • stephen_015
    Thanks for the tutorial. I'm also struggling with the PBR workflow, as I am new to it, and your thread clarified plenty. Now to apply it to my own projects...
Sign In or Register to comment.