|
created Why so blue?
on 07-17-2009 11:17 AM
Alright, so most people have seen or created specular maps that have prominent blue colors in them, for various effects, but it seems many do no actually understand why we do this.
I've had a few discussions with programmers about this from time to time, because they never seem to understand why we would want anything but grayscale, so i figured i would give a few examples here and try to open up some discussion about colored spec in general. Generally these discussions end in the programmer telling me something about gamma which i dont really understand.
Now the most common use most people will say, is use blue for specular in your character textures. What they really mean is use the inverse color of your diffuse for your specular. Why do we do this? Its simple, adding light on top of a tan/brownish color is going to give you nasty yellow highlights.
You can see clearly in this image what i mean:
Specular in most 3d engines is done additively, so we can sort of test this out in photoshop.
The top two images are blue(left) and gray(right) using the normal blend mode in PS.
The bottom two images are the same, but using additive. You see how the gray image actually turns yellow, while the blue is a much cleaner near-white result. Its worth noting that if your additive color(spec color)
is bright enough, your end result is always going to be white, but the gradient to that point may still be yellow, and if the case of skin, you want very minimal specular reflection generally, so you wont have a very high spec value.

You can see in this ref here(my fingers lololol) that the highlight is more of a clean white than anything else, if you colorpick it, its a slight pink, but a quick look gives you the distinct impression of "white" more so than a yellow or red or anything else. Even in areas where the highlight is quite faint, its still distinctly white.
So when the goal is to get nice clean white highlights, it helps to use the inverse color of your diffuse.
Another good example that pretty much follows the same exact theory and usage is lacquered wood, the shiny wood you would see on the stock of a rifle for instance, tends to be a clean white or even bluish highlight in some cases. One of my biggest pet peeves is seeing people use grey, or even worse a yellow/brown spec color for wood, it just looks *terrible*.
here are some examples of what i mean:
http://www.fortunecity.com/olympia/k.../b19stock1.jpg
Some other good uses for color in your specular are:
Bronze/Gold
Its good to have more of an orange/brown color in the diffuse, and a yellow/greenish color in the spec, to get this sort of effect:
Certain materials like christmas ornaments, or certain cloth(like satin) or types of plastic you may want to push the color of the diffuse into the spec to get an even more saturated highlight:

|
, Moderator,
8,633 Posts,
Join Date Oct 2004,
Location Iowa City, IA
|
Wow, thanks EQ - very handy reference thread. Looks like you need to use a higher rez image for your kitchen floor tho - shits blurry! :P
I learned something very much like this in HS physics which I use sometimes in spec maps... Basically invert the diffuse color to simulate how colored light is reflected off an object, thus canceling out 'wrong' colors.. Is this a good rule of thumb for in engine textures, or is this mostly a 3d animation trick? Just wondering because I also only really ever have seen blue on spec maps in my limited experience.
-N!
|
, triangle,
467 Posts,
Join Date Jul 2008,
Location Huntsville Alabama
|
Well the general rule here, is that if you want a less saturated highlight, use the inverse color, and if you what a more saturated highlight, use the same color. How you actually apply that is very specific to what material you're trying to create.
|
, Moderator,
8,633 Posts,
Join Date Oct 2004,
Location Iowa City, IA
|
There may be something to your first diagram EQ. IRL specular hilights aren't exactly additive because if incident light hits the oily surface on the skin and bounces right off, it will not illuminate the yellowish, diffuse flab underneath. Really the equation becomes SPEC + (1-SPEC)*DIFFUSE. Adding some inverse diffuse color to the spec map probably approximates this.
Also the light source in the photo is not white, its blue, check out the "white" kitchen floor.
|
, line,
86 Posts,
Join Date Jan 2007,
Location Minneapolis, MN
|
The shot was taken with natural, overcast lighting, which is about as neutral as i think its going to get. And how dare you call my floor white, you racist. While i'm sure there is a little blue being added from the sky, i dont think its a very large amount.
Last edited by EarthQuake; 07-17-2009 at 12:32 PM..
|
, Moderator,
8,633 Posts,
Join Date Oct 2004,
Location Iowa City, IA
|
This is really informative. Thanks a lot EQ.
|
, polycounter,
1,048 Posts,
Join Date Jun 2008,
Location Kirkland, WA
|
Thanks!
|
|
ok white balanced on my camera to be as accurate to what the floor actually looks like(slight yellow/offwhite color) and a darker exposure to see the detail a bit more clearly. I think this still paints the same picture, spec = clean white. =)

|
, Moderator,
8,633 Posts,
Join Date Oct 2004,
Location Iowa City, IA
|
EQ, if your engine only allows greyscale specs in a alpha. But you can set the color of the spec via umm whats it called. Not CMYK, the 4 numeric system manually in the shader setup. Will this still help? As per since the spec color wont change, and if the texture is across multiple surface types.
I mean is there a neutral value? Or should I make a copy of the final texture with a average blur filter to see what the most prevalent color is and make the 4 digit the opposite of that?
Last edited by oXYnary; 07-17-2009 at 01:22 PM..
|
, veteran polycounter,
4,605 Posts,
Join Date Oct 2004,
Location Seattle, WA
|
this is great information i was often wondering why the blue .... however:
lets not forget than if you use a grey scale specular mask you can get away with just "1" channel !!! j
ust stash the spec mask into the alpha channel of your normal map or defuse map.
if 99% of the shaders in your game use specular masks than that is a HUGE amount of texture memory !
that slight color difference, that is going to get raped by all the bloom and color correction post filters anyway, might not matter that much compared to texture variety and resolution!
Last edited by warby; 07-17-2009 at 02:37 PM..
|
, polycounter,
837 Posts,
Join Date Dec 2004,
Location boston hamburg copenhagen
|
warby, actually in general if you put a specular mask into the alpha then you're not saving memory at all, in most common cases.
Since DXT1 (3 channels) is half the size of DXT5 (4 channels), so you might as well have two DXT1 textures instead of a single DXT5, it adds up to the same amount of texture memory at runtime and you get colour for "free" in your specular.
|
, MoP,
11,603 Posts,
Join Date Oct 2004,
Location London, UK
|
Quote:
Originally Posted by MoP
warby, actually in general if you put a specular mask into the alpha then you're not saving memory at all, in most common cases.
Since DXT1 (3 channels) is half the size of DXT5 (4 channels), so you might as well have two DXT1 textures instead of a single DXT5, it adds up to the same amount of texture memory at runtime and you get colour for "free" in your specular.
|
Absolutely.
Also i've been told that a single8 bit image cannot be compressed by the graphics card, so while your grayscale spec map is 1/2 the size of your rgb map, compressed that rgb map is 1/4th the size. Thus actually being MORE expensive to use grayscale spec on its own.
|
, Moderator,
8,633 Posts,
Join Date Oct 2004,
Location Iowa City, IA
|
Quote:
Originally Posted by oXYnary
EQ, if your engine only allows greyscale specs in a alpha. But you can set the color of the spec via umm whats it called. Not CMYK, the 4 numeric system manually in the shader setup. Will this still help? As per since the spec color wont change, and if the texture is across multiple surface types.
I mean is there a neutral value? Or should I make a copy of the final texture with a average blur filter to see what the most prevalent color is and make the 4 digit the opposite of that?
|
I'm not exactly sure what your asking here, seems you may be thinking a bit too hard about it? =D
If you HAVE to use grayscale, its good if your shader supports and RGB value to tint the entire image, you'll just have to tweak this until you get a good result, because you may be balancing flesh and non flesh in the same image.
|
, Moderator,
8,633 Posts,
Join Date Oct 2004,
Location Iowa City, IA
|
ok: If you want to play with fancy shader stuff you can have the value in one channel and the saturation in the other and calculate opposite colors automatically in the shader. This would work well in most cases as there's rarely much need to actually paint "color" (as opposed to the saturation value for the highlight) into spec maps.
EQ, how did you get people to respond positively to this message? Whenever I have brought this up the last 12-13 years people tend to go apeshit and talk about how spec color is related to the blue sky or some lameness, usually backing it up with photographic "evidence"
|
|
Quote:
|
Really the equation becomes SPEC + (1-SPEC)*DIFFUSE
|
This is not correct, though it sort of is in spirit. The actual relationship is more complicated, as it depends on the incident angle of the light source. You can have for example angles where the viewer sees no specular, but the surface is reflecting a lot of light specularly, the result being dark diffuse but no visible spec. tl;dr - this equation is wrong, don't use it.
Also fwiw I don't buy that the artists are just trying to emulate blue light by putting blue in the spec maps, I think they are actually on to something here, a flaw in gamma correction or the RGB color model or some other technical wankery.
Also mechadus: you learned this in physics class?? If you know a physical basis for the phenomenon, then do share it please!
|
, spline,
110 Posts,
Join Date Jul 2009,
Location Philadelphia
|
so I suppose that you would vary the spec colour a little ie slightly warmer colour for the lips.
I personally found that it hard to avoid it looking like you painted the model with inks if you have too much color in the spec.
it can look quite saturated I mean.
If you haven't got a good grasp of warm and cool colors it can be a bit tricky to get your head around
whilst testing I mainly use a grayscale spec.
The idea for a blue spec may have come from the color of jacks lips in titanic 
|
, veteran polycounter,
4,391 Posts,
Join Date Oct 2004,
Location Uk(London)
|
Great thread EarthQuake! Finally someone put all this specular color info into a concise post. I knew about the invert color for skin from a previous polycount thread but now it all makes sense, thank you very much 
|
, veteran polycounter,
2,520 Posts,
Join Date Feb 2009,
Location Hawaii
|
Quote:
Originally Posted by MoP
warby, actually in general if you put a specular mask into the alpha then you're not saving memory at all, in most common cases.
Since DXT1 (3 channels) is half the size of DXT5 (4 channels), so you might as well have two DXT1 textures instead of a single DXT5, it adds up to the same amount of texture memory at runtime and you get colour for "free" in your specular.
|
hmmmm now that IS interesting ...
the truth is i take the memory efficiency thing so far i usually just use a channel from the dxt1 - diffuse texture do some contrast adjustments in the material/shader and hook that into the specular mask.
because thats what most environment artists do anyway ... just taking the diffuse photo of a wall in photoshop and turning the contrast way up to make the spec mask and than call it a day ...
|
, polycounter,
837 Posts,
Join Date Dec 2004,
Location boston hamburg copenhagen
|
Very interesting thread guys, and yeah I often heard the "use blue cause of the sky" explanation, which always sounded kind of silly.
Sorry to go off topic a bit, but to come back to what warby and MoP are saying :
Why is DXT5 2x times larger than DXT1 if it only has an additional channel?
And I guess another advantage to just using grayscale specular, is even if you're using 2 DXT1 textures, you can use the 2 other channels of the specular texture for stuff like gloss and reflection maps (or even apha, to avoid using a DXT5 on the diffuse texture).
|
, polycounter,
1,011 Posts,
Join Date Jun 2006,
Location Paris / France
|
Quote:
|
why is dxt5 2x times larger?
|
http://en.wikipedia.org/wiki/S3_Texture_Compression
btw for normalmaps dxt1 is rather sucky quality, best quality is a swizzled dxt5. (and ofc 3dc)
Last edited by CrazyButcher; 07-19-2009 at 05:43 AM..
|
, dedicated polycounter,
1,346 Posts,
Join Date Nov 2004,
Location Germany
|
so you get something for your money with dxt 5 right ???
dxt5s usually look less altered than dxt1 textures !? ( haven't used one in ages)
|
, polycounter,
837 Posts,
Join Date Dec 2004,
Location boston hamburg copenhagen
|
Quote:
Originally Posted by warby
so you get something for your money with dxt 5 right ???
dxt5s usually look less altered than dxt1 textures !? ( haven't used one in ages)
|
Sorry to jump in on your discussion but I used quite a few of these in conjunction with nvidia's direct x toolkit, simPE and Sims 2 engine. Yes DXT1 was poorish quality, DXT3 was the ideal 24bit solution that saved the intended quality and DXT5 is 32 bit with an alpha channel which I was warned about not to use unless my texture had an alpha included because this format is double the memory of DXT3!
|
, dedicated polycounter,
1,473 Posts,
Join Date Apr 2008,
Location United Kingdom
|
dxt3 and dxt5 are same size. just look at the wiki link has the details. [if an admin can do, we might want to break the trheads into two, splitting away the compression stuff]
Last edited by CrazyButcher; 07-18-2009 at 05:30 AM..
|
, dedicated polycounter,
1,346 Posts,
Join Date Nov 2004,
Location Germany
|
That's strange, it was definately double the size after x conversion from tga inside the game editor as I extracted the textures to compare the dxt3 and dxt5 formats. This must be specific to the editor I was using, so if you use no alpha information in your dxt5 in some other editor the file size remains the same? Information noted 
|
, dedicated polycounter,
1,473 Posts,
Join Date Apr 2008,
Location United Kingdom
|
I remember talking to my bro about this cause I didn't see the point. He brought up using it as a hack to get the superficial sss effect, which made sense to me. So I can see on stuff like skin or other materials with noticeable translucency that it could be effective but not a huge difference.
But on everything else it seems like the additive effect is mimicing what you see on real world objects, and with the degree of specular control you can get w/ different maps, I'm not sure I see the returns in spending alot of time on color values. But whatever works for the indivdual artist.
I know one horrendous experience I had, the client wanted me to not only tint the spec in a certain way on every material, but also to hand paint complex spec maps with stagnant hilights and duplicate that map for falloff control. Tell me how that makes ANY sense.
using areas of grey for both strength and falloff looked great in the engine to me...
...
|
, triangle,
330 Posts,
Join Date Nov 2004,
Location seattle, WA
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Copyright 1998-2012 A. Risch
|