Jump to content
  • Advertisement
Sign in to follow this  
howie_007

Why define specific colors for specular?

This topic is 2544 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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... :)

Share this post


Link to post
Share on other sites
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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!