Just playing with some ways to make things work a little more naturally in the reflections+specular department.
In this case, a model that's mostly occluded in a fairly simple fashion. And is, from what I remember, textured in a way that would make doing this via a control map a pain in the butt, not to mention less accurate, since the reflection depends on where the camera is too.
Left-new, right-old.
In the first pic you mostly notice it on the inner part of the wheel which is much less blue due to not reflecting the sky, in the second pic it's mostly the sides of spokes which are also reflecting blue.
The shader is based on a simple principle - the wheel has one outward-facing direction, from which all valid reflections + specular hilights (which are just soft reflections) appear - basically the halfspace outward from the side of the car. If a part of the wheel model is at an angle to this direction, then, quite frequently, it'll be reflecting something 'through' the wheel or the car - so it should prefer not to do any reflecting at all.
The shader can't deduce, on its own, which way is 'outward' - so I passed in, through the emission variable, a normal vector for the object. The vertex shader compares this with the current polygon's normals, and if it's reflecting 'behind' the plane then it scales reflections and specular down to 0. This means there's no extra texture reference but each different direction needs its own shader (left + right wheels are separate)
This is pretty much the equivalent of rendering a reflection map that's black on the half 'behind' the wheel, and normal on the other side. Due to the way it's calculated, it also ramps down to duller reflections at steeper angles instead of having a sharp cutoff.
With the way the two half-spaces of the model and the current poly intersect, it might also be appropriate to scale ambient light based on this factor - but I think baked AO is a more familiar way to handle that issue. Direct diffuse light, of course, has the shadow map to cull it from inappropriate surfaces.
With reflections turned up to 1.0 it looks like this. (new left, again)
In this case, a model that's mostly occluded in a fairly simple fashion. And is, from what I remember, textured in a way that would make doing this via a control map a pain in the butt, not to mention less accurate, since the reflection depends on where the camera is too.
Left-new, right-old.
In the first pic you mostly notice it on the inner part of the wheel which is much less blue due to not reflecting the sky, in the second pic it's mostly the sides of spokes which are also reflecting blue.
The shader is based on a simple principle - the wheel has one outward-facing direction, from which all valid reflections + specular hilights (which are just soft reflections) appear - basically the halfspace outward from the side of the car. If a part of the wheel model is at an angle to this direction, then, quite frequently, it'll be reflecting something 'through' the wheel or the car - so it should prefer not to do any reflecting at all.
The shader can't deduce, on its own, which way is 'outward' - so I passed in, through the emission variable, a normal vector for the object. The vertex shader compares this with the current polygon's normals, and if it's reflecting 'behind' the plane then it scales reflections and specular down to 0. This means there's no extra texture reference but each different direction needs its own shader (left + right wheels are separate)
This is pretty much the equivalent of rendering a reflection map that's black on the half 'behind' the wheel, and normal on the other side. Due to the way it's calculated, it also ramps down to duller reflections at steeper angles instead of having a sharp cutoff.
With the way the two half-spaces of the model and the current poly intersect, it might also be appropriate to scale ambient light based on this factor - but I think baked AO is a more familiar way to handle that issue. Direct diffuse light, of course, has the shadow map to cull it from inappropriate surfaces.
With reflections turned up to 1.0 it looks like this. (new left, again)