# Specular map: What about the specular reflection's highlight' size?

I think I know what a specular map is and what it's used for (here is an example).

http://www.rastertek.com/dx10tut21.html

One of the models of specularity that are highly popular is Phong. In Phong there is a parameter sometimes called "shininess" which basically controls the size of the highlight. A large value yields a tiny highlight.

How is that value expressed in the specular map? It appears to me it is common to use the specular map to control the brightness but not the size of the specular highlight in games.

Am I wrong in thinking so? Mind you I'm not adept in game rendering and well aware that the naive implementation of Phong (with ray-tracing) raises the dot product of the vector from the camera source with the reflected vector of the light beam by the power of shininess which appears computationally heavy but still I wonder:

Are specular maps by definition without Phong's shininess value? Is that rarely or never used at all in interactive rendering? Is the value simply set to a small constant?

## 1 Answer

Many games nowadays use both specular maps, which control the intensity of the specular reflection, and shininess maps, which control the size of the highlight. With Phong or Blinn-Phong shading, an increasingly common way to do this is to use an exponential mapping:

specularPower = pow(2.0, 13.0 * shininessMap)


Often times this is called a "gloss map", and the value stored in the map is called "gloss". This enables the texture map to have a range from 0 to 1 just like most other textures, so standard authoring tools and formats can be used. But after applying the pow() function, the range of specular powers is 1 to 8192 in the function above (of course, different constants can be used to get a wider or narrower range). So you can get a useful range of specular powers from a standard texture map.

(By the way, raising a value to a high specular power as in Phong and Blinn-Phong shading isn't necessarily computationally heavy; it can be done using exp and log functions so that it takes a constant number of operations no matter how large the power is.)

In the past, people often went without a shininess/gloss map and simply set a constant shininess per material, reasoning (I suppose) that the intensity part was more important. However, nowadays people are realizing that this is actually the wrong way around - most of the interesting detail in the specularity of a surface is due to variations in gloss, not variations in intensity. It turns out that realistically, almost all materials except metals have a specular intensity value of somewhere between 0.02 and 0.05 (in linear color space). Metals have higher intensity, between 0.5 and 1.0, depending on the type of metal.

The key point is that the intensity just depends on what the material is made of, but the gloss depends on the actual surface texture - whether it's smooth or rough, does it have scratches or other defects, and so on. So the gloss is arguably the more important quantity to have, and you can often get away with setting the intensity to a constant.