SPECULARS
OK, let's figure this out once and for all

I've changed the interface a bit to make it more obvious, but maybe I'm just completely mistaken about the effect I'm supposed to get here.
I swear I have these working right, here's an example:
These is a scene from the race map with 3 added cubes, with a specular texture added (that's too the right.) As the cube gets farther away from the light, it's less "shiny" in a linear fashion, really close to the light, and the shiny-i-ness is basically a white-out.
Yes, I realize a shiny tile texture is a bad example
Isn't this the correct effect? Are there better example speculars I should be testing with?
[>] Brian
ccccc - it looks like the flash effect settings are a bit screwy thanks to the unit=unit map change, these *might* need to be reset in the new version (sorry). I'll do some work on this.
They also need their own separate bone.
[>] Brian
I think that is right. Looks right to me.
Actually, is it based on how light hits it too and not just distance? For instance, if it was really far away but next to a bright light it might have a whited out spec, but if it was the same distance with a dimmer light near it it would have less of a bright spec. Also it would be nice if the specular reflected like a mirror but only with lights. Would that be possible? I am guessing this is very similar code to reflections, only it just applies to light and which parts/how bright a spec is. Let me draw something.
Nearby lights, angle of those lights, and distance from the lights A WELL AS distance from the player effects it. Makes it more dynamic seeming. if possible.
http://img128.imageshack.us/img128/1636/zspeczlu1.png
Yes, the angle makes a big difference as well, also, if the light is only like 20% or 40%, the shine should NOT be obvious, or there at all. It has to react to the light. A specular map is not supposed to make a part of the texture bright no matter the lighting, it has to react strongly TO the lighting. That was the problem with the current/older specular, it would make the texture bright, no matter how dark the light was, or how far away it was.
See the shine effect on the floor? Notice how the other lit areas are not ultra shiny, but only the area being so brightly lit? That's what it should, essentially, specular is how much a surface reflects light, plastic doesn't reflect light very much, and so it looks very dull, but metal reflects a lot, and so it looks shiny, usually.
Alexander Smith Wrote:Yes, the angle makes a big difference as well, also, if the light is only like 20% or 40%, the shine should NOT be obvious, or there at all. It has to react to the light. A specular map is not supposed to make a part of the texture bright no matter the lighting, it has to react strongly TO the lighting. That was the problem with the current/older specular, it would make the texture bright, no matter how dark the light was, or how far away it was.
That's what it does -- it's linear to the light. If the light is directly on it, it's ultra bright, if the light is just a little, you can't see it at all. If the light is at:
100% - shine is 100%
90% - shine is 81%
80% - shine is 64%
etc ... There were two shine modes, one was ancient and I fixed that. Next copy, we'll see how well this goes and go from there. I want to get this specular thing fixed once and for all
[>] Brian
Well, personally what I want is this:
ggadwa Wrote:Isn't this the correct effect? Are there better example speculars I should be testing with?
[>] Brian
I think the problem here is the direction of the lights and camera. I think the specular needs a option to change the refection angle in relation to the camera.
Best way to describe this is to imagine walking towards a lake on a sunny day. You only get the white out effect when the light if being reflected (and refracted) off the water, which only happens at a certain angle. So as you walk towards the lake the parts of the water that are reflecting light will change.
The specular map is similar to a bumpmap as it simulates the 3d displacement with a 2d image - whilst also emulating the materials of the object.
Its probably going to take some fiddling and adding some more variables to the specular-mapped material. Metal for example diffuses the light differently to Plastic.
I might be wrong, but it seems to me that it should depend on two things: The angle of the light to the sement, and the distance of the light.
![[Image: examplekf2.png]](http://img299.imageshack.us/img299/2701/examplekf2.png)
Lets say the dot is a light, and the thick line a wall. The center of the wall will be very specular as it is close to the light and exactly 90 degrees from it, but the outside should not be very specular at all, even though it is just about as close because the light is at an angle.
I don't think that camera angle usually effects specular in games, but that would be a usefull feature if it wasn't to slow.
I could be completely wrong though.