Question about texture lighting

Talk about the mods you'd like to see in Daggerfall Unity. Give mod creators some ideas!
Post Reply
CM August
Posts: 86
Joined: Fri Jul 14, 2017 11:11 am

Question about texture lighting

Post by CM August »

Interkarma, I don't suppose you know what the technical term is when the lightest pixels in an image are lit earlier than the darkest? As in, the image doesn't brighten or darken in a uniform fashion, but sort of pops in a pleasing manner, like messing with the Levels tool in Photoshop. Sorry that I have to describe it in this manner, but I've been completely unable to find the right term.

Maybe it was a trick of the low resolution or palette-driven rendering, but the lighting in Daggerfall Classic and other old DOS games had that appearance to me. Details appearing out the gloom had an almost "bump mapped" quality, one of the reasons I still enjoy that aesthetic to this day. Do you know whether or not that variable pixel contrast was actually a thing?

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Question about texture lighting

Post by Interkarma »

CM August wrote: Thu Jul 19, 2018 5:14 am Maybe it was a trick of the low resolution or palette-driven rendering, but the lighting in Daggerfall Classic and other old DOS games had that appearance to me. Details appearing out the gloom had an almost "bump mapped" quality, one of the reasons I still enjoy that aesthetic to this day. Do you know whether or not that variable pixel contrast was actually a thing?
I know the effect you're referring to, but don't have a good name for it either. :) It's an outcome of using palette changes to simulate things like lighting and fog. Because those old games could only index into a 256-colour palette, they had to change the palette or indices to make pixels brighter/darker/foggy. They were essentially "animating" the colours by loading new values into the VGA palette or translating the indices up/down through a scale. And because there's only so many colours to spare, it has the effect of making some pixels pop more than others as the palette is adjusted. It's a nice simple effect for software renderers to execute.

Daggerfall itself used a few colour translation files like HAZE.000/001 and SHADE.000/001. The UESP covers this briefly here and has a nice animation showing how the palette changes as the player approaches an object.

I briefly considered implementing HAZE and SHADE translations with 256-colour palette like classic does to generate that very Daggerfall-specific colour rotation on everything. But it was a technical challenge I wasn't ready to take on, and it would have limited the simplicity of being able to drop in texture replacements like we can now with full 32-bit textures (along with normal map, bump map, etc.) I would have basically needed to build two different rendering paths, one for perfect classic emulation and one for high-res texture mods. It was just too much on top of everything else and I settled on the most flexible lighting approach while still using the 256-colour palettes to generate classic assets at runtime. It was a sensible middle ground, but agree it loses some of that old charm.

But I reckon a shader wizard could build a post-proc shader that restores some of that charm, especially if they can use the classic colour translations somehow for the most genuine look.

CM August
Posts: 86
Joined: Fri Jul 14, 2017 11:11 am

Re: Question about texture lighting

Post by CM August »

Amazing what limitations can do for a game's charm. Thank you very much for the detailed (and very interesting) explanation. :)

I agree with your middle-ground approach. Above all else, a finished game may attract many pairs of hands, and allow the best of both worlds.

Post Reply