Page 1 of 1

8bit - Dither/Shaded Palette

Posted: Mon Feb 07, 2022 1:31 am
by Rachael
Using a trick discovered by DenisBelmondo to downmix a table LUT to the currently loaded game palette - I did my own take on palette dithering - plus I also did a "shaded" (or "blended") palette mode which preserves the original brightness of every pixel in the image but transitions it to 8-bit colors.

This comes in 5 modes which is accessible in the Display Options menu on both GZDoom and Raze. (The 5th being simply "off")

Note that this requires a devbuild of either GZDoom or Raze in order to function properly.

"Classic" - which is basically the palette tonemap:
Spoiler:
"Checkerboard" - error diffusion dither to a single level:
Spoiler:
"Square" - 2x2 error diffusion dither to 3 levels:
Spoiler:
"Shaded" - The image is downmixed to a palette but it is blended and the brightness is readjusted according to the original pixel (it gives a very "advanced retro" feel):
Spoiler:
Github: https://github.com/madame-rachelle/8bit

License: 3-clause BSD for the code, CC-BY for the image (allows derivative works, only attribution required)
8bit.pk3
Spoiler: Old versions

Re: 8bit - Dither/Shaded Palette

Posted: Mon Feb 07, 2022 6:42 pm
by Rachael
New version - added EGA palette options.
Screenshot_Doom_20220207_192643.png
To emulate EGA resolutions:
vid_setscale 320 200 0 1.2 - 320x200
vid_setscale 640 200 0 2.4 - 640x200
vid_setscale 640 350 1 1.3714 - 640x350
vid_setscale 640 480 1 1 - 640x480 (VGA)

Re: 8bit - Dither/Shaded Palette

Posted: Tue Feb 08, 2022 3:38 am
by Nash
Man, I'm spoiled for choice with all of these retro shaders. :mrgreen:

Thank you for putting this out, Rachael!

Re: 8bit - Dither/Shaded Palette

Posted: Tue Feb 08, 2022 5:19 am
by Rachael
Thank you for the kind comment, Nash :)

Re: 8bit - Dither/Shaded Palette

Posted: Tue Feb 08, 2022 11:15 am
by axredneck
This needs to be integrated into GZDoom/Raze

Re: 8bit - Dither/Shaded Palette

Posted: Wed Feb 09, 2022 12:17 am
by Rachael
Updated - added two new 16-color options, added tweaking options for the error diffusion dither. Can increase the square size (and diffusion level), as well as change the diffusion bias.

Re: 8bit - Dither/Shaded Palette

Posted: Thu Feb 17, 2022 5:50 pm
by axredneck

Code: Select all

Script error, /home/redneck/games/doom/8bit/:gldefs.txt line 40: Unknown keyword 'cvar_uniform'
It's GZDoom from today's git master.

Re: 8bit - Dither/Shaded Palette

Posted: Fri Feb 18, 2022 6:17 am
by Rachael
Works fine for me. Where'd you get that copy of GZDoom?

I freshly compiled mine from the master branch and it accepts this shader without errors.

Here is mine, for whatever it might be worth. https://cdn.discordapp.com/attachments/ ... -02-17.zip

You'll have to pull the .dll's from GZDoom 4.7.1 for this to work. Or just overwrite an existing copy; that works too.

Re: 8bit - Dither/Shaded Palette

Posted: Fri Feb 18, 2022 12:04 pm
by axredneck
Rachael wrote:I freshly compiled mine from the master branch...
So did i.
You'll have to pull the .dll's...
I'm on Linux.
it accepts this shader without errors
It's not shader but gldefs that gives error.

Re: 8bit - Dither/Shaded Palette

Posted: Fri Feb 18, 2022 12:27 pm
by axredneck
Tried pk3 instead of your github repo - it gives this (almost the same) error:

Code: Select all

Script error, 8bit.pk3:gldefs.txt line 40:
Unknown keyword 'cvar_uniform
So it's not something i did wrong with your repo.

Re: 8bit - Dither/Shaded Palette

Posted: Fri Feb 18, 2022 4:02 pm
by Rachael
I don't think you're on master then. Check with git describe --tags and git branch.

As of this post, git describe --tags should return the following output:

Code: Select all

g4.8pre-229-gc926b7533

Re: 8bit - Dither/Shaded Palette

Posted: Fri Feb 18, 2022 6:33 pm
by axredneck

Code: Select all

> git fetch --tags
g4.7.1
Yes, my bad. I thought i'm on master for some reason...
I switched to master - now everything works. Thank You! Great mod!

Re: 8bit - Dither/Shaded Palette

Posted: Fri Feb 18, 2022 6:38 pm
by axredneck
Oh, i still have a problem: settings of this mod aren't saved between GZDoom sessions for some reason.

Re: 8bit - Dither/Shaded Palette

Posted: Fri Feb 18, 2022 9:27 pm
by Rachael
Yeah that unfortunately is something I am having a bit of trouble with right now, I hope to have that solved soon. It's because of the new shader uniform system.

Re: 8bit - Dither/Shaded Palette

Posted: Sat Feb 19, 2022 11:43 pm
by Randomguy7
I don't see a mod menu, but I see that there's an option pal_mode... what does 1 2 3 and 4 translate to? edit: nvm I found it lol