[SHADER] Sonic The Fighters-style model lighting (v2)
Posted: Sat Apr 25, 2020 4:32 am
Can't download? Try this link instead: https://forum.zdoom.org/viewtopic.php?f ... 8#p1148678
Here's a Sonic The Fighters/Superhot style model lighting shader for Zandronum 3.0 (Which might work with map geometry, haven't tested). Thanks to Kevin over at learnopengles.com for his great help, without it I wouldn't have done this at all.
For usage, set up a brightmapped model as you normally would in GLDEFS and MODELDEFS, but set "map" to "shader/null.png" (included in the pk3 file)
NOTE: If your brightmaps have any alpha translucency, that section of the brightmap will be interpreted as "needs flat shading" (This also completely discards RGB info the brightmap set in that pixel!). Use only black and white brightmaps if you need normal Zandronum/GZDoom behavior.
I recommend keeping the shader itself as a separate addon, for compatibility with future Zandronum versions. Since this overrides func_brightmap.fp, and GZDoom itself has already completely switched to using a different method for brightmaps (They are internally treated as materials, and old shaders replacing it won't work correctly) it's to be expected Zandronum will too, so please avoid making this an absolute requirement so people will be able to run your mod with newer Zandronum versions.
Here's a Sonic The Fighters/Superhot style model lighting shader for Zandronum 3.0 (Which might work with map geometry, haven't tested). Thanks to Kevin over at learnopengles.com for his great help, without it I wouldn't have done this at all.
For usage, set up a brightmapped model as you normally would in GLDEFS and MODELDEFS, but set "map" to "shader/null.png" (included in the pk3 file)
NOTE: If your brightmaps have any alpha translucency, that section of the brightmap will be interpreted as "needs flat shading" (This also completely discards RGB info the brightmap set in that pixel!). Use only black and white brightmaps if you need normal Zandronum/GZDoom behavior.
I recommend keeping the shader itself as a separate addon, for compatibility with future Zandronum versions. Since this overrides func_brightmap.fp, and GZDoom itself has already completely switched to using a different method for brightmaps (They are internally treated as materials, and old shaders replacing it won't work correctly) it's to be expected Zandronum will too, so please avoid making this an absolute requirement so people will be able to run your mod with newer Zandronum versions.
Spoiler: Features (Open)
Spoiler: Customization (Open)
Spoiler: Known bugs (Open)Screenshot of how it looks (might look nicer with higher poly models, or some with better triangle distribution):