Game Development Community

Specular Suggestion

by Jacob Dankovchik · in Torque Game Engine Advanced · 03/01/2005 (6:51 pm) · 2 replies

I had some thoughts about this and decided to post it. Unfortunatly i don't think i have what to takes to do this. However perhaps someone else out there who agrees with what i say here may give it a shot ;)

What i was thinking was instead of making specular lighting use the alpha channel of a texture, have a totally seperate specular map image. You can then remove the specularColor parameter and the color of the specular lighting would be determined by the color in the RGB channel of the specular map. You can use the alpha map of that to determine its strength and keep the specularPower parameter.

One good outcome of this i learned yesterday when i was playing with cubemaps. The cubemap strength is determined by the alpha chennel of the image, as well as the strength of the specular lighting. My problem was that i wanted the cubemap to show through less but for the strength of the specular light to remain strong. So, i ran into a problem here that would be easily corrected by what i purposed.
Another advantage is you don't need seperate materials just for different specular colors. I've had this problem with my models and it can be a bit of an annoyance. For example, on one of my monsters i wanted the specular light on his skin to be a certain color and for his eyes to be a different one. With my suggestion i made this would be no problem whatsoever. However with the current alpha chennel setup, i had to make seperate materials for the eyes which has added up to a suprising amount of small hassles because its one extra assigned material i'd rather not have.

The only drawback some may not like about this is the need for an extra image bundled with everything. Although what could also be done, i imagine without much difficulty, is to have an option on either to use the alpha channel or a seperate image. That way the user would have the option.

Although unfortunatly as i said, i don't think i have what it takes for coding to do this. Perhaps someone else out there does though. Im just laying out an idea i think would be quite handy, if anyone wants to try to take it up, please say so! :)

#1
03/02/2005 (11:44 am)
That's not a bad idea Jacob. I've got on my list a way for setting up which alpha channels to use for cube and specular reflections. Ie. you can specify that the base texture's alpha channel is used to mask cubes, and the bumpmap's alpha channel is used to mask specular.

You are talking about taking it further with a completely separate gloss map. I was hesitant to do that because it's much less efficient than passing a specular color in and using another texture's alpha channel. You make an interesting case about using it to assign different specular colors though.

In most cases the specular color should be consistant across materials though, because it comes from the light color, not the material. On the other hand, having dramatic license to change this could be nice.
#2
03/02/2005 (12:18 pm)
Heh, well hope my suggestion perhaps helps to persuade a bit towards it. Like you said, in most cases the color would remain constant but there are always the exceptions and this would make it much easier. ;)