Why define specific colors for specular?

Started by
5 comments, last by howie_007 12 years, 3 months ago
Since the specular is the result of a light on a surface, why define a unique specular color different then the light?

I can't think of situation where I would want the specular color different then the light color.

The examples I find of specular light define specular color as well. Is there a reason for this?
Advertisement
The basic answer is because that's the way real life objects work. A piece of clear glass with a white light shining on it can have a blue specular highlight depending on how exactly it was made and what kind of impurities are in it.
Since this all has to do with making games, I don't think a player would take out the time to examine the highlights and contemplate the surface impurities to decide if the specular color is correct.

I'm just trying to justify why I would want specular colors taking up my shader memory when I can just get away with using the color of the light.
If you don't want them, don't use them in your game. If you're going for something flat and cartoony then it probably won't matter. If you're going for a realistic look, then ignoring specular color can be a step towards uncanny valley.
If you need to find a reason in order to justify implementing colored specular lighting, then you don't need it.
If you work together with an artist and he/she refuses to work without it, you know you'll need it! :)

As you say, lots of games don't need and won't use it. It's down to the artist and style in a nutshell

EDIT: Too late... :)
I tend not to think of "material colors" like Ambient, Diffuse, and Specular as light at all -- its more natural to think about them as how they *change* the light that is reflected from their surface (either diffusely or specularly).

Imagine that you have a red ball -- if its red under normal lighting conditions (which is to say "white") then it is so because the ball reflects only the red color spectrum. Now, if you were to shine a pure blue light on that same "red" ball, it would appear black, because the blue light provides no red spectrum for it to reflect.

Just as the separation of Ambient and Diffuse is really just a hack that lets us approximate global illumination because real global illumination is too costly, the separation of Diffuse and Specular is just a hack that lets us make up for the fact that its too costly for 3D models to have the sort of microscopic roughness that even very smooth objects have in the real world. So in that sense, what you're detecting is more or less true -- given infinite processing power, all these "hacks" that we employ would just fall out of a perfect, realistic lighting model. As it is, though, we have to rely on a combination of material properties, textures, and shader effects in order to get reasonably close with the resources that are available to us.

As a concrete example where specular color comes into play -- high-gloss (polished) objects such as glass or plastic reflect light in a mirror-like fashion; hence, they have a specular color that is typically on or very close to white (or grey/black, the brightness of the color determines how much reflectivity there is) -- other less-glossy (less/un-polished), reflective materials like metal have a specular color which is closer to their diffuse color -- its a reflection which "tints" the reflected light rather than being entirely mirror-like. Still other reflective effects can be simulated using the separate diffuse/specular and custom shaders, such as iridescence (many hard insects exhibit this in nature, or the color-shifting paint you sometimes see on cars).

throw table_exception("(? ???)? ? ???");

Thanks for everyone's input!

I see what everyone is saying. I'll add specular specific light values.

This topic is closed to new replies.

Advertisement