dsda-doom
dsda-doom copied to clipboard
Indexed Lightmode (paletted software rendering emulation on the GPU)
This PR adds a new "indexed" lightmode which emulates Doom's software lighting using PLAYPAL and COLORMAP, using Jazz Mickle's technique pioneered in this article.
The intent is to make it look as close to the software renderer as possible, so folks who prefer that look (and/or get really picky about COLORMAP fades) can get it without sacrificing the huge performance gains from actually using the GPU. :P
There are a couple of minor to-dos still (precaching improvements, spectres), but nothing worth blocking the merge anymore. The main feature is done now, yay :D
Some outdated musings, for posterity:
At time of writing, the basics are in (new lightmode option, texture handling, and a first pass of the lighting shader), but there's quite a few bugfixes and housekeeping things to do (e.g. enabling mipmaps or filtering will break it to hell right now), and I also need to implement pain fades & weapon flashes. Still, this is the bulk of the work and the most "intrusive" part, so take a look and lemme know what you think.
I also need to merge #96 -- I'll get on that soonish :P
[EDIT] Leaving a to-do list for myself:
- [x] Merge master
- [x] DSDA Palette Cycling (hey ho this already works :D )
- [x] Pain/item fades via palette, not the GL method
- [x] Use colormap for Invuln/Light-amp
- [x] Software-style Gamma
- [x] Disable mipmapping & texture filtering while in Indexed mode (these don't mix, sorry y'all)
- [x] Disable detail textures (? -- is this even a real feature the engine does? never seen it in Doom ever).
- [x] Fix textured automap
- [x] Fix gun flash intensity (seems to be doubling up right now)
- [x] Sky support
- [x] UI support
- [ ] Spectres?
- [x] Fix oddball red texture translucency shenanigans in Bauhaus MAP01
- [x] Test high-res textures (tl;dr: this is a no go. skip all that business.)
- [x] Test BOOM colormap features (this might just work out of the box? fingers crossed)
- [x] Test translucency (presumably no TRANMAP support, that's outside of scope)
- [ ] Improve precaching (right now it only precaches the indexed textures XOR the normal ones)
- [ ] Precache colormap textures
Probably a few things I'm missing that will come up when folks give this a test in the wild. :P
Once completed, will it be possible to bring it to PrBoom-plus as well? This is an interesting feature that in my opinion would fit well in PrBoom-plus (if it doesn't require too much work).
Once completed, will it be possible to bring it to PrBoom-plus as well? This is an interesting feature that in my opinion would fit well in PrBoom-plus (if it doesn't require too much work).
prboom+ is in maintenance mode, and this is the active port. There's not much reason to backport big renderer changes.
Nearly a year later: got everything essential crossed off the to-do list IMO. Ready for merge evaluation; the rest can come as improvements later on down the line.
default cfg with videomode "OpenGl" gl_lightmode 2
dsda-doom.exe nuts.wad -geom 1280x720w
Thread 1 received signal SIGSEGV, Segmentation fault.
0x000000013f9ede72 in gld_LookupIndexedColor (index=0) at D:/tools/prg/msys64/home/entryway/dsda-doom/prboom2/src/gl_main.c:824
824 color.r = gtable[playpal[colormap[index] * 3 + 0]];
(gdb) bt
#0 0x000000013f9ede72 in gld_LookupIndexedColor (index=0)
at D:/tools/prg/msys64/home/entryway/dsda-doom/prboom2/src/gl_main.c:824
#1 0x000000013f9ee518 in gld_FillBlock (x=0, y=0, width=160, height=720,
col=0)
at D:/tools/prg/msys64/home/entryway/dsda-doom/prboom2/src/gl_main.c:937
#2 0x000000013f9c9b74 in WRAP_gld_FillRect (scrn=0, x=0, y=0, width=160,
height=720, colour=0 '\000')
at D:/tools/prg/msys64/home/entryway/dsda-doom/prboom2/src/v_video.c:847
#3 0x000000013f9cabb5 in V_FillBorder (lump=-1, color=0 '\000')
at D:/tools/prg/msys64/home/entryway/dsda-doom/prboom2/src/v_video.c:1317
#4 0x000000013f8f2a20 in D_PageDrawer ()
at D:/tools/prg/msys64/home/entryway/dsda-doom/prboom2/src/d_main.c:622
#5 0x000000013f8f220a in D_Display (frac=-1)
at D:/tools/prg/msys64/home/entryway/dsda-doom/prboom2/src/d_main.c:368
...
(gdb) print colormap
$1 = (const lighttable_t *) 0x0
(gdb)
I didn't have any luck reproducing the crash, but I pushed up a possible fix for it -- fingers crossed.
no crash, thanks
The automap background doesn't always refresh for me. Here is a patch that does fix it but idk what the side effects might be, only that it fixes the issue https://github.com/kraflab/dsda-doom/commit/ff31bcc122c235071c079a271fea95cff5b2edb9
Woo! 🥳