8bit - Dither/Shaded Palette

Forum rules
The Projects forums are only for projects. If you are asking questions about a project, either find that project's thread, or start a thread in the General section instead.

Got a cool project idea but nothing else? Put it in the project ideas thread instead!

Projects for any Doom-based engine (especially 3DGE) are perfectly acceptable here too.

Please read the full rules for more details.
User avatar
Rachael
Admin
Posts: 12966
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

8bit - Dither/Shaded Palette

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
Rachael
Admin
Posts: 12966
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: 8bit - Dither/Shaded Palette

Post 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)
You do not have the required permissions to view the files attached to this post.
User avatar
Nash
 
 
Posts: 17296
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: 8bit - Dither/Shaded Palette

Post by Nash »

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

Thank you for putting this out, Rachael!
User avatar
Rachael
Admin
Posts: 12966
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: 8bit - Dither/Shaded Palette

Post by Rachael »

Thank you for the kind comment, Nash :)
User avatar
axredneck
Posts: 286
Joined: Mon Dec 11, 2017 2:09 pm
Graphics Processor: nVidia with Vulkan support
Location: Russia

Re: 8bit - Dither/Shaded Palette

Post by axredneck »

This needs to be integrated into GZDoom/Raze
User avatar
Rachael
Admin
Posts: 12966
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: 8bit - Dither/Shaded Palette

Post 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.
User avatar
axredneck
Posts: 286
Joined: Mon Dec 11, 2017 2:09 pm
Graphics Processor: nVidia with Vulkan support
Location: Russia

Re: 8bit - Dither/Shaded Palette

Post 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.
User avatar
Rachael
Admin
Posts: 12966
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: 8bit - Dither/Shaded Palette

Post 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.
User avatar
axredneck
Posts: 286
Joined: Mon Dec 11, 2017 2:09 pm
Graphics Processor: nVidia with Vulkan support
Location: Russia

Re: 8bit - Dither/Shaded Palette

Post 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.
User avatar
axredneck
Posts: 286
Joined: Mon Dec 11, 2017 2:09 pm
Graphics Processor: nVidia with Vulkan support
Location: Russia

Re: 8bit - Dither/Shaded Palette

Post 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.
User avatar
Rachael
Admin
Posts: 12966
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: 8bit - Dither/Shaded Palette

Post 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
User avatar
axredneck
Posts: 286
Joined: Mon Dec 11, 2017 2:09 pm
Graphics Processor: nVidia with Vulkan support
Location: Russia

Re: 8bit - Dither/Shaded Palette

Post 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!
User avatar
axredneck
Posts: 286
Joined: Mon Dec 11, 2017 2:09 pm
Graphics Processor: nVidia with Vulkan support
Location: Russia

Re: 8bit - Dither/Shaded Palette

Post by axredneck »

Oh, i still have a problem: settings of this mod aren't saved between GZDoom sessions for some reason.
User avatar
Rachael
Admin
Posts: 12966
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: 8bit - Dither/Shaded Palette

Post 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.
Randomguy7
Posts: 15
Joined: Tue Nov 26, 2019 9:51 pm
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: 8bit - Dither/Shaded Palette

Post 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

Return to “Shaders”