There's no doubt that using lumas in your engine is the good and correct thing to do, as it restores a lot of the old ambience from software Quake that was so badly missing in GL. However, most people get the rendering path for lumas wrong, and use something like (Texture * Light) + Luma. This means that in cases where the light is very low, the luma looks fine, but in cases where the light starts getting stronger, the luma will begin to intensify beyond what it should be.
One solution would be to hack the texture by subtracting the luma texels from it. This can be either done by the texture artist, or by the engine at load time. It's not ideal though: if you depend on the artist, you still have to deal with cases where it hasn't been done; whereas doing it in the engine just stinks of Bad and Wrong.
The QRP folks have used a different approach, producing Lumas that are very faint. Some are so faint that it hardly seems worth bothering to have them. However, for better or worse, that's now the standard.
What MHQuake does uses two different methods. Firstly, it converts the luma to greyscale by simply setting each of R/G/B to the brightest of the 3. This gets a good level of intensity that looks well with all lumas. The second thing is that it restores the correct equation to the rendering path. I'm running it as something like (Light + Luma) * Texture. This is a bit more fiddly to code for (as you can't easily skip over cases where there are no luma), but it looks correct and works very well with everything.
Saturday, January 26, 2008
Thoughts on Lumas
Posted by
mhquake
at
12:10 PM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment