Home Stickies

specular maps and normal maps

13
animatr
polycounter lvl 18
Offline / Send Message
animatr polycounter lvl 18
have some procedural questions about spec maps and normal maps. First of all, spec maps: what's the best way of creating a specular map? What are some tips and tricks and what not that make great spec maps? I know what a specular map does, but i have seen many specular maps that i look at and not sure they look like they do. Poop has one for his skateboarder on his website that particular interests me.

And for normal maps: What's the best way to get your spec map to really bring out that normal map? What normal map generation program do most of you use? (i have been using max's projection mapping, but not too happy with the results. I tried using Melody, but I was getting strange results just trying to do a projection like in max)

and most importantly, what's the best way to paint your diffuse for your normal map? do you paint over the normal map? is there a better method?

Thanks for your time!

Jeremy

Replies

  • Eric Chadwick
    I like to generate a heightmap at the same time I generate a normal map, which I find works great as an overlay or multiply layer on top of the specular, so the specular doesn't show in the deep cracks. If the heightmap doesn't look good, I'll generate an ambient occlusion map (AO) instead.

    I also like to multiply this on top of the diffuse map at 75% or less, depending. Adding a little AO is good, since real-time lighting usually doesn't include good AO (it is starting to be used though). Also provides a guide for color location.

    Specular maps... I just try to think like shininess. smile.gif Where would I be glossy, where not? If I am shiny, why am I? Wet? Smooth? Greasy? This helps me determine the color to use and where to put it.

    I find it helps sometimes to use a hue for the specular that's 180º or 120º from my color map hue, but subdued. Adds richness because it tends to desaturate the color mmap underneath the specular highlight, which then causes the rest of the texture to look more saturated. That's why you'll see people using purple or blue for the flesh tone specular, because it's a kind of hack to get a sub-surface-scatter kind of look to the sides of the specular.

    Pior has a great tutorial that includes how to generate a specular, though for me painting is generally better/faster.

    Helps me to reinforce the specular with bump detail. I just did a Medeival stone wall with drippy green slime running over the stones... the normal map gives the slime a slightly-raised edge, the diffuse makes it a bit green, and the specular uses a light orangish color.

    I find it's good to use a full range of value for every map... thresholding a map to solid-ish colors reduces the richness of the texture. Holds true for color maps, specular maps, AO maps, etc. Specular color maps in most engines need to be fairly dark, but within that range you'll get better results with variation, instead of just solid areas of color.

    We had a good discussion about specular color and lighting awhile back, might be a good read. I used to use the nick "posm"...
    http://dynamic.gamespy.com/~polycount/ubb/Forum8/HTML/004130.html?00037


    Whew. Typing this out is good for me, helps me think.
  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    Hey animatr, I have some thoughts about creating specular maps here: http://www.3dm3.com/tutorials/maya/character/index6.php
  • Eric Chadwick
    Hey Daz, what's the reasoning behind painting the pores as bright dots? I'd think you would want the inverse... dark inside the pores, light on the rims all around them, so the specular stays outside. When I look closeup at my own face, the insides of the pores shine the least. (or maybe I just need a good scrubbing)
  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    Well, I guess it depends how you visually read the image as to wether or not you see the white as dots. I kinda see it more as the black is breaking up the white. But I dunno. It's really whatever works that counts. Im sure you could come up with a much better representation of a skin pattern. I don't actually use this one anymore, but If I posted what I do use, I'd be giving it all away! smile.gif This was about principles really, as opposed to the Art assets themselves.
  • animatr
    Offline / Send Message
    animatr polycounter lvl 18
    wow. thanks for the great info guys and all for the awesome links. learned tons of stuff. Makes me want to go back and redo some of my older stuff:) thanks again! If anyone has anymore tips and tricks, spread the joy!
  • CheeseOnToast
    Offline / Send Message
    CheeseOnToast greentooth
    Hey Daz...do you know any way to make spec maps show up in real time, in Maya's high quality display mode? I can change a Blinn shader's specular roll off and eccentricity with the sliders and these changes will be shown fine, but as soon as I plug in a texture it no longer displays. Any thoughts?
  • Eric Chadwick
    Well Daz, the result turned out great. That's all that matters! Did you use any color in his spec map, or was it purely an intensity map?

    On the same site as Daz's tutorial, there's also an old tutorial from J-J-J Mortimer. He has some info about specular color, though it looks like he used two maps as combo specular and reflection passes. Not much meat there in terms of info, but he did offer some nice large example images.
    http://www.3dm3.com/tutorials/maya/texturing/index6.php
  • Eric Chadwick
    Hey CheeseOnToast, I wonder if you could adapt Ben Cloward's excellent HLSL shaders for use in Maya? He supports real-time specular, etc. They're written for use in Max, but I would imagine Maya would somehow support these shaders as well...
    http://www.monitorstudios.com/bcloward/resources.html
  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    Haha, I just reread my own line which explains a few things:

    "Specular map 1 ) To be really clever here, we should probably use the same base texture pattern for skin colour base, skin bump and skin spec in terms of its patterning of skin pores. For some bizzare reason that I can't recall, I didn't in this case, but I think you'd have to be a pretty astute observer to notice. So starting from scratch, or from an existing base map you've made, create a pattern that looks somewhat like skin pores. "

    That'll make you the astute observer then Eric ;-p

    For skin I usually just use the stahlberg ramp method of tinting it blue to counteract the tendency for it to yellow when hi-lighted.

    CheeseOnToast: the weird thing about that is, at work we use the high quality display mode for normal maps, and some of us can get it to work, and some of us cant. I personally cant, and I think it's due to an aging grafx card. But the ones that can get the normal map showing in the viewport fine, just slot the spec in the spec colour and it just works!
  • PaK
    Offline / Send Message
    PaK polycounter lvl 18
    worthy to be sticky imo
  • Eric Chadwick
    Hahha Daz, not so astute if I didn't actually absorb your words the first time. Good tutorial, especially (for me) the image-reference section.

    I still don't understand the yellow-tendency thing. Per had a good point, in that other thread:
    -Specular is additive, and adding grey to anything retains the existing saturation.
    -If you want less saturation in the highlights, the specular map needs to be the opposite colour of the diffuse.


    I wonder if the yellowish highlight tint is because the skin color is (for caucasians) mostly tan already, and the white light is simply brightening the colormap.

    But when I look at a photo of someone in the sun (my son last summer), I don't see a yellow tendency.
    20050704jason.jpg
    What I see is the skin generally turning red right next to the light/shadow terminus, like under his cheeks and eyebrows. For me this is what makes skin come alive or not.

    So, if I'm thinking correct, using a bluish specular color seems to help solely because it desaturates the lit side, allowing the terminus to be more saturated, simulating SSS.


    I dunno, I'm still kind of confused about the colored specular thing. I'm thinking it mostly works this way because of our primitive lighting/rendering tools. I should probably have some 3D examples here instead of photos.
  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    Well, I guess I took mr. Stahlbergs word for it without really questioning it. I think you're right in your assessment of how the principle came about. It was all born from his attempt at vague SSS in the maya software renderer, so the desaturation could well be an attempt to bring out the red near the terminus.
    I've actually found that the blue-hi-lights thing works better in renders attempting to be outside, and I think that's because Im assuming that a very bright hi-light would be bouncing off a surface that is somewhat reflective and hence have some sky colour in it perhaps?
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Yep, I think Daz is right about the blue thing - if a subject was indoors and lit differently, blue might not be the best choice - it seems to work best for outside renders because the sky tends to tint a lot of things bluish on a sunny day.
  • sinistergfx
    Offline / Send Message
    sinistergfx polycounter lvl 18
    Well, that really depends on how blue you make it. Mainly the blue is to oppose the color of the skin so you get desaturated highlights. Helps you get away from the usual plastic-y look of cg.
  • Eric Chadwick
    OK that's what I thought. It seems to be a quickie to counteract our lack of rendering power. I see what you all are saying about the blue "northern light" part of outside lighting.

    We have something in the pipe here that might help out with this, but it'll likely incur multiple passes. The idea is to dynamically generate a mask between two materials, based on the light angle (or others), with some additional controls for the gradient. Should be cool...
  • Keg
    Offline / Send Message
    Keg polycounter lvl 18
    http://www.itchy-animation.co.uk/tutorials/light01.htm

    Set of tutorials talking about the properties of light. might be useful for some
  • Eric Chadwick
    Yeah, that's a good review Keg. Another here, from a painter's perspective. You've probably seen it.

    Hmmm, Per I'll have to disagree with you that the sunlight is yellow in this shot. The shiny wet parts look white to me. I see some mild yellow edge-ringing around his right forearm, artifact of the sharpen filter. But for the life of me I can't see any yellow light, anywhere. frown.gif

    Would have helped if there was something like a neutral-white reference ball to judge the color balance.

    I do agree though that the skin along the shadow edges is showing sub-surface scattering of the light, being filtered through the blood inside.

    Not trying to argue for/against blue speculars, I'm just not seeing it reflected in the real world. I do see however that it does serve to make a more varied surface, since we're mixing complimentary colors. Also I need to stop writing and start doing more. smile.gif
  • melissa
    Offline / Send Message
    melissa polycounter lvl 17
    This is great information guys thanks.
  • Etheros
    Offline / Send Message
    Etheros polycounter lvl 17
    Eric. woah, respect. I'l learm 3dsmax with your books.
    Glad to see you here.
  • Eric Chadwick
    Thanks, man. Gotta say though that the knowledge pool is much wider around here than me, I've learned a ton more from the amazing people on this board.

    And I've tried writing a book, well at least a chapter, and it wasn't really worth the effort, for me anyway. You can learn a lot from writing though, so I encourage others to give it a go. It's just not a money-making proposition, is all.
  • moose
    Offline / Send Message
    moose polycount sponsor
    Specular is a monster, especially when coping with your normal. One thing to remember that ive been making sure ive paid attention to was that all details you put into your diffuse should, in some form or another, exist in all other textures.

    You dont have to go ape shit and put noise all over your normal, but if there are major dark areas that are cracks or dings, it really helps to put this into your normal and specular maps. As for my process:

    I will get a mesh, and all sorts of render files from Ror; a Normal Map, ambient occlusion map, lit render, lighting render, shadows render, color map, and height map. When texturing, i will generally maily use the occlusion, and lighting maps, set them to overlay / multiply at a light opacity to get the general form of the high poly baked into the diffuse (subtly).

    From there i go to town on the diffuse, adding whatever it is that needs added. As i add major bits to the diffuse, i will go into the normal and get matching parts in it via the normal map filter in PS.

    After chunking and detailing, ill build up the specular based on diffuse information, either completely taking areas of spec out, or really poping areas up so they shine. In order to get the most out of all 3 maps, you need to keep things consistent and flowing, so it doesn't look random.

    For speculars, yes blues do work really well, and make some really pretty colors. However, you should think about what color your diffuse is, and what color you actually want the surface to be - since no one willsee your texture work in the dark, and light = specular. Ambient light will let you fill in the general colors, but when light hits it, there could actually be gold hidden under the grime. I try not to think about the technicalities of how light actually works (although ive read a bit to understand how it works and reflects light), and focus on "what looks the best?" If its blue, yay. If its gold, yahoo. Whatever is pretty smile.gif
  • Eric Chadwick
    Nice. Glad to see your post here moose. What do you use these days for viewing/refreshing the combined result while you work? The game you're creating for, or another tool like Modo?
  • moose
    Offline / Send Message
    moose polycount sponsor
    no prob, ive been missing my PC roots lately smile.gif

    i will go between a mix of Max, Maya, and just straight up in engine. Each has their drawbacks to make you grit your teeth, and make insane drawings, finding what works for you, and what shows off your work best is what matters.

    Max is nice, because it is extremely fast for updating your texture, however... i havent found a good way to show specular, diffuse, and normal in real time. If i use max, it'll be for tweaking UVs.

    Maya works, too and has the same perks of max (fast updating of updating textures), and some downsides of Max. You are able to have the specular show in the viewport in real time however it blooooooowwwsss the hell out of the images.

    9 times out of 10, its best to just preview, view, and make decisions based on what the stuff looks like in engine, whichever that may be. UE3 allows for relatively quick importing, and provides instant actual feedback of what the final asset it. Likewise for any other engine - Normal maps and specular are handled different in each engine (i assume), so that its best just to view whatever you're doing in the medium you want to present it.
  • Wrath
    Offline / Send Message
    Wrath polycounter lvl 18
    [ QUOTE ]
    Yeah, that's a good review Keg. Another here, from a painter's perspective. You've probably seen it.

    Hmmm, Per I'll have to disagree with you that the sunlight is yellow in this shot. The shiny wet parts look white to me. I see some mild yellow edge-ringing around his right forearm, artifact of the sharpen filter. But for the life of me I can't see any yellow light, anywhere. frown.gif

    Would have helped if there was something like a neutral-white reference ball to judge the color balance.

    I do agree though that the skin along the shadow edges is showing sub-surface scattering of the light, being filtered through the blood inside.

    Not trying to argue for/against blue speculars, I'm just not seeing it reflected in the real world. I do see however that it does serve to make a more varied surface, since we're mixing complimentary colors. Also I need to stop writing and start doing more. smile.gif

    [/ QUOTE ]

    Big difference between real world lighting and RGB models. The blue tint to specular maps is probably done to counteract some of that unnatural color result because of the math involved.

    Just as an example, if you were to take a red object in life and shine a yellow light on it, it would appear black. The red surface only reflects that portion of the spectrum, and the light doesn't contain that. On a computer however, 'red' is defined as RGB 255,0,0 and a 'yellow' light would be RGB 255,255,0...so you would see a red objects. Exactly the same hue as you would get with a pure white light. In order to get similiar results you'd have to use a pure blue or pure green (in RGB values) light as any red value would cause the object to appear red.

    Why blue, probably because it's a complement to the red-green hues in most skin tones so you get appropriate looking specular highlights that won't oversaturate the base skin tone underneath.

    And for the record, most black body type light sources tend to shift toward blue on the kelvin scale the hotter/brighter they are. Sunlight sits around 6500k compared to 'pure' white light around 5000k. Our eyes and brain do a fantastic job of white balancing under various color temperatures.
  • Eric Chadwick
    That is a _really_ good point.
  • okkun
    Offline / Send Message
    okkun polycounter lvl 18
    I found Max works pretty well for previewing normal and specular intensity/color. I think the only thing that doesn't work is having a map for specular falloff/glossiness so you'll need to use some imagination for that or render.

    After Max 8 I think the texture download size for DX was improved so you can work with 2048's in the viewport while checking "DX display of standard material". (don't forget to up your normal bump to 100 from the default 30)

    Once you bring it into UE3 you'd want to mess around with other things you can't do in Max but I rarely have to go into the engine until my normals and specular are ready for a more advanced material.
  • J.I. Styles
    Offline / Send Message
    J.I. Styles polycounter lvl 18
    I agree with okkun on previewing in max, but I disagree with previewing in max if you're importing into ue3 -- ue3's specular and gloss ranges are completely different to what's possible in max. You can slide the intensity, but that's only a multiply value, there's still range differences to max from a 0 to 1 range. The saturation of specular is a big one too, and so is the specular hotspot "cone" (the bell curve that the intensity ramps to the peak of a 1.0 white). I'm a supporter of if you can preview in engine/editor while you texture, then definitely do so -- using the final shaders in a final lit environment will result in a faster and usually closer result to what you want since there's no translation task in-between.
  • okkun
    Offline / Send Message
    okkun polycounter lvl 18
    Yeah I need to clarify that. I wouldn't suggest using max for absolute final tweaks/levels. I try to bake as many properties as possible so it helps having what is at least a good approximation of the final result while Im working.

    If I can import my textures into an engine once that's brilliant. If I make sure it looks good in Max first the likelyhood of that happening is much greater.
  • Sean McBride
    Offline / Send Message
    Sean McBride polycounter lvl 18
    I've found that max is extreamly slow when you've got a couple 2048 sections loaded up (diffuse, specular, and normal) so i tend to preview all of my stuff in UE3. As long as you check that "Defer compression" you're good to go. Dosn't take much longer to import into your package than loading it up into max.
  • fritz
    Offline / Send Message
    fritz polycounter lvl 18
    i don't understand color spec. whenever i try to load my color spec map in the color spec map slot in max maps...i get no spec whatsoever.
  • Eric Chadwick
    fritz, works for me.

    1. load diffuse, specular color maps.
    2. crank up the Specular Level spinner.
    3. turn on "DX Display of Standard Material"
    4. turn on "Show Map in Viewport"
    5. drill down into specular color bitmap, click its own "Show Map in Viewport" icon.

    For some reason I have to "remind" Max that there's a color spec map there, otherwise I just get white spec.

    hth
  • CMB
    Offline / Send Message
    CMB polycounter lvl 18
    Wheres is DX display button everyone is talking about?
  • Eric Chadwick
    Material has rollout called "DX something." Check the checkbox, then the Show Map In Viewport button (blue checkered box towards the top of the Material Editor) changes to a pink checkered box.
  • Mr Ray
    Offline / Send Message
    Mr Ray polycounter lvl 18
    Im having a few problems atm hopefully someone can point me in the right direction.
    I used poops tut as my base of resource (btw any1 backed up mops normalmap tut on cgchat?) The normal map produces wires and I havent got any overlapping uvs, plus i cant get the viewpoint to see the normal mapping. Any suggestions?
    th_nm.jpg
  • Ruz
    Offline / Send Message
    Ruz polycount lvl 666
    only proble with the dx shaders in max is that they hog a hell of a lot of memory. workflow is normally:
    oops made a mistake , try and undo then max crashes
  • fritz
    Offline / Send Message
    fritz polycounter lvl 18
    Eric Chadwick...still no color spec. my spec works fine in the spec slot. then i went and added some color to one area of my spec map for a test. slapped that sucker in the color spec....basically did everything you typed out(thanks by the way)and still no color spec. s'weird. diffuse and normal are still there...just no spec at all. hmmmmmm

    and Ruz...yes!!! i was wondering if it was just me. haha
  • fritz
    Offline / Send Message
    fritz polycounter lvl 18
    OK...what a minute. i got it to work but i don't know if this is right or not. i loaded the color spec in the spec slot then i copied it to the color spec. and now it works kind of. am i supposed to have both: spec and color spec slots loaded w/a spec map? because when i just throw a spec map in the color spec slot i get nuttin.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    yeah fritz, you need the map in the "Specular Color" and "Specular Level" slot in order for it to work right. Otherwise it's only affecting the colour of the specular, and not the power of it.
  • fritz
    Offline / Send Message
    fritz polycounter lvl 18
    HAHAHA!!!!! YAY!!!!!!...another stoopid question by fritz answered. thanks MoP and eric getting closer....getting closer.
  • fritz
    Offline / Send Message
    fritz polycounter lvl 18
    OK...here we go...gettin there for sure. liking what i'm seeing. a couple of things: first of all...why is there such a crazy desrepency(sp?) between spec in viewport and render...MY GOD MAN!!!!. and secondly, i come from a bit of an old school background...where you paint in shades of grey/white for spec. now, with the color...and i'm seeing some of it....but is it just one of those things that is supposed to be CRAZY subtle? i mean i've looked at rockstars color spec for his dominance guy...and there are almost no highlights on the face....just purple. i'm gettin so close...it's drivin' me mad. hahahahaha.

    **nevermind on the render part. ha.
  • Eric Chadwick
    Well, the color is also the power. The bitmap's colors multiply against the default white specular. The darker the color, the less specular you see. So if you put the same bitmap in both channels, your specular is going to be twice as dark.

    AFAIK specular power can be calibrated quite differently between apps/game engines. In Max's case it's a linear 0-100 range, so 0,0,0 is no specular and 255,255,255 is 100% specular. Other apps may use a different range where 127,127,127 is 100% specular, and >127 takes it to a higher range (HDR-style).
  • Joshua Stubbles
    Offline / Send Message
    Joshua Stubbles polycounter lvl 19
    MrRay - make sure you don't have an alpha channel of the wireframe in the normal map.
  • dejawolf
    Offline / Send Message
    dejawolf polycounter lvl 18
    http://www.onona3d.com/pdf/texturing.pdf
    a very good beginner tutorial on various shaders, surfaces, and such.
  • snap.crackle.pop
    Offline / Send Message
    snap.crackle.pop polycounter lvl 18
    [ QUOTE ]
    http://www.onona3d.com/pdf/texturing.pdf
    a very good beginner tutorial on various shaders, surfaces, and such.

    [/ QUOTE ]

    Great dejawolf, i seen this sometime ago and lost the link.

    Thanks
  • PrayingMantis
    This thread is really great.
    I was asking myself why did you use a bluish specular map for the skin, now I know it.
    I was looking at this picture, and I don't understand the map.
    The diffuse color seems to get no details and it seems to be the specular color who retains them.
    But I think it misses the Normal Map.
    Can you explain this map ?
    sumea_thumb.jpg
  • Eric Chadwick
    PrayingMantis, image isn't showing up (artist is probably using hotlink protection for his images.) Probably this page: http://shika.50webs.com/images/girl.html

    When normal and specular maps are being used, the dynamic lighting provides the details. He's using a normal map, just not showing it (subtext says so). If you bake high-frequency lighting info in the diffuse map, it tends to fight the dynamic lighting.

    However he did add some soft shadowing in his diffuse, this helps when you don't have dynamic lighting that can add self-shadowing to the model.
  • PrayingMantis
    Yes that's her, and for the hotlink, I have done a Thumbnail, sometimes it works sometimes not. I dunno why. If you only see a blue square click on it and it will work.
    What disturbed me, was the details on the leather part, the sword and the gold part on the specular map.
  • Eric Chadwick
    I think the best way for you to see what's going on is to borrow the textures, put them on some quickie geometry, and examine them with a game-style shader. I suspect that the sword would look better with better spec and diffuse choices, but it may look just fine as-is.

    In general, I think it helps to look at it this way... if it looks good when moving around in-game, then it doesn't matter how ugly or odd the textures look on their own. It only matters that the sword shines nicely at runtime.
  • PrayingMantis
    Hum ok that's a new prob, how can I preview it in Unreal Engine 3 ? Buying a game like gear of wars can provide me to custom and import some mesh like you can do it in previous unreal ?
    Or did I have to be in the industry ?
  • Eric Chadwick
    I hear http://www.roboblitz.com/ uses UE3 and comes with an editor. Or you could try one of the freebie apps here
    http://boards.polycount.net/showthread.php?t=45485
13
Sign In or Register to comment.