For those of you that don't know, DarkXL is a sort of remake of Dark Forces but in the spirit of a port. I guess a recreation is a little more accurate. Unlike Doom, Duke Nukem 3D, Quake I - III, and other popular FPS's - the source code for Dark Forces was never released. However before I started the project I found an old community - df-21.net - that centered around Dark Forces. I really enjoyed Dark Forces back in the day and I think it deserves to be preserved just like Doom and Duke Nukem 3D. So I started building this project from scratch. At the time I was entertaining the idea of doing something similar for Daggerfall but for various reasons decided on Dark Forces instead (in the short term).
Anyway, DarkXL requires the original data files to run and attempts to faithfully emulate the game play, sound, music, game flow, etc. of the original game. Ultimately it will fully support all the user levels and mods that people have made over the years. But it is a windows app, uses hardware acceleration and supports new features to enhance the original experience - including higher resolutions and color depths, texture filtering, improved control and mouse look, and various optional "extended features."
I will talk about one of those extended features today and how I attempted to make it enhance the original look in a way that is consistent with the original game's intent. That is the "glow" effect.
The original game had special colors in the palette that were treated as full bright, so you can get bright lights in dark areas. Looking at the movies and later games you'll see a nice soft glow (when done well) around really bright light sources, such as blaster shots, wall lights, engine glow on ships, etc. Some older (pre-HDR) games used a simple intensity thresholding to determine which parts of the scene glow. As you can imagine this would have been really simple to implement without changing the pipeline: copy the backbuffer and downsample, apply your threshold value (so pixels below the threshold are black), blur the result, add it on top. But I wanted to capture the intent of the original artists, so if you ask "which pixels should glow?" the answer becomes really obvious - the full bright pixels of course.
Since the alpha value is already used, I had to generate a "glow mask" in order to know which pixels are emissive and how much (to support true color textures and multiple levels of transparency and emissiveness for DarkXL mods). So I setup 2 MRTs, one for the main render and one with 4 "effect channels". The first channel (the only one right now) is used for the glow mask. So as the geometry is being rendered, it writes out the emissiveness to the glow mask. This allows it to be generated without rendering the geometry again and opens up the possibility of having other post process effects later using the other channels.
Here is some screenshots with the glow, which I hope shows how the glow enhances the original intent rather the drastically changing the look and feel. I've shown some of these screenshots before in the image of the day.
before (with older light settings, another extended feature)
Other screenshots of the glow effect.