Home Technical Talk

How do i make a specular map?

Sims_doc
polycounter lvl 7
Offline / Send Message
Sims_doc polycounter lvl 7
3D Max 2012

How do i make a specular map? i've already tried doing it on a object with its AO already applied but it resulted with a black map even when there is a skylight in the scene.

the specular settings where essentially the same as AO map just rather than an ambient occlusion with metal ray in diffuse at 128 but instead specular.

Replies

  • ZacD
    Offline / Send Message
    ZacD ngon master
    No one bakes a specular map, you can combine various bakes to help make a texture map, and I guess you could bake a procedural texture to help make a specular. I'm just a bit lost on what you are exactly trying to do and why.
  • Sims_doc
    Offline / Send Message
    Sims_doc polycounter lvl 7
    ZacD wrote: »
    No one bakes a specular map, you can combine various bakes to help make a texture map, and I guess you could bake a procedural texture to help make a specular. I'm just a bit lost on what you are exactly trying to do and why.

    I'm under the impression from a friend that specular maps do shininess for objects within a game such as Team Fortress 2.
  • snoop
    Offline / Send Message
    snoop polycounter lvl 7
    Yes, but you still do not bake them. In current gen games, white in the specular means more shiny, black means less. You need to make it from scratch or base it off the diffuse texture or something, but there's not really a way to bake one.
  • Sims_doc
    Offline / Send Message
    Sims_doc polycounter lvl 7
    snoop wrote: »
    Yes, but you still do not bake them. In current gen games, white in the specular means more shiny, black means less. You need to make it from scratch or base it off the diffuse texture or something, but there's not really a way to bake one.

    then simply if it has to be done manually why is there an option to bake one then? it seems very odd to have something that isn't at all in use.
  • Stirls
    Offline / Send Message
    Stirls polycounter lvl 8
    Have you tried baking one and examining the results? What does it look like? Most of the artists I know hand-paint or manually alter their specular maps.

    You can also add colours to your specular maps, to change the specular highlights. I used to just make a copy of the diffuse, desaturate it, and play with the curves in PS before I found that one out. -_-
  • snoop
    Offline / Send Message
    snoop polycounter lvl 7
    3ds max is not just used by game developers, it is a tool used for many things, including architectural design and making assets for movies. just because the option is there doesn't mean you have to use it or that it should be used, obviously. I can understand your confusion somewhat but it also seems like you are trying to use it as a shortcut to actually putting in work--if this isn't the case then excuse me and sorry to come off as rude. However, if you are, and if you still plan on making game art in the future there isn't really a substitute for putting in the work. Anyway, yes, you are going to have to either handle the specular settings in the game engine itself (you don't always need a specular map) or make the specular in a photo manipulation program like photoshop or gimp. Just look up any current gen texturing tutorial and you should get a pretty good understanding of what it is you need to do.
  • Sims_doc
    Offline / Send Message
    Sims_doc polycounter lvl 7
    Stirls wrote: »
    Have you tried baking one and examining the results? What does it look like? Most of the artists I know hand-paint or manually alter their specular maps. -

    I have examine the results although I'm not entirely sure they are present in the renders with a generous amount of specular applied to the material that was baked.
    snoop wrote: »
    Just look up any current gen texturing tutorial and you should get a pretty good understanding of what it is you need to do.

    In this case its more last generation but i get what you mean, but the problem tutorials always seem to be out of date or tend to be missing certain things.
  • EarthQuake
    Last or current or next gen, a specular map defines how reflective a surface is. This is something you define yourself, not a map that can be generated like an AO or cavity map.

    Max doesn't know how reflective your object is unless you tell it.

    The reason specular is a map you can bake, is so that if you texture your highpoly model, you can bake the specular map along with the normal, diffuse, etc down to the low poly model.
  • Stirls
    Offline / Send Message
    Stirls polycounter lvl 8
    This is a great tutorial about specular maps.
    https://www.youtube.com/watch?v=5Gqp4bNJ52M
  • Farfarer
    I think what you might be seeing the option to bake in Max is a specular lighting map. That's not the same thing - you'd be baking what the specular lighting looks like on the model for the current camera/light position and that's not what you're after.

    What you're wanting to make is a texture map that defines how bright the specular highlight on the surface is and you do that yourself by painting values where black = no highlight and white = full highlight, the shades of grey between there blend between those extremes.

    And, with TF2, there's also a gloss map, which controls how sharp or broad the specular highlight is. Black = very broad, dull specular highlight (an extremely rough surface - not glossy) and white = very tight, sharp specular highlight (an extremely smooth surface - very glossy). And again, levels of grey blend between those two extremes.
  • SaboR1996
    Offline / Send Message
    SaboR1996 polycounter lvl 8
    reality_luxrender_specular_vs_gloss_guide_by_rivaliant-d6uaj5p.jpg

    This picture shows spec vs gloss in a nutshell.
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 14
    I'm guessing that you are at a place where you are trying to fill in gaps to your understanding since you said you have seen tutorials but they "tend to be missing certain things". Simply put, most spec maps are made by taking the diffuse map in Photoshop and quickly editing it. Below is one of my own where I simply took the diffuse, desaturated it, Gaussian blurred it, and made a levels adjustment:
    tex01.jpg

    On the following example I did bake a map (complete or lighting ... can't remember) of a raytrace material on the blade of a sword because I wanted the distinctive hook-shaped shine across the blade. I simply added it in the spec map in Photoshop. Again the spec was made by taking the diffuse in Photoshop and "messing with it" ... this is simply another layer added and adjusted accordingly. Another method I used on this one however was I did paint the black area's spec with a texture brush in Mudbox. I wanted a speckle effect on the shininess of the black parts that weren't present in the diffuse. I placed the mudbox painted spec on another layer in Photoshop and adjusted accordingly:
    tex02.jpg

    Here's a quick little texturing tutorial I grabbed from the Polycount Wiki which has a brief, simple method for making a specular map:

    http://pioroberson.com/tuts/tut_texturing_tricks.htm

    Of course this is a start. You would want to ask yourself about the different surfaces on the meshes and how they would reflect light differently. In other words the blade of a sword should highlight sharper with more white than a red cloth. Also notice that I took the yellow shapes out of the spec for the gun because they shouldn't highlight differently. Hopefully that might clarify some things for you.
  • EarthQuake
    I'm guessing that you are at a place where you are trying to fill in gaps to your understanding since you said you have seen tutorials but they "tend to be missing certain things". Simply put, most spec maps are made by taking the diffuse map in Photoshop and quickly editing it. Below is one of my own where I simply took the diffuse, desaturated it, Gaussian blurred it, and made a levels adjustment:

    Very, very much no to this. A specular map defines how reflective a surface is. Its not something you can simply adjust from a diffuse map the majority of the time. A spec map should be worked on in conjunction with the diffuse and gloss maps, spec/gloss are not after thought maps that you can quickly derive from a diffuse map, instead they are essential to defining the material and must be worked on from the beginning.

    Your above example with the gun is a perfect example of how not to make a spec map. There is no logic at all in the creation. Scratches in the paint that reveal what I assume would be metal are darker in the spec map. Why? Metal is more reflective than paint, those areas would be brighter in the spec (and glossier in the gloss).

    The first thing you need to do when creating a spec map is figure out what the material is you're representing. Is it paint? Is it metal? Is it wood? Once you do that, figure out how reflective the material is, there are a variety of sources online to find this information, but you should search for reference and observe materials in real life as well. When you know how reflective a material is you have your base specular value.

    You repeat this process for every material type on your texture.

    Also, you should not bake lighting of any sort into a spec map, again a spec map defines the reflectivity of a material, you don't paint the actual highlight in there(the shader takes care of this). You generally should not use AO in spec maps either, at least with current gen shaders, as reflections are view dependent and do not really get occluded like diffuse lighting.
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 14
    EarthQuake wrote: »
    Also, you should not bake lighting of any sort into a spec map, again a spec map defines the reflectivity of a material, you don't paint the actual highlight in there(the shader takes care of this). You generally should not use AO in spec maps either, at least with current gen shaders, as reflections are view dependent and do not really get occluded like diffuse lighting.

    Thanks, Earthquake. And you're right about those scratches, I wasn't thinking about the true purpose of the map at that point.

    I don't want to get off topic from Sims_doc's original question (I will post a new thread of my own soon) but I do want to address the point above (since I have the opportunity). I want to have a better grasp of the use (or lack of) AO in specular maps. I have read and heard to place AO and some shadow info in the spec. I wasn't placing the shadows in spec maps myself until I read to do so (wish I could remember the source :( ). Naturally the reflectiveness of the material won't change based on the angle you see it at. The tutorial I'm thinking of was making the argument that with game engines, it will simply help the model to appear more 3d dimensional, and help the parts of the model to appear protruding and receding.

    What about the following comment:

    http://youtu.be/0PbaqhjlLTA?t=6m46s

    thoughts? thanks
  • Quack!
    Offline / Send Message
    Quack! polycounter lvl 17
    Thanks, Earthquake. And you're right about those scratches, I wasn't thinking about the true purpose of the map at that point.

    I don't want to get off topic from Sims_doc's original question (I will post a new thread of my own soon) but I do want to address the point above (since I have the opportunity). I want to have a better grasp of the use (or lack of) AO in specular maps. I have read and heard to place AO and some shadow info in the spec. I wasn't placing the shadows in spec maps myself until I read to do so (wish I could remember the source :( ). Naturally the reflectiveness of the material won't change based on the angle you see it at. The tutorial I'm thinking of was making the argument that with game engines, it will simply help the model to appear more 3d dimensional, and help the parts of the model to appear protruding and receding.

    What about the following comment:

    http://youtu.be/0PbaqhjlLTA?t=6m46s

    thoughts? thanks

    Removing pre-computed lighting from your diffuse and spec is the modern thinking, brought about by modern engines that use physically based rendering.

    Placing lighting on your diffuse/spec was to make up for the computers lack of ability to do this in the shader/engine. We can now do that, so we have to deprecate habits like this.

    If you read up a bit on how to author maps for physically based rendering you will get a more detailed description of it.

    With that said, in old school rendering methods or in stylized methods you still can add that info in as you artistically see fit.
  • EarthQuake
    Yeah, with current gen/pbr stuff and AO, generally it will be added as a separate map, this lets the shader do smarter things with it, like not apply it to direct/dynamic lights for instance. Also, generally screen space reflections will take care of the need to throw AO on spec to remove cubemap reflections in occluded areas, which was more of an issue in the past than it is today.

    AO with modern shaders tend to be less of the large scale AO we're used to baking and more micro-AO or cavity type maps as well. I wrote a bunch about this in this thread: http://www.polycount.com/forum/showthread.php?t=135385
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 14
    Thanks again :thumbup:
  • Fogbrain
    Offline / Send Message
    Fogbrain polycounter lvl 5
    I don't wanna derail the thread or anything, but I have a similar question, what about creating effects maps like subdermal maps. Would you create those in conjuction with your diffuse also? What exactly is the process

    Anyway, this threads been an eye opener. I haven't treated specular maps and anything similar with the same treatment as my diffuse. I'll have to follow what EarthQuake said, and basically use brushes/adjustment layers with masks in photoshop to gain the effect I need.
  • EarthQuake
    What about the following comment:

    http://youtu.be/0PbaqhjlLTA?t=6m46s

    thoughts? thanks

    What he says here half makes sense and half doesn't.

    "because its dark" - this bit makes no sense. Materials do no become less reflective when less light hits them, this is simply nonsense. If you multiply AO on your spec, this means that if you have a dynamic light pointed directly at that section, it will not reflect at the same intensity as the rest of the surface.

    "dirty materials will reflect less", so this makes sense to some degree. Though again, simply multiplying the AO and calling it a day is not the way to do it. If you want to create a layer of dirt, you may want to start with the AO map as a base for a layer mask for said dirt. However, you're defining a material now, not just throwing a map on top "because".

    In this case, it depends on the materials too. Dirt actually isn't all that less reflective than most non-metals, where the variance really is is with the gloss/roughness map. Dirt is a lot rougher than said, paint, so the highlight will be spread out further and dimmer. Though mud on the other hand, may be smoother than the base material, which means a tighter highlight. Again you have to think about the material you're actually defining, not simply using a certain map for a global effect.

    With modern shaders, there is energy conservation with the gloss/spec map, what this means is that as the highlight gets wider (rougher surface) its appearance gets dimmer. The reflection does not decrease in intensity, its simply spread or scattered over a wider surface. This means that much of your texture variation actually goes into the gloss/roughness map, and not the spec map. Some engines like UE4 do not use a spec map at all, and instead have a "metalness" map, which is a map that flags surfaces as metallic or non-metal. For metals, the spec or reflectivity, is taken from the diffuse/albedo channel (pure metals have very little diffuse reflection), while non-metals get a fixed reflectivity of 0.04. Most non-metals reflect somewhere near that 0.04 number.

    More on all of this here:
    http://www.marmoset.co/toolbag/learn/pbr-theory
    http://www.marmoset.co/toolbag/learn/pbr-practice - there is a short segment here about actually setting up the texture content too

    Now, some of you guys will say "but thats only for pbr shaders". Well, yes and no. The basic concepts are the same for older shaders, provided you have diffuse/spec/gloss/normal inputs.

    There are some differences, mainly energy conservation with less advanced shaders. In that case you may need to do the energy conservation v roughness thing manually. By that I mean, for glossier surfaces your spec map would be a little brighter, and for rougher surfaces a little darker. But its still important to remember that metals are way, way more reflective than non-metals.

    Paint again for instance, in the above example of the white gun, the spec map value would be nowhere near white. Its important to understand energy conservation in terms of reflectance too. If your texture has an almost white (lets say 0.9) diffuse, and an almost white (0.9) spec map, what you're really saying is that the material reflects 1.8x the amount of light it receives. This is physically impossible. Modern shaders generally "fix" this for you by darkening your diffuse automatically. However, this is a basic concept that is really important to understand. Materials can not reflect more light than they receive, and most materials reflect less light than they receive (they absorb some of it, generally).

    Again, someone will probably say thats "only for pbr". But its not. This is basic material definition stuff, and good texture artists have been thinking logically along these lines for a long time, way before the PBR thing was a buzzword. The dirty little secret is that for the past 10 or so years, all shaders(except for stylized/non-photorealistic ones) have been trying to be "physically accurate", its just that today we have better hardware that lets us accomplish that goal better, and some of the approaches have been standardized a bit more and given a name (PBR).
  • EarthQuake
    Fogbrain wrote: »
    I don't wanna derail the thread or anything, but I have a similar question, what about creating effects maps like subdermal maps. Would you create those in conjuction with your diffuse also? What exactly is the process

    This will depend on exactly how your skin shader works and what the sub-dermis map defines exactly. But yeah, again probably not a map you should just wait until the end to make, as previewing your diffuse work without even a basic sub-dermis map will mean you'll end up adding stuff to the diffuse that should probably go in the sub-dermis.

    We talked a bit about what the subdermis does in TB2 here: [ame="http://www.youtube.com/watch?v=DAyx-C3O1Hc"]Toolbag 2 | Shader Setup for Characters *Live Demo* - YouTube[/ame]
    Anyway, this threads been an eye opener. I haven't treated specular maps and anything similar with the same treatment as my diffuse. I'll have to follow what EarthQuake said, and basically use brushes/adjustment layers with masks in photoshop to gain the effect I need.

    You don't neccesarily need to paint each map by hand. Lots of times you can start your diffuse layer, set up some base values, then copy that layer with layer mask etc for that specific material to the gloss and spec respectively and make further adjustments.

    A good example would be for scratches in paint revealing metal. A real basic way you can do it, first off, make a metal layer, set up the values (can be just simple colors to start) in the diffuse, spec and gloss. Then, add another layer on top for paint, set up base values in d/s/g again, and then paint a layer mask in your diffuse channel for where you want to have scratches to show the metal underneath. Copy that layer mask to the spec and gloss and you're good to go. Some apps will automate much of this, like Quixel's DDO and Substance painter.

    layering01.jpg

    From the tutorial linked above ^. Each of those spheres are base materials I created for each material, then I simply layered them with layer masks in a logical order, bare metal first, primer, black paint, then color paint for text, how it would be constructed in the real world.

    The big thing to avoid is working on your diffuse from start to finish and then doing the spec/gloss afterwords as if they are not important/can be created with a few basic layer adjustments. They can't really, they are both an integral and important (more important than diffuse for certain materials) part of the process.
  • Fogbrain
    Offline / Send Message
    Fogbrain polycounter lvl 5
    EarthQuake wrote: »
    This will depend on exactly how your skin shader works and what the sub-dermis map defines exactly. But yeah, again probably not a map you should just wait until the end to make, as previewing your diffuse work without even a basic sub-dermis map will mean you'll end up adding stuff to the diffuse that should probably go in the sub-dermis.

    We talked a bit about what the subdermis does in TB2 here: Toolbag 2 | Shader Setup for Characters *Live Demo* - YouTube



    You don't neccesarily need to paint each map by hand. Lots of times you can start your diffuse layer, set up some base values, then copy that layer with layer mask etc for that specific material to the gloss and spec respectively and make further adjustments.

    A good example would be for scratches in paint revealing metal. A real basic way you can do it, first off, make a metal layer, set up the values (can be just simple colors to start) in the diffuse, spec and gloss. Then, add another layer on top for paint, set up base values in d/s/g again, and then paint a layer mask in your diffuse channel for where you want to have scratches to show the metal underneath. Copy that layer mask to the spec and gloss and you're good to go. Some apps will automate much of this, like Quixel's DDO and Substance painter.

    layering01.jpg

    From the tutorial linked above ^. Each of those spheres are base materials I created for each material, then I simply layered them with layer masks in a logical order, bare metal first, primer, black paint, then color paint for text, how it would be constructed in the real world.

    The big thing to avoid is working on your diffuse from start to finish and then doing the spec/gloss afterwords as if they are not important/can be created with a few basic layer adjustments. They can't really, they are both an integral and important (more important than diffuse for certain materials) part of the process.

    Thanks EarthQuake, it's been a joy reading more in depth about PBR and the importance of reflection and layering. I'm beginning to wrap my head around this stuff now and I'll have a better idea of what I want rather than slapping on random values and maps too late in the pipeline to accurately represent the object I'm aiming to visualize in a physical space.


    When talking about layer masks, is that basically taking a group/layer, adding a mask onto it and painting black in the areas you don't want seen in that base material? Because it would make alot of sense, definitely, to define the scratches on for example a paint material group/layer with a mask, so the metal underneath can be seen in the gloss or specular maps.

    So any of those details being seen through those material layers would be defined through a mask which is applied to only those effects maps and not the diffuse? Or probably applied to all of them, since diffuse now is combined with reflectivity.

    Another thing I've noticed is that the values of colors can define what material you're trying to accomplish correct?

    dontnodgraphicchartforunrealengine4.png


    And such things like metalness and roughness are not maps but values between 0 and 1?

    It's alot of juggling to get things right, especially in Photoshop, so stuff like DDO and Substance Painter intrigue me. Painting onto our objects in 3D space and 2D space with constant updates to the model to get the correct values seems alot more streamlined than Photoshop. Which don't get me wrong, is a fantastic tool, always will be. But in future I see myself using something like Substance Painter to cover my seams seamlessly, in a rendered lighting environment.

    It's a very confusing shift, and the language of PBR is all very confusing in itself. It'll be a while before someone comes up with the standard to go by. So far I think Marmoset has that covered.
  • EarthQuake
    Fogbrain wrote: »
    Thanks EarthQuake, it's been a joy reading more in depth about PBR and the importance of reflection and layering. I'm beginning to wrap my head around this stuff now and I'll have a better idea of what I want rather than slapping on random values and maps too late in the pipeline to accurately represent the object I'm aiming to visualize in a physical space.


    When talking about layer masks, is that basically taking a group/layer, adding a mask onto it and painting black in the areas you don't want seen in that base material? Because it would make alot of sense, definitely, to define the scratches on for example a paint material group/layer with a mask, so the metal underneath can be seen in the gloss or specular maps.

    So any of those details being seen through those material layers would be defined through a mask which is applied to only those effects maps and not the diffuse? Or probably applied to all of them, since diffuse now is combined with reflectivity.

    Another thing I've noticed is that the values of colors can define what material you're trying to accomplish correct?

    Those are measured base values, so that would be your starting point.
    And such things like metalness and roughness are not maps but values between 0 and 1?

    Metalness and roughness values will usually be defined with a map, especially if you have more than one surface type in your map. If your map is only metal, then a metalness map is probably redundant. However, if your have metal, and rust, and dirt, you would want the rust and dirt to be 0 (black) in the metalness map. For gloss/roughness, you almost always want a map, as surface variance is usually defined there.
    It's alot of juggling to get things right, especially in Photoshop, so stuff like DDO and Substance Painter intrigue me. Painting onto our objects in 3D space and 2D space with constant updates to the model to get the correct values seems alot more streamlined than Photoshop. Which don't get me wrong, is a fantastic tool, always will be. But in future I see myself using something like Substance Painter to cover my seams seamlessly, in a rendered lighting environment.

    Yeah, I think that is the general direction the industry is trending, especially with dDo, substance, mari, etc.
    It's a very confusing shift, and the language of PBR is all very confusing in itself. It'll be a while before someone comes up with the standard to go by. So far I think Marmoset has that covered.

    We've tried to support as wide of a range as we can, as some of the stuff does vary a bit. GGX support for better matching with unreal 4 coming soon. :)
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 14
    Fogbrain wrote: »
    Thanks EarthQuake, it's been a joy reading more in depth about PBR and the importance of reflection and layering. I'm beginning to wrap my head around this stuff now and I'll have a better idea of what I want rather than slapping on random values and maps too late in the pipeline to accurately represent the object I'm aiming to visualize in a physical space.

    ^ This :thumbup:

    I'm deep into studying PBR right now (just started reading seriously into PBR after discussing things on this thread)

    @Earthquake: Your response was everything I'd ask to hear. Thanks.

    Correct me if I'm wrong here: Speaking as someone deep into serious portfolio development, using the free UDK and the free version of Unity, and just now reading up on PBR, I should just switch to PBR workflow immediately right ? I'm texturing a full room at the moment (last month's noob challenge 20) and just got a crit sending me to the PBR page on the Wiki.

    I found the following but couldn't really see a clear answer agreed upon, but it seems like people are using UDK and Unity with PBR:

    http://www.polycount.com/forum/showthread.php?t=124683

    I will look into this shortly:

    http://www.polycount.com/forum/showthread.php?t=124934

    So my question is whether I need to use these methods to move forward, or do you really need to pay for PBR supporting software? :)
  • Quack!
    Offline / Send Message
    Quack! polycounter lvl 17
    I would just pony up $19 and get UE4.

    UDK only does PBR if your team has converted it to do so, so that is out for most.

    For unity free, you will have to cobble together quite a bit of add ons to get it up to UE4's quality.

    Toolbag2 is a fantastic package to display work in but has a bit steeper price then UE4.

    Unity 5 will have PBR built in, but until that is released, UE4 is your best value.

    With all that said, a very well done environment that is NOT PBR will get you noticed just as much as a very well done PBR environment. As long as your show that you know composition, lighting, form, function, and a game engine, it's all gravy. PBR is just an evolution of those ideas.
  • ScottHoneycutt
    Offline / Send Message
    ScottHoneycutt polycounter lvl 14
    Quack! wrote: »
    I would just pony up $19 and get UE4.

    UDK only does PBR if your team has converted it to do so, so that is out for most.

    For unity free, you will have to cobble together quite a bit of add ons to get it up to UE4's quality.

    Toolbag2 is a fantastic package to display work in but has a bit steeper price then UE4.

    Unity 5 will have PBR built in, but until that is released, UE4 is your best value.

    With all that said, a very well done environment that is NOT PBR will get you noticed just as much as a very well done PBR environment. As long as your show that you know composition, lighting, form, function, and a game engine, it's all gravy. PBR is just an evolution of those ideas.

    Ace response. Thanks :)
Sign In or Register to comment.