That's pretty much what we do. As mentioned before, we use a few sphere primitives on the objects to define the regions. The center of the sphere is attached to the object by the same bone structure, so it'll move with animation and all, while the radius is basically defining the "softening" range. From the point of view of the shaders, we're really only concerned with the closest sphere.
Neat, thanks.
So I wasn't just talking out of my ass.. lol.
ShootMyMonkey said:
BTW, in our case, we use it only to darken the ambient/indirect lighting component, not diffuse/spec. It becomes really important when you have characters walking around in areas which are already in shadow, and so the character has no visible shadow inside the larger shadow. When you darken diffuse/spec with it, it looks really awkward.
I know what you mean about the shadow thing.. so many developers don't bother with that, so you get that odd shadow-in-a-shadow effect. Lately I've actually been quietly applauding developers that get it right. Most casual gamers probably don't care, but I'm a bit of a graphics whore.. hehe.
About the occlusion thing, though, given that there's likely still some ambient lighting even in a shadow, it would still darken slightly when an object is right up against something, as it's blocking even the dim ambient lighting. Or is that what you meant by adjusting the ambient lighting component? The result would probably be the same, I would imagine.. whichever is easiest to make the surface darker.
Bear in mind that when I speak of diffuse/spec, I'm looking at it from the point of view of texturing one of my CG models, and the basic way of making an surface "darker" by reducing it's diffuse value (although the practical application is of course more complex, regarding how the surface reacts to different levels of light, etc). I only brought up specularity because of the possibility of still having a specular highlight when the light source that's casting it should be blocked by the object. Although now that I think about it, I haven't really seen that happen in a game. Then again, I haven't really been looking for it, so if it's there it's never enough to draw my eye, and devs haven't been using complex specular shading very long. In CG, we generally don't worry about render time.. so while the principle may be the same as I'm used to, the implimentation is very different.
Going back to the radiosity thing, how is that usually implimented? In CG, if we need to maintain that level of lighting (i.e. drawn from a HDR backdrop image), but we need to cut down unrealistic render times, there are some automated methods that can extract a lighting rig from a HDR image. So we cut down render times by using an array of practical lights rather than full-bore radiosity. I remember thinking a while back that games could do something similar by sampling the environment around the object in question and generating a light array around it to simulate the effect of HDR illumination and reflected light. Of course, working that into an existing lighting scenario would likely be a huge pain in the ass.
Reminds me of another train of thought I had a while back, somewhat off-topic, regarding reflections. For example, cars in Gran Turismo reflect their environment, but not the other cars. I've always known the "why"... in LW, I just turn on raytracing. Great results, noticable increase in render time, so obviously not a feasible solution for a real-time engine. Originally, I had thought that the system was generating low-res environmental reflection maps on-the-fly, but that probably wasn't feasible on older hardware. One of the videos on GT5 appears to show a very low-res mesh for the background.. I'm assuming that this mesh is invisible to the gamer, but is simply there to be reflected by the car (bear in mind that I've only recently become aware that there are often plenty of objects in a game environment that aren't rendered, for collisions, etc). But I still wonder whether it would be possible to generate a full reflection map on-the-fly, that would include everything around the car? Sort of a low-res fisheye/chrome-ball image based on the position of the object, that's then applied as an environmental reflection map. I'm sure I'm not the first to think of stuff like this.