VOGONS


First post, by nulcow

User metadata
Rank Newbie
Rank
Newbie

In games like Quake and Half-Life, you can run them in software mode and all of the textures will be blocky and unfiltered. A strange thing I've noticed, however, is that lightmap textures appear smooth just like in GL mode. Why are lightmaps smooth but not anything else in software rendering?

Reply 1 of 3, by The Serpent Rider

User metadata
Rank l33t++
Rank
l33t++

Lightmaps are not filtered, but they are alpha blended over normal textures, so it creates the illusion of filtering.

I must be some kind of standard: the anonymous gangbanger of the 21st century.

Reply 2 of 3, by nulcow

User metadata
Rank Newbie
Rank
Newbie

> Lightmaps are not filtered, but they are alpha blended over normal textures, so it creates the illusion of filtering.

Oh okay. That makes sense.

Reply 3 of 3, by leileilol

User metadata
Rank l33t++
Rank
l33t++
The Serpent Rider wrote on 2023-12-09, 20:26:

Lightmaps are not filtered, but they are alpha blended over normal textures, so it creates the illusion of filtering.

No they weren't unfiltered alpha'd (that'd be ugly and Rage-like). They ARE filtered but at a specific aligned level with the texels. In Quake, there's 16 texels to filter a luxel over and there's specific functions to do that for 16 texels, 8 texels, etc. for the mipmaps to build in a surfacecache scratchboard (a large texture to take in rendering for the brush spans), and it resembles a smooth bilinear. They're blended with the shading table in the colormap lump (which definitely isn't an alpha mix, as it is composed of 64 rows of 256 colors multiplied down to black and multiplied up to an overbright) while having stepping delta loops across the 16x16. The other big non-id game that did this technique is Thief.

Half-Life does the same thing but with three luxels and using strictly 16-bit RGB lookup tables. Similarly, the decals are also aligned with the texels on a surface cache.

(see chapter 68 of Michael Abrash's Graphics Programming Black Book for more details)

As for other textures, bilinear filtering textures in 8-bit color is very impractical and expensive. It's no way like taking a lightmap and using a shading table. It'll also have issues with bleeding the seams in a surfacecache. You'd need good CPU extensions to handle it by that point, like SSE2 (MMX sucks, sorry intel marketing). Some games took an alternative and scattered the pixels across drawing the texels (Jane's F-15, F22 Raptor) or had a quick rough 2x2 split (Unreal)

apsosig.png
long live PCem