Home Technical Talk

PBR Mixed With Normal Textures In One Enviro

Hey guys quick question, I'm working on a enviro in UE4 and am still getting the grasp of PBR textures. I still use the original technique of diffuse spec and normal and am getting into the albedo, roughness maps. Is it okay if my environment has a little bit of both types of textures? Some props that use the original technique we all used in UE3 with diffuse and spec maps and then some of the hero props/tile able textures and metals using the PBR technique? Thanks for any feedback! :)

Replies

  • EarthQuake
    UE4 only supports the albedo/metalness/roughness workflow. You can't use a standard spec map in Unreal 4.

    So you will probably want to convert the content.
  • ZacD
    Offline / Send Message
    ZacD ngon master
    Don't use the specular option in UE4 for your average specular textures, it's not going to work like how you expect it to, and it's mostly left in for legacy purposes.
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    EarthQuake wrote: »
    UE4 only supports the albedo/metalness/roughness workflow. You can't use a standard spec map in Unreal 4.

    So you will probably want to convert the content.

    Not 100% true you can write your own shader code to support other types of shaders.

    but ya as far as the built in editor yes
  • EarthQuake
    passerby wrote: »
    Not 100% true you can write your own shader code to support other types of shaders.

    but ya as far as the built in editor yes

    Right, I'm just talking out of the box. Theres full source, so in theory you can do anything you want with UE4, provided you have a programmer to do it.
  • kimchee519
    passerby wrote: »
    Not 100% true you can write your own shader code to support other types of shaders.

    but ya as far as the built in editor yes

    Ya I noticed that some of the default materials that come with UE4 have some that are just a combination of diffuse and normal texture for the entire materiel, that kind of threw me off thinking it was okay to still use diffuse in UE4. So they must of some good programming behind these diffuse textures that look like photos that come stock with UE4 in sample materiels they have on there?
  • kimchee519
    Just watched the new Unreal Engine 4 Twitch Broadcast talking about the new Landscape flying though, looks amazing. The SR tech artist was talking about the textures he used for the scene and said he used "Diffuse" "Roughness" and "Normals", so is that still considered PBR even though it has a diffuse? I guess I'm just trying to understand if it's okay if I still use a diffuse instead of a albedo map. It seems like it's okay just use a diffuse, with roughness (in place of the spec) and a normal map to create a material in UE4 and come out with good results like I've seen in the new Unreal Engine 4 Twitch Broadcast, I never really hear them talking about albedo maps in their textures? Any Ideas?
  • ZacD
    Offline / Send Message
    ZacD ngon master
    Albedo and diffuse are pretty similar, so I can understand people using the same terms, but the base color texture should not contain any lighting information and be as physical accurate as possible.
  • kimchee519
    I'm guessing when their referring to the diffuse map their meaning to refer the to the albedo they created, but really are just still naming it diffuse or _D after the texture name. Just reading forums and seeing so many different ways to go about PBR texturing kinda confuses me. Some people plug in their spec map into the spec slot and also use AO maps in the AO slot, but then some people say that both spec maps and AO are of no use anymore.
  • ZacD
    Offline / Send Message
    ZacD ngon master
    Definitely don't use spec anymore, I haven't heard much about AO, I don't know if the engine handles AO in a physically accurate way, I'd like more information on that.
  • kimchee519
    I've read that spec is actually still used quite often, with masking behind them metalness.
  • EarthQuake
    It seems like you're coming to some strange conclusions here based on a variety of sources with incomplete information.

    I would recommend reading the tutorials we wrote for Marmoset Toolbag 2, which cover general PBR theories as well the differences between the specular and metalness workflows:
    http://www.marmoset.co/toolbag/learn/pbr-theory
    http://www.marmoset.co/toolbag/learn/pbr-practice

    As well as Epic's official docs:
    https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/index.html

    Traditional specular maps are still used in some PBR pipelines, but not UE4. UE4 uses the metalness workflow to define reflectivity. When using metalness maps, your albedo texture is both your diffuse (for non metals) and specular intensity/color (for metals) maps. Pure metals don't have any diffuse contribution, so the specular content is stored in the albedo map. On the other hand, most non-metals have a reflectivity in the 2-8% range, which is simplified to a to a fixed general purpose value of 4% for all non-metals. Non metal in this sense would be a material with a value of 0 (black) in the metalness map (or a constant value of 0 in your shader node).

    The specular input in EU4 is not a traditional specular input in any sense. What it is is an additional value on top of the reflectivity for non metals, for instance if you have a material that is has a reflectivity of less than 4% you may want to use the specular map, but this is a rare case and generally it is best to simply avoid using this map. This map can also be used as a cavity map, as outlined in Epic's docs. Again, this very different from a traditional specular intensity map, so don't think of it as such.
    Epic wrote:
    The Specular input should not be connected and left as its default value of 0.5 for most cases.

    It is value between 0 and 1 and is used to scale the current amount of specularity on non-metallic surfaces. It has no effect on metals.

    Commonly, if we modify Specular, we do so to add micro occlusion or small scale shadowing, say from cracks represented in the normal map. These are sometimes referred to as cavities. Small scale geometry, especially details only present in the high poly and baked into the normal map, will not be picked up by the renderer's real-time shadows. To capture this shadowing, we generate a cavity map, which is typically an AO map with very short trace distance. This is multiplied by the final BaseColor before output and multiplied with 0.5 (Specular default) as the Specular output. To be clear this is BaseColor = Cavity*OldBaseColor, Specular = Cavity*0.5.

    For advanced use, this can be used to control the index of refraction (IOR). We have not found this to be necesary for 99% of Materials. Below are Specular values based off of measured IOR.



    For non metals, diffuse and albedo maps are basically interchangeable terms. They mean more or less the same thing, though albedo is a little more specific and accurate term. With PBR workflows, you no longer want any baked lighting, be it directional or ambient, in your diffuse/albedo map.

    AO is still often used, but usually more of the micro-occlusion sort, your AO shouldn't have large scale gradients but should represent the smaller cracks and crevices instead. AO maps for PBR workflows tend to be more like cavity maps than what you may commonly think of as AO. The reason for this is that your lighting system should generally handle the large scale occlusion.

    AO is generally best used as a separate map so that the shader can do more sensible things with it.

    Gloss or roughness maps do not really "replace" spec maps. Gloss/roughness maps determine the glossiness or roughness of the surface. If you used a diffuse/normal/spec/gloss shader in the past, the gloss map does basically the same thing it did previously, it defines the highlight size, while reflectivity is still set with a specular intensity map or the metalness workflow as described above. A roughness map in most cases is simply an inverted gloss map, where black (0) = most glossy and white (1) = most rough.

    If you were using diffuse/spec/normal shaders with no glass map previously, in that case some of the detail you would typically put in your spec map should go in your gloss map isntead. However, even with older d/n/s/g shaders you really should have been doing most of the work in the gloss map anyway (especially if you had image based lighting like Toolbag 1 era shaders which a lot of games used).

    There is a small difference with how gloss/roughness is handled these days and that is energy conservation. Now the gloss/roughness input sets not only the specular reflection highlight size, but also the intensity in an indirect way. The reflectivity doesn't actually change, however: Tighter highlights will appear brighter, while wider highlights will appear dimmer. This is because the same amount of light is hitting the surface, but with rougher surfaces, that light is spread out further.

    With old school workflows you may have had to account for this in your spec map as well as gloss, so in this case you can generally get away with less texture variation in your spec map. Usually a spec map should be a flat value for a given surface and only change when the physical material changes.

    The idea that gloss maps now replace spec maps in PBR is a misconception and a half truth at best really. There are certain situations where you will put some detail into your gloss map that you previously put into your spec map, however the two are fundamentally separate concepts:
    Reflectivity (how much light is reflected) is defined by the metalness workflow, or a specular intensity map (and in some rare cases a weird combination of both metalness map an and additional reflectivity multiplier).
    Microsurface (how bumpy or smooth the surface is) is defined by a gloss or roughness map.
  • kimchee519
    Thanks for the infromative reply EarthQuake After creating my maps for PBR in for UE4, I got my Base color, Metalness, roughness and normal. Connecting them is pretty simple in the material editor in UE4, but do any of you know any good tutorials on more complex PBR shaders than simply just plugging the maps in with with no other constant vectors or lerps?
  • ZacD
    Offline / Send Message
    ZacD ngon master
    What are you looking at making? There's a cool clear coat and SSS shader integrated into UE4. But the node based material system in UE4 allows for some really crazy shaders. You can make your own toon shaders, ocean shaders, planets, weather/clouds, some dynamic or animated shaders, lava and puddles using vertex painting, snow/dust that collects on surfaces, various levels of damage and decay with vertex painting, etc.
  • Joopson
    Offline / Send Message
    Joopson quad damage
    A bit of a tangent here, but has anyone written a shader for UE4 that allows the use of Specular workflow? I'd love to have the option, but I don't have the ability to do it myself!

    I'm sure a lot of people would love having the option.
  • sargentcrunch
Sign In or Register to comment.