8bit - Dither/Shaded Palette

8bit - Dither/Shaded Palette

Postby Rachael » Mon Feb 07, 2022 1:31 am

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
You do not have the required permissions to view the files attached to this post.
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: 8bit - Dither/Shaded Palette

Postby Rachael » Mon Feb 07, 2022 6:42 pm

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)
You do not have the required permissions to view the files attached to this post.
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: 8bit - Dither/Shaded Palette

Postby Nash » Tue Feb 08, 2022 3:38 am

Man, I'm spoiled for choice with all of these retro shaders. :mrgreen:

Thank you for putting this out, Rachael!
User avatar
Nash
AKA Nash Muhandes! Twitter/Facebook/Youtube: nashmuhandes
 
 
 
Joined: 27 Oct 2003
Location: Kuala Lumpur, Malaysia
Twitch ID: nashmuhandes
Github ID: nashmuhandes

Re: 8bit - Dither/Shaded Palette

Postby Rachael » Tue Feb 08, 2022 5:19 am

Thank you for the kind comment, Nash :)
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: 8bit - Dither/Shaded Palette

Postby axredneck » Tue Feb 08, 2022 11:15 am

This needs to be integrated into GZDoom/Raze
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: 8bit - Dither/Shaded Palette

Postby Rachael » Wed Feb 09, 2022 12:17 am

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.
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: 8bit - Dither/Shaded Palette

Postby axredneck » Thu Feb 17, 2022 5:50 pm

Code: Select allExpand view
Script error, /home/redneck/games/doom/8bit/:gldefs.txt line 40: Unknown keyword 'cvar_uniform'

It's GZDoom from today's git master.
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: 8bit - Dither/Shaded Palette

Postby Rachael » Fri Feb 18, 2022 6:17 am

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.
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: 8bit - Dither/Shaded Palette

Postby axredneck » Fri Feb 18, 2022 12:04 pm

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.
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: 8bit - Dither/Shaded Palette

Postby axredneck » Fri Feb 18, 2022 12:27 pm

Tried pk3 instead of your github repo - it gives this (almost the same) error:
Code: Select allExpand view
Script error, 8bit.pk3:gldefs.txt line 40:
Unknown keyword 'cvar_uniform

So it's not something i did wrong with your repo.
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: 8bit - Dither/Shaded Palette

Postby Rachael » Fri Feb 18, 2022 4:02 pm

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 allExpand view
g4.8pre-229-gc926b7533
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: 8bit - Dither/Shaded Palette

Postby axredneck » Fri Feb 18, 2022 6:33 pm

Code: Select allExpand view
> 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!
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: 8bit - Dither/Shaded Palette

Postby axredneck » Fri Feb 18, 2022 6:38 pm

Oh, i still have a problem: settings of this mod aren't saved between GZDoom sessions for some reason.
User avatar
axredneck
excuse me for my bad English
 
Joined: 11 Dec 2017
Location: Russia
Github ID: axredneck
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: 8bit - Dither/Shaded Palette

Postby Rachael » Fri Feb 18, 2022 9:27 pm

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.
User avatar
Rachael
^ walking stack of unfinished projects ^
Admin
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle

Re: 8bit - Dither/Shaded Palette

Postby Randomguy7 » Sat Feb 19, 2022 11:43 pm

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
Randomguy7
 
Joined: 26 Nov 2019
OS Test Version: No (Using Stable Public Version)
Graphics Processor: ATI/AMD (Modern GZDoom)


Return to Shaders

Who is online

Users browsing this forum: No registered users and 0 guests