Home Technical Talk

Metal Specular Maps - Your Methods

polycounter lvl 18
Offline / Send Message
odium polycounter lvl 18
I've come to the conclusion that all my specualr maps pretty much look the same. I've tried a few different things but they always seem to look a bit naff.

What do you find works best as a specular map ATM for metals? Obviously metals are shiney but at the same time, dull.

ATM, I usually make it quite dark, with bright highlights for edges and and over all with a tint of blue.

What are your methods? (With examples hopefully!)

Replies

  • Rick Stirling
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    In a game engine or in a 3d package for rendering?


    In an engine you can use a double spec (works well on hair too). One highlight is tight, and the other spread out.
  • odium
    Offline / Send Message
    odium polycounter lvl 18
    In a game, Quake 4/Doom 3 style really. I'm more interested in applying the methods to metals and gettign a nice effect between the two. ATM I'm using:

    Diffuse:
    http://www.quake2evolved.com/odium/wall1_d.jpg

    Local:
    http://www.quake2evolved.com/odium/wall1_local.jpg

    Spec:
    http://www.quake2evolved.com/odium/wall1_s.jpg
  • EarthQuake
    Theres a couple things you want to do to get really nice metal. The biggest part is having a great cubemap, and then you'll want to have softer normals than you have now, so you get nice little beveled reflections on your edges instead of the fake overhard look. And then your edges in your spec map need to be softer too, you should have some nice soft edges covring most of the friction points or edges on the surface and then have another layer of sharper scratches and such on top of that too. Also being able to tweak the glossiness is nice, so really d3/q4 really sucks for a couple of these things.
  • killingpeople
    Offline / Send Message
    killingpeople polycounter lvl 18
    [ QUOTE ]
    In a game engine or in a 3d package for rendering?

    In an engine you can use a double spec (works well on hair too). One highlight is tight, and the other spread out.

    [/ QUOTE ]

    aw man! i thought i was being clever! tongue.gif
    there's a name for it and everything? fack, u guys r 2 good 4 me!

    seeing other game artists use a tight spec always bugged the shit out of me because it sacrificed surface detail for a shitty little spec. i usually made it a dull glossiness and let the spec map do most of the work. i wanted a dual-spec shader, but unfortunately due to a number of circumstances i could never get it.

    here's an old R&D pic to better explain the idea:
    specblend04.jpg

    so nice of an effect. i'd love to play with tech like it that displayed on a normal map! if anyone knows of an engine or max fx that supports it, i'd love to play with!

    -kp
  • adam
    Offline / Send Message
    adam polycounter lvl 19
    Blending spec, gloss, and an environment map mask (the latter can usually be tied to the spec map if you'd like, I try not to) will achieve nice metals.

    I usually go completley loose with the gloss mask and make it look some-what wavy - as if the specular pass was being refracted. From there I just tone the spec and environmentmap mask.
  • EarthQuake
    [ QUOTE ]
    [ QUOTE ]
    In a game engine or in a 3d package for rendering?

    In an engine you can use a double spec (works well on hair too). One highlight is tight, and the other spread out.

    [/ QUOTE ]

    aw man! i thought i was being clever! tongue.gif
    there's a name for it and everything? fack, u guys r 2 good 4 me!

    seeing other game artists use a tight spec always bugged the shit out of me because it sacrificed surface detail for a shitty little spec. i usually made it a dull glossiness and let the spec map do most of the work. i wanted a dual-spec shader, but unfortunately due to a number of circumstances i could never get it.

    here's an old R&D pic to better explain the idea:
    specblend04.jpg

    so nice of an effect. i'd love to play with tech like it that displayed on a normal map! if anyone knows of an engine or max fx that supports it, i'd love to play with!

    -kp

    [/ QUOTE ]

    Or just use HDR imaged based lighting! The lighting setup we use right now works basically like this: You get your main bright highlight from the sun, and then you get more ambient highlights from the rest of the sky. Its perfect for metal.
  • doc rob
    Offline / Send Message
    doc rob polycounter lvl 19
    EQ, in the bit above where you referenced having a great cubemap, were you talking about an environment map for reflections or an HDR map for image based lighting?

    This double-spec technique intrigues me. I would like to see more examples if anyone has them. I assume you guys are using the same spec map for both highlights and just blending between a broad and a tight highlight? Couldn't you fake this by using a different highlight falloff curve ?
  • Rick Stirling
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    You can have different colours in each spec map too, which is especially good for metals, and getting special metal effects.
  • Eric Chadwick
    I've seen HDR/cube lighting applied a few different ways. Usually you precompute the lighting from various positions in the level (HL2-style) then you store each as a cubemap or PRT or somesuch.

    Once you have your src, it can be applied either like reflection or like diffuse. If reflection, the shader constantly factors in your viewing angle, so the reflection moves across the surface as your viewing angle moves. Like specular.

    There is a shader technique I've seen for masking different mips of the same reflection src, so you could have smooth sharp-shiny metal and buffed blurry-shine metal per-pixel-masked on the same surface. Heard that's costly though, anyone using this? Or you could simply use two materials instead, one using a lower mip than the other. Wish I had pics here. We have support for this, but all the wrinkles haven't been ironed out yet.

    If applying it like diffuse, then the view angle is not factored in, so it works more like bounce lighting. Then you want to use a very soft blurry source. ATI's cubemap tool is great for this, if you're using cubemaps. PRT does an even better job, since it isn't really pixels.

    Multi-specular is pretty cool, does exactly what you see in killingpeople's image. We support it, works nice. Base material has everything (diffuse, emissive, bump, etc.) plus a wide specular power. Then you add another one on top, tighter power. Both speculars work well when subtle, since it's an add, blows out to white really fast. I'll try to rustle up some pics.
  • killingpeople
    Offline / Send Message
    killingpeople polycounter lvl 18
    so jealous! i want that!!
    looking forward to what those look like eric.

    here are some more of those tests i made:
    blendsruleyourface.jpg
    specblend06a.jpg
    specblend05.jpg
  • Rick Stirling
    Offline / Send Message
    Rick Stirling polycounter lvl 18
    Now add some texture noise to your wide spec.
  • killingpeople
  • Eric Chadwick
    Kind of blah there when the specs are the same color.

    Here's a quickie example.
    20070409_double-spec.jpg

    I tried to whip up a nice HDR cube for comparison, but no time. I agree with EQ, HDR cube gives an accurate specular since reflect and specular are both in the end emulating the same thing.

    A cube or PRT gives you all the scene colors, (yellow sun, blue sky) whereas each specular is a single color and only a radial gradient at that. HDR tosses intensity ramping into the mix, so you get more contrast, only the brightest reflect. Looks less chromey.

    Downside to cubes/PRT is they emulate always-distant semi-fixed lighting. Engine has to recreate them at intervals if lights move (comes at a cost). Specular works great for moving lights... like a character walking down a hall, or wielding a flamethrower, or both. poly128.gif
  • JordanW
    Offline / Send Message
    JordanW polycounter lvl 19
    KP What .fx shader do you usually use to test your work?
  • killingpeople
    Offline / Send Message
    killingpeople polycounter lvl 18
    tinman: i'm not using fx files here, these are renders using a 'blend' material. it's an extremely simple setup, using two different standard materials in each of the two slots, blending at 50%. i created the images just as prototype stuff to show to programmers.

    looks AWESOME eric. i want to play with that! i wonder, with a setup like that, is there any reason to have two different speculars? can't you achieve the same effect with one gradient? also, can you impliment the use of a color spec for one of the spec inputs or somewhere in the pipeline?
  • JordanW
    Offline / Send Message
    JordanW polycounter lvl 19
    I was asking in case there was a .fx shader that you had previously used to test stuff in real time because it shouldn't be too hard for myself or someone to add a 2nd specular component to it.
  • Eric Chadwick
    Yeah, not a big deal. We don't use fixed shaders, so I don't use FX.

    Specular isn't really a colorable gradient, you can't set different colors for the center vs. the rim of the highlight. You can control per-pixel how that highlight changes color, but not color that conforms to the shape of the highlight itself. Not sure if that makes sense. If someone makes a shader for you it'll become pretty obvious pretty quick I think.
  • killingpeople
    Offline / Send Message
    killingpeople polycounter lvl 18
    good to know! gah, unfortunately, what we're working on right now doesn't demand fancy shaders.
  • Eric Chadwick
    Oh didn't see your edit KP. Yeah, color specular map can be used in our setup, I just used a quickie noisemap. We don't have gloss maps yet though. For the future...
  • EarthQuake
    [ QUOTE ]
    EQ, in the bit above where you referenced having a great cubemap, were you talking about an environment map for reflections or an HDR map for image based lighting?


    [/ QUOTE ]

    HDR map for imaged based lighting is best, but a cubemap can help too.
  • EarthQuake
    ok here we go
    fuckinmetal.jpg

    [edit] Model is gay, balls are touching.
    gay.jpg
  • monkeyscience
    Offline / Send Message
    monkeyscience polycounter lvl 12
    cybork5.jpg

    I 1up earthquake's scratchy balls with my mighty science. Behold brushed metal!

    It uses my high dynamic range image based anisotropic lighting shader model renderer 2.05b. There is a tangent-space direction map (much like a normal map but pointing along the surface) on the model that determines the direction of the grooves or brush strokes on the surface. The shader uses the direction map to "stretch out" the diffuse and specular hilights perpendicular to the grooves/brush strokes.

    Here is a difference between phong and anisotropic lighting with a more extreme case on the right:

    phong-aniso.jpg

    It uses image based lighting so here it is in different environments:

    enviros.jpg

    There is also a blurred noise specular map on it to illustrate which way the brush strokes are oriented on the model. In the direction map I use all the brush strokes are horizontal, so the blurred noise just happens to match up. This is the texture:

    horizontalnoise.jpg

    And finally, because it's kind of hard to show off totally sweet metal in still shots, a video (compressed with xvid):

    http://www.reinot.com/8monkey/videos/aniso-cybork.avi
  • EarthQuake
    Finally after 17 years of hard research, engineers around the world will finally be able to realize the ultimate of ultimate goals in graphics programming, being able to bring brushed metal shaded 3d graphics to starving children in africa, all over the world. Just like jesus would have wanted.
  • Joao Sapiro
    Offline / Send Message
    Joao Sapiro sublime tool
    monkeys everywhere ! Stop the teasing to us mortals PLEES !

    That anisotropic business looks saweet , got to study that further ! P.s - EQ ahaha !
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    How are you generating the directional map? We had a shader with this functionality at Neversoft, but we couldn't figure out how to "comb" the surface, like for say, a horse, where the fur changes directions quite often in the pattern it grows. Any chance you can show the flat texture used to control the direction, and how you generate it?
  • EarthQuake
    We actually have a program that lets you paint on it to "comb" the surface, i'de show some examples but its all NDA stuff, sorry.
  • Eric Chadwick
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    [ QUOTE ]
    We actually have a program that lets you paint on it to "comb" the surface, i'de show some examples but its all NDA stuff, sorry.

    [/ QUOTE ]

    So do you have an example then where the direction does change direction? This one looks like it's just following the blurred black and white noise around a horizontal axis with no actual changes based on the surface direction itself.
  • CrazyButcher
    Offline / Send Message
    CrazyButcher polycounter lvl 20
    such a direction texture would likely look similar to a normal map, I think. as it would be like a rotation matrix for each pixel. as 2d rotation would be enough R/G could store sin/cos of the orientation and maybe use B as stretching factor..

    two years ago I did some stuff for university where I generated such per pixel rotation based on vertex normals. the directions were used for rotating "screening" patterns.

    (scroll way down)
    http://crazybutcher.cottages.polycount.com/index.html?/uni/npr/assign2.html

    painting such a rotation map by hand would definetely require a tool that gives you a "direction" brush, which then outputs things as RGB, similar to painting "normals" just that they would be normalized and have a Z of 0, ie vectors that lie in the tangentspace plane.
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    [ QUOTE ]
    such a direction texture would likely look similar to a normal map, I think. as it would be like a rotation matrix for each pixel. as 2d rotation would be enough R/G could store sin/cos of the orientation and maybe use B as stretching factor..

    two years ago I did some stuff for university where I generated such per pixel rotation based on vertex normals. the directions were used for rotating "screening" patterns.

    (scroll way down)
    http://crazybutcher.cottages.polycount.com/index.html?/uni/npr/assign2.html

    painting such a rotation map by hand would definetely require a tool that gives you a "direction" brush, which then outputs things as RGB, similar to painting "normals" just that they would be normalized and have a Z of 0, ie vectors that lie in the tangentspace plane.

    [/ QUOTE ]


    Hmm, now that you mention it, there is a way to comb normals built into max (edit normal modifier) I wonder if there is any way to bake that out into a map in a stored RGB format.
  • monkeyscience
    Offline / Send Message
    monkeyscience polycounter lvl 12
    You're right, it is just a horizontal map, I was too lazy to comb it in Groom. The map just stores a vector actually, the grooves are infinitely long. When scaled and biased, it ends up looking like this:

    aniso-example.jpg
  • poopinmymouth
    Offline / Send Message
    poopinmymouth polycounter lvl 19
    [ QUOTE ]
    You're right, it is just a horizontal map, I was too lazy to comb it in Groom. The map just stores a vector actually, the grooves are infinitely long. When scaled and biased, it ends up looking like this:


    [/ QUOTE ]

    Awesome, I appreciate the show/tell.
  • Eric Chadwick
    Ben you could probably use the Edit Normals mod, then use RTT to bake a normalmap. But Autodesk didn't really do a great job providing options in that modifier, like there's no soft-select. I think it'd be horrendous to have to rotate all those normals one by one.

    Hey CB that's pretty cool, I like the hatching on the globe.
Sign In or Register to comment.