A post-process shader mimicking the 3dfx Voodoo Graphics & 2

Discuss programming topics for any language, any source base. If it is programming related but doesn't fit in one of the below categories, it goes here.
Post Reply
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

A post-process shader mimicking the 3dfx Voodoo Graphics & 2

Post by leileilol »

This is a project i've been working on.

If you've ever owned an older 3dfx card (pre-Voodoo4) you'll know what this is all about.


Would love to get some actual ordered dither in there...


Some shots:
Image
Image
Last edited by leileilol on Fri Mar 07, 2014 9:36 pm, edited 1 time in total.
i should not be here
Barnes
Posts: 232
Joined: Thu Dec 24, 2009 2:26 pm
Location: Russia, Moscow
Contact:

Re: A post-process shader mimicking the 3dfx Voodoo2

Post by Barnes »

mmm 16bit dither?)
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: A post-process shader mimicking the 3dfx Voodoo2

Post by leileilol »

It's more than just that. The shader without the filter is still useful for the psuedo dither for modern cards running in 16bpp, but there's very few DX9 games that even force you to 16bpp so not much application to be had there (unless you use some GL>D3D9 wrapper like GlDirect and you're playing an older GL game such as Q/Q2/H2/SiN/HL etc).... until DXGL gets D3D3-6 working, since many early Direct3D games never gave the choice of 24/32bpp (only a few exceptions, like AvP).
i should not be here
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: A post-process shader mimicking the 3dfx Voodoo2

Post by leileilol »

I've attempted a GLSL port, unfortunately it doesn't look as convincing as my Cg version. Its 'dither' is even worse.

Image

(also made a cvar that limits the textures to 256x256 and in 15/16bit formats regardless of r_picmip and r_textureBits)

The shaders themselves, and they should go like this:

Pass1: leifx_dither
Pass2: leifx_gamma
Pass3: leifx_filter
Pass4: leifx_filter
Pass5: leifx_filter
Pass6: leifx_filter



Any (clean room!) tips or advice on achieving the ordered dithering in the shader would be appreciated. :)
i should not be here
Eukara
Posts: 31
Joined: Fri Jul 22, 2011 3:00 pm
Location: /dev/cdrom
Contact:

Re: A post-process shader mimicking the 3dfx Voodoo Graphics

Post by Eukara »

Aww yes.
Gimme dem scanlines.
jitspoe
Posts: 217
Joined: Mon Jan 17, 2005 5:27 am

Re: A post-process shader mimicking the 3dfx Voodoo Graphics

Post by jitspoe »

I always hated the 3dfx look. I remember when I got my first voodoo (doodoo) card, and I was like, "Why are there weird rainbow colored splotches in the lightmaps? Why is everything so blurry? What's with the scan lines? I thought 3D acceleration was supposed to make the game look better... software mode looked better than this!"
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: A post-process shader mimicking the 3dfx Voodoo Graphics

Post by leileilol »

It's more of a 'hardware preservation' kind of thing. Also some people are wacky and think the Voodoo looked better because it eliminated the dithering every other card had (despite some cards supporting 32bpp, that bit depth wasn't available in most early 3d accelerated games as a choice. )

Also remember - 3d accelerator. 3dfx gained the marketshare early because for once it actually lived up to that word. People were willing to compromise image quality for it, despite earlier S3 ViRGE, GLint and Millenium looking cleaner.

RetroArch version




There's also some other shader ideas...

- PowerVR alpha blend texture shader (resample 16x, Nearest texture filter on alpha channel, RGBA4444 the texture AND the modulated alpha)
- ATI Rage error diffusion table dither shader (all cards from Rage to Radeon 7500 had this. 8500 only has it in blending functions)
- Nvidia box 'dither' shader (all cards from Riva TNT up to Geforce7 had this)
i should not be here
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: A post-process shader mimicking the 3dfx Voodoo Graphics

Post by revelator »

In 2d the best looking was the matrox g200 and earlier the 4000 chipset by tseng labs. Both Cards rocked with a voodoo :) i still have fond memories of these beating a geforce 1 hehe.
Productivity is a state of mind.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: A post-process shader mimicking the 3dfx Voodoo Graphics

Post by leileilol »

That's true if you have a K6-2 system. 3dNow gave 3dfx a nice boost even over the Geforce3 in game performance on those.

I am still working on this shader, i've recently greatly redone the dithering pass. It's still not perfect, but it's awfully close.

I am using the dither matrix table from voodoo.h from the MAME/MESS source, and fortunately that particular bit of code is under a BSD 3 clause license.

Image
i should not be here
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: A post-process shader mimicking the 3dfx Voodoo Graphics

Post by revelator »

I think i got one of the last sources for the voodoo driver somwhere on my harddrives, not sure if that would help with the dither tables ?.
I think its the one for the XP port if i remember correctly (hacked together from the Linux sources by a voodoo enthusiast).

True the voodoo played really nice with the AMD chips back in the days :) just dont remind me of the Cyrix CPU's from back then hehe :twisted:
Productivity is a state of mind.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: A post-process shader mimicking the 3dfx Voodoo Graphics

Post by leileilol »

I doubt a 3dfx driver source would contain the pixel fragment code that the chips themselves had processed.
i should not be here
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: A post-process shader mimicking the 3dfx Voodoo Graphics

Post by revelator »

Not as actuall fragment code no (kinda doubt that the voodoo's had shader capabilities) but maybe a hint on how the tables where setup :).
Productivity is a state of mind.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: A post-process shader mimicking the 3dfx Voodoo Graphics

Post by leileilol »

HunterK wrote a blog post featuring the shader in action. I also recently committed the new dithering version in the RetroArch common-shaders repository
i should not be here
Post Reply