frag.machine wrote:but what if the engine just store the pallete with the texture and switch palletes during rendering ?
Bad idea: You would need a generated loopup table for
every unique texture palette each, regardless of pixel depth.
But anyway, going this over:
- You really really need a 15-bit, 16-bit or 24-bit surfacecache to store these textures
- You also need a new DrawSpans to draw colors from this properly
- You may also need to tear your video code for supporting this new bit depth directly, otherwise you'll have to dither it at the span level
- Also you would need to tear up the sky drawing code and water rendering code to support your rgb textures
- Another function you have to go to is the SurfaceMip functions in r_surf.c, which are responsible for blending the lightmap together with the texture, writing into this surfacecache for DrawSpans to use. That would need upgrades for either supporting the textures, and to have more bytes for the new high/true color DrawSpans (even regarding dithered spans). and this isn't even considering scratching the surface that is colored lighting, but that should be implemented anyway for the sake of color concurrency
- Unrelatedish, but it could be possible to have a 32-bit surfacecache and just use the extra bits to denote fullbright colors instead of alpha (for upconverting Quake textures and parsing _glow textures) - to make use out of the 'alignment' waste. Maybe for translucent textures the bits could be shifted a little to have both glow and alpha data.
This gif here shows:
Frame 1 - 8bpp DrawSpans, 8bpp surface cache, standard mono 8bpp lighting, 8bpp textures converted to game palette on load
Frame 2 - 8bpp DrawSpans, 8bpp surface cache, 18bpp lighting, 8bpp textures converted to game palette on load
Frame 3 - 8bpp DrawSpans w/ 2x2 dither, 15bpp surface cache, 15bpp lighting, 15bpp textures converted from textures' palette
I don't mean to plug my engine (the feature was never completed -it didn't do water/skies), but I have dablled in this idea, and so has Spike at one point. Earlier FTEQW revisions should still have the software renderer with 16/32bit modes with paletted WAD3 texture support (which I learned a lot from BTW FYI)