Just got back from seeing my folks, and I installed the game on their PC. It ran at 58 fps on a 2.6 ghz, 1gb ram and a gf 6200 128 ( non-turbocache ). It was interesting watching my dad fight with the controls. He's not into games much anymore, so it was instructive to see how someone not used to FPS games played with the control system.
While on the trip I had several good ideas, and found a better way to do fade-outs.
One thing we'd been thinking of doing for a while is having the scene sort of fade away at the edges. Essentially like ranged fog from the player's perspective, instead of the camera's. I began implementing this today, and so far, so good.
I take a round falloff texture and map it so that its center falls on the player location. Right now I'm doing the fade-out in a purely circular fashion, rather than a true 3d falloff. I may change this in the future, but so far, so good. I'm not using a straight 1-d^2 type falloff, but rather 1-d^7 or so, with clamping to 1.0, so that the fading only occurs at the very edge of the viewable area.
This first version of the effect fades to black only. It was interesting trying different fade out methods. The first I tried last Wednesday or Thursday was to fade out the lights themselves to black when the player was far from them. This was clearly not the right effect, due to the non-linear attenuation encoded in the light occlusion maps. It was obvious that the lights were brightening as the player neared.
Here is a shot that exaggerates the fading out, so that everything beyond 10 meters from the player fades to black.
This obviously didn't effect the ambient, so I added the circular falloff texture to the ambient pass. This did fade unlit things out properly, but not lit parts of the world.
Then I changed it so that I fade the diffuse texture out when setting up the deferred diffuse texture. This had the desired effect, and also equally fades out ambient and other lights, since all lighting in AG is eventually modulated by the diffuse/gloss texture.
Once fading the black works, the next step is to add an optional fade to color. This will be accomplished by re-rendering the relevant parts of the scene with the fade texture & the fog color.
Each level can fade out or not, and if so, has a fade scale, a fade texture, as well as a fade color. For outdoor levels, I expect this to most likely match the skybox horizon color, but perhaps a desert level would fade to a sandy brown.
Here are two more shots of the effect, with the fade distance changed to 25 meters, so just the edges of the screen fade out.
One side benefit of this glorified depth cueing is that it will allow the engine to more aggressively cull lights, shadows, decals, entities and particles not in view. I will make an AABB around the player of 2 * fade_distance in width and depth,
and use that for an additional culling step. No point drawing invisible things, right?
Tomorrow I will add fading out decals, particles, entities and liquids as well.