[FTEQW] Bandither - A "Retro" Dithering and Colorband Shader

Discuss programming topics that involve the OpenGL API.
Post Reply
Immorpher
Posts: 7
Joined: Sun May 01, 2022 12:54 am
Contact:

[FTEQW] Bandither - A "Retro" Dithering and Colorband Shader

Post by Immorpher »

Bandither is a non-linear color banding and dithering shader for GZDoom, FTEQW, Doom 64, and ReShade. It quantizes each color channel similar to 3D graphics hardware of the 1990's (Sega Saturn, Playstation 1, Nintendo 64, Voodoo 1/2) and can be skewed for darker games. It has multiple dithering modes, which can be blended, and are adjustable from pure color bands to full dithering. The amount of colors and linearity of the banding can be adjusted too.

Download Here: https://github.com/Immorpher/Bandither/releases/


Screenshots:
All screenshots were taken at half resolution (to show off the dither better), with 8 color levels per channel (512 total colors), and a banding curve of 5 (which has more darker color levels). Color levels can be reduced to 2 per channel or increased much higher. Refer to the twitter post: https://twitter.com/immorpher64/status/ ... 0229944320


Videos:
It is hard to see the dither effects through the YouTube video compression. But you can catch glimpses of it in HD resolution.
Dither Type: Bayer 8x8, Dither Amount: 0.5 https://youtu.be/-wo27fVaBcE
Dither Type: Scanline, Dither Amount: 1 https://youtu.be/teG4uWo2Q10
Dither Type: Scanline, Dither Amount: 0.5 https://youtu.be/6ujS4py7pDw
Dither Type: Motion Noise, Dither Amount: 0.5 https://youtu.be/7ZElNXh4laI
Last edited by Immorpher on Sun May 22, 2022 5:33 am, edited 1 time in total.
Eukara
Posts: 31
Joined: Fri Jul 22, 2011 3:00 pm
Location: /dev/cdrom
Contact:

Re: [FTEQW] Bandither - A "Retro" Dithering and Colorband Shader

Post by Eukara »

Wow! Awesome release.

I have nothing to add, besides perhaps suggesting that the install process is as simple as renaming the .zip from your Releases page on GitHub to a .pk3 extension and you can plop them whole thing into id1/ as-is! That's all. Cool work!
Immorpher
Posts: 7
Joined: Sun May 01, 2022 12:54 am
Contact:

Re: [FTEQW] Bandither - A "Retro" Dithering and Colorband Shader

Post by Immorpher »

I completely forgot that FTEQW had PK3 with its Quake 3 support. That will be easy to do!

I have also made a recent update to add more dither types as well: https://twitter.com/immorpher64/status/ ... 1604486144

I am still looking into ambient occlusion; I think I will start badgering more knowledgeable people haha.
Eukara
Posts: 31
Joined: Fri Jul 22, 2011 3:00 pm
Location: /dev/cdrom
Contact:

Re: [FTEQW] Bandither - A "Retro" Dithering and Colorband Shader

Post by Eukara »

Spike would probably know exactly where to start in regards to SSAO!
Immorpher
Posts: 7
Joined: Sun May 01, 2022 12:54 am
Contact:

Re: [FTEQW] Bandither - A "Retro" Dithering and Colorband Shader

Post by Immorpher »

Eukara wrote: Thu May 05, 2022 4:47 pm Spike would probably know exactly where to start in regards to SSAO!
Oh I bet! I have pestered poor Spike so much in the past haha.

From my researching I will need a depth buffer, which from the shader showcase it seems to have. A "normal" buffer with angles will help too. But if not, normals can be calculated from the depth buffer.
Immorpher
Posts: 7
Joined: Sun May 01, 2022 12:54 am
Contact:

Re: [FTEQW] Bandither - A "Retro" Dithering and Colorband Shader

Post by Immorpher »

Perhaps jumping the shark with this one! The latest Bandither update lets you blend dither styles. This is to quench my obsession to add a bit of noise to dithers. But also I found you could get some funky results by blending two unrelated style. Also the motion noise now varies with time, so you can add some time-varying noise to any dither. To make up for jumping the shark, I did clean some of the code! https://github.com/Immorpher/Bandither/releases/

I will eventually get the FTEQW shader in a pk3 as well, once I learn how to set some of the shader options as CVars. I seen you could do that in the GLSL showreel, just need to learn from that!
Eukara
Posts: 31
Joined: Fri Jul 22, 2011 3:00 pm
Location: /dev/cdrom
Contact:

Re: [FTEQW] Bandither - A "Retro" Dithering and Colorband Shader

Post by Eukara »

For cvars in GLSL shaders, you can add something like:

Code: Select all

!!cvardf r_skipFoobar
At the top of the shader (after your samplers)

and then inside your functions:

Code: Select all

	#if r_skipFoobar == 0
		// inactive
	#else
		// active
	#endif
Immorpher
Posts: 7
Joined: Sun May 01, 2022 12:54 am
Contact:

Re: [FTEQW] Bandither - A "Retro" Dithering and Colorband Shader

Post by Immorpher »

Eukara wrote: Thu May 12, 2022 6:36 pm For cvars in GLSL shaders, you can add something like:

Code: Select all

!!cvardf r_skipFoobar
At the top of the shader (after your samplers)

and then inside your functions:

Code: Select all

	#if r_skipFoobar == 0
		// inactive
	#else
		// active
	#endif
Nice that seems simple enough! Is there a way to set a default value for the cvar? Like... !!cvardf r_skipFoobar = 0

I am going to see if I can find info on that.
Immorpher
Posts: 7
Joined: Sun May 01, 2022 12:54 am
Contact:

Re: [FTEQW] Bandither - A "Retro" Dithering and Colorband Shader

Post by Immorpher »

On a google search I seen something like this

!!cvardf r_glsl_turbscale_reflect=1

So it looks like thats how its done! Ill get working on it
Eukara
Posts: 31
Joined: Fri Jul 22, 2011 3:00 pm
Location: /dev/cdrom
Contact:

Re: [FTEQW] Bandither - A "Retro" Dithering and Colorband Shader

Post by Eukara »

Cool! Can't wait to see what's next :biggrin:
Immorpher
Posts: 7
Joined: Sun May 01, 2022 12:54 am
Contact:

Re: [FTEQW] Bandither - A "Retro" Dithering and Colorband Shader

Post by Immorpher »

Thanks for your suggestion Eukara as Bandither has been updated to 1.4! This does not add any more new features, rather better support for more software.

- ReShade support has been added, thus allowing it to be used for a lot more software. I had to convert the coding from GLSL to HLSL, thus I can leverage this for more application support in the future perhaps.
- Doom 64 Remaster (KEX engine) support has been added too! I recommend implementing it via ReShade as it takes a bit of extra effort to adjust its settings within the Doom 64 Remaster. It only compiles under OpenGL as well, but this is a proof of concept that future mods could use custom shaders in the KEX engine!
- FTEQW now has better support with console variable options and its nicely bundled as a pk3 now.
Post Reply