Demake Shaders

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
RuscoIstar
Posts: 11
Joined: Sun Sep 15, 2019 7:54 pm
Graphics Processor: Intel with Vulkan/Metal Support
Location: Mexico City

Demake Shaders

Post by RuscoIstar »

GZDoomDemakeShaders
GLSL shaders for GZDoom 3.5.0+ that simulate various vintage systems.

Image

Download | Source | Screenshots | Videos

Project's Scope
Doom has been ported to countless devices, most of which have enough processing ability to run the game natively. But that wasn't always the case, and many older computers and video game consoles by 1993 simply were just not powerful enough to run this almighty game. While this situation hasn't changed at all for those ageing systems, it's now possible to use modern source code ports and hardware to simulate what the game might have looked like on systems with less than the minimum requirements (80386DX@33MHz CPU, 4MB DRAM, 20MB HDD & VGA Graphics). There is certainly some charm and interest around the retro-computing look; low resolutions and constrained colour palettes are an aesthetic that keeps on giving nostalgic thrills. This mod is for those who want some chunky pixely goodness.

Roadmap of Features
Refresh Rate Limiter: Control the max frame rate of the engine.
Palette Reduction w/ Ordered Dither: Part of the MariFX Shaders for GZDoom, modified to accept more than 64 palettes and optimized to reduce its video memory footprint.
Multiple retro-systems palettes and colour modes: Videogame home consoles and portable systems, Vintage graphic systems, Monochrome, Grayscale and various RGB levels/bit-depths.
Resolution scaler w/ Non-squared Pixel Aspect Ratios
"Low-Detail" mode (double-width pixels)
Customizable Scanlines and LCD Grid
CRT and LCD simulation
NTSC TV-output Color grading

Acknowledgements
Adam Mathes: Identity CLUTs primer.
Ahefner: NES colour palette and colour emphasis bits info.
Alex Charlton: "Dithering on the GPU" primer.
Alison Watson: ZScript documentation.
Jeremy Selan: GLSL LUT optimized shaders.
khronos.org: GLSL Optimizations and general documentation.
Marisa Kirisame: Palette Reduction w/ Dither GLSL shader.
Pixel Eater: Atari Jaguar Color Space GLSL shader (from Vanilla Essence).
Rachael: Low detail shader.
RiskyJumps: Scanlines shader from libretro.
Sigvatr: EGA Doom.
Super Mario Wiki: Super Game Boy colour palettes info.
VCCE: Tandy CoCo3 palette.
Zdoom.org: (G)ZDoom wiki.

--

I want to clarify that this is my first project using the GL Shader Language and the first time I use github to open my source code; sorry if this appears as a cheap hack job. I did my best to document and reference some pieces of code I didn't come up with but served me as great practical examples.
Last edited by RuscoIstar on Sun Aug 23, 2020 8:41 pm, edited 5 times in total.
User avatar
cubebert
Posts: 103
Joined: Sun Jun 14, 2020 3:37 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Demake Shaders

Post by cubebert »

This is a beautiful set of shaders you've made that came with a lot of options. I gave it a go to test out the palettes and I was surprised to see that they were over 100 of them! I played a little bit of the first episode using the SNES palette with pixelization and dithering and it looks amazing!



I will say however that some of the palettes can look a bit murky even with the sector light mode set to "Bright". For comparison, this is the same scene being rendered on the Sega Genesis palette and without it.




In addition, I think there's a bug that prevents the player's weapon from being pixelized if dithering is put to zero. Besides that bug and some of the palettes though, I think it's a very neat mod that deserves some attention. Well done!

Is is okay for other people to use this in their mods, provided that they give you credit?
User avatar
RuscoIstar
Posts: 11
Joined: Sun Sep 15, 2019 7:54 pm
Graphics Processor: Intel with Vulkan/Metal Support
Location: Mexico City

Re: Demake Shaders

Post by RuscoIstar »

Thank you for the compliments and feedback! Let me address each of these issues one by one.
cubebert wrote:I will say however that some of the palettes can look a bit murky even with the sector light mode set to "Bright". For comparison, this is the same scene being rendered on the Sega Genesis palette and without it.
Some palettes might look really murky or undiscernible because of their lacking colour gamut. In the particular case of the Sega Genesis palette (and also the Nomad, NEC PC Engine/TurboGrafx-16 and Atari ST) we are talking about a 9-bit RGB palette (512 colours in total). Let's take a look at it.



You will find out that there is a great lack of gray tonalities (there are only 8 in total!) and that's what makes certain textures lose their details completely. That's where dithering comes in handy to fake certain shading! Click the image to see an animation showing different levels of dithering.



Some other cases are even more extreme, like the GB palettes which are only 4 colours in total. In cases like that dithering can be insufficient and the only thing that I have found to increase image clarity is bumping the render resolution up... :cry: Believe me that I tried a lot of things to improve things while this project was in the alpha stage, but such is the nature of constrained palettes. Good news for the fans of the Genesis tho; when I created its CLUT file I applied a really naive algorithm to generate it and since it's only 512 colours I can use another method to crush the blacks on the image. I will update it soon, along with a request I got for adding the scanline shader.
cubebert wrote:In addition, I think there's a bug that prevents the player's weapon from being pixelized if dithering is put to zero.
Ah, yes, that was a small oversight. I know what's missing and I'll fix that as well. Thanks!
cubebert wrote:Besides that bug and some of the palettes though, I think it's a very neat mod that deserves some attention. Well done!

Is is okay for other people to use this in their mods, provided that they give you credit?
That's why the code is on github under a GPL-3.0 license~ :wink:
Just be sure to not forget the people I added in the ack section since I didn't do this all just on my own.

Update: I fixed the issues and just uploaded the 0.3.0 version to Moddb. It now features scanlines.
I also changed the readout scale of the dithering slider from [0.0 - 1.0] to integers [0 - 256]. The level of dithering remains the same.
This is a new screenshot of the reference scene with sector light mode set to Bright and using the new Genesis palette with a dithering level of 0 (Off).

User avatar
BradmanX
Posts: 142
Joined: Fri Nov 23, 2012 2:45 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Demake Shaders

Post by BradmanX »

After trying it out a bit, gotta say, this has become one of my favorite shader mods, can't wait to see what comes in later versions ^_^
Last edited by BradmanX on Sun Aug 02, 2020 11:17 pm, edited 1 time in total.
User avatar
RuscoIstar
Posts: 11
Joined: Sun Sep 15, 2019 7:54 pm
Graphics Processor: Intel with Vulkan/Metal Support
Location: Mexico City

Re: Demake Shaders

Post by RuscoIstar »

BradmanX wrote:After trying it out a bit, gotta say, this has become one of my favorite shader mods, can't what to see what comes in later versions ^_^
Thank you! I just updated the mod to version 0.3.1 to fix a few things that were bothering me (and to fix Delta Touch yet again because of OpenGL ES lol). I am satisfied with how it looks for now so I'm taking a small break from this project because of some IRL things but I'll keep an eye for feedback. At least right now I feel it is at a state where people can get plenty of enjoyment out~ :D
User avatar
BradmanX
Posts: 142
Joined: Fri Nov 23, 2012 2:45 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Demake Shaders

Post by BradmanX »

RuscoIstar wrote: Thank you! I just updated the mod to version 0.3.1 to fix a few things that were bothering me (and to fix Delta Touch yet again because of OpenGL ES lol). I am satisfied with how it looks for now so I'm taking a small break from this project because of some IRL things but I'll keep an eye for feedback. At least right now I feel it is at a state where people can get plenty of enjoyment out~ :D
No problem, I've always wanted to see what different Doom Engine games and mods would look like with the palette of another system, so I was honestly excited when I saw this and how many different options there were.:D

And yeah, take your time with it, the mod seems to be in a fairly stable and usable state already and with so many different options, I can't imagine people getting bored with it anytime soon.
User avatar
Bodhisattva
Posts: 54
Joined: Wed Mar 02, 2016 10:28 am
Graphics Processor: ATI/AMD (Modern GZDoom)

Re: Demake Shaders

Post by Bodhisattva »

Just came to say that I absolutely love this thing.





grrstopitbro
Posts: 1
Joined: Tue Feb 04, 2025 9:40 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia (Modern GZDoom)

Re: Demake Shaders

Post by grrstopitbro »

Im using GZDoom 4.14.0 and this mod at least for me does not work.
User avatar
Enjay
 
 
Posts: 26874
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland

Re: Demake Shaders

Post by Enjay »

Have you gone into the options menu and played around with the demake shaders options? If you don't do that, you won't see any changes.

It certainly works just fine for me on 4.14.

Return to “Shaders”