3dfx filter shader!

Announcements, advice, random banter, unrelated discussion, et cetera.

Re: 3dfx filter shader!

Postby leileilol » 2014-3-17 @ 20:27

Just placing these screenshots here for reference on how 3dfx's actual dither looked for future replication in the shader.
Attachments
voodoo2-additive-nearest.png
voodoo2-additive-nearest.png (9.15 KiB) Viewed 3146 times
voodoo2-patterns.png
voodoo2-patterns.png (13.07 KiB) Viewed 3146 times
by the way, DOSBox is not for running Windows 9x
User avatar
leileilol
l33t++
 
Posts: 9701
Joined: 2006-12-16 @ 18:03

Re: 3dfx filter shader!

Postby leileilol » 2014-12-02 @ 21:05

Trying to improve on this filter again. Will update the SweetFX version soon. Still wish nGlide had a postprocess shader backend to work with for this kind of thing...

- Gamma isn't done per line anymore - instead there's a faint purple line added for the lines - why i didn't realize this earlier, I am not sure.
- Trying to adjust the filter threshold, still not exactly sure how that is determined on actual 3dfx hardware
- Done from comparing to a 3dfx Voodoo Graphics GLQuake BMP screenshot from an old desktop theme. Additive blending precision differences, mirroralpha usage, paletted textures (hence the wood discoloration in the mips) and the 16-bit lightmap (hence green tint) are not accounted for


Process is currently this:


- Dither the buffer
- Reduce buffer to 16-bit color
- Filter the buffer
- Filter the buffer
- Filter the buffer
- Filter the buffer
- Gamma correct the buffer (in this case, 1.7, to match the gamma forced by the 3dfx MiniGL)


I still want to fork QeffectsGL or have some sort of Mingw-compilable DLL for this.
Attachments
GLQuakeStart-RadeonFiltered.png
GLQuakeStart-RadeonFiltered.png (379.66 KiB) Viewed 3055 times
GLQuakeStart-3dfxVoodooGraphics.png
GLQuakeStart-3dfxVoodooGraphics.png (384.64 KiB) Viewed 3055 times
by the way, DOSBox is not for running Windows 9x
User avatar
leileilol
l33t++
 
Posts: 9701
Joined: 2006-12-16 @ 18:03

Re: 3dfx filter shader!

Postby leileilol » 2014-12-03 @ 21:32

I just rewrote parts of the filter process to not do it by mean/threshold anymore, after realizing the 3dfx card didn't actually do that.

still an approximation, but matches closer to the filter than ever!
Attachments
NewFilter.png
NewFilter.png (377.55 KiB) Viewed 3009 times
by the way, DOSBox is not for running Windows 9x
User avatar
leileilol
l33t++
 
Posts: 9701
Joined: 2006-12-16 @ 18:03

Re: 3dfx filter shader!

Postby keropi » 2014-12-03 @ 21:44

this looks like a real voodoo output, it's what I remember from back then... kudos!
User avatar
keropi
l33t++
 
Posts: 7076
Joined: 2003-9-08 @ 06:45
Location: Greece

Re: 3dfx filter shader!

Postby Stiletto » 2014-12-03 @ 22:10

Looks really nice!

Since we'd be nobody if not nitpickers... what's going on on the left of GLQuakeStart-3dfxVoodooGraphics.png? The window alcove there is much dimmer. Is it just the angle? Also, the brown wood seems much "richer" in your filter too. Otherwise, don't count on me for aesthetic criticism, I don't really have an eye for it. ;)
"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto
User avatar
Stiletto
l33t
 
Posts: 4309
Joined: 2002-7-01 @ 21:57

Re: 3dfx filter shader!

Postby leileilol » 2014-12-03 @ 22:15

The window is dimmer because that particular Voodoo screenshot had r_mirroralpha set. Remember I pulled this screenshot out of a Aug 97-dating desktop theme, because it was a BMP and it was lossless :)
There's also 16-bit lightmaps and 8bpp->15bpp->16bpp textures (or paletted?), and I don't think I can force either in 32bpp in stock GLquake :(

I'm using GLDirect + eFX + SweetFX, and in that chain trilinear filtering is forced :(


One nice difference between the old filter and the new you can compare with the 3dfx screenie is the bleed of the floor in the left hallway to the wall, and the dark edge of the medium difficulty bridge. This 3x'd Hexen II screenie shows it better

Image


I should update my Retroarch and GLSL versions soon

Process is now

Dither
Reduce-to-16bpp
Add Lines
Filter
Filter
Filter
Filter
Gamma

EDIT: Attached a screenshot of the GLSL version, which should have other 3dfxisms applied (256 tex, 16-bit lightmap), subhuman@gtx should like this screenshot :) I will want to fork QeffectsGL to integrate this shader as an wrapper of some sort. So far i've been able to compile it with MinGW but don't have the GL function exports working yet
Attachments
3dfxshader39.png
the filter as implemented in OA3 (OpenGL)
3dfxshader39.png (249.18 KiB) Viewed 2953 times
by the way, DOSBox is not for running Windows 9x
User avatar
leileilol
l33t++
 
Posts: 9701
Joined: 2006-12-16 @ 18:03

Re: 3dfx filter shader!

Postby leileilol » 2014-12-05 @ 22:40

Updated the retroarch version.


EFXSweetFX version here. NOTE: Not tested in any newer repack since, since I didn't really care for the other shaders :)
Attachments
3dfx-ge642.png
(50.51 KiB) Not downloaded yet
by the way, DOSBox is not for running Windows 9x
User avatar
leileilol
l33t++
 
Posts: 9701
Joined: 2006-12-16 @ 18:03

Re: 3dfx filter shader!

Postby Stiletto » 2014-12-06 @ 00:25

For some reason I was thinking about this earlier:
http://www.vogonsdrivers.com/getfile.php?fileid=493
SuprGrab will grab the current contents of the frame buffer (backbuffer) on a 3Dfx card and do proper filtering and gamma correction on it. The images should be duplicate the quality of what is on the screen.

If that is helpful at all? ;)
"I see a little silhouette-o of a man, Scaramouche, Scaramouche, will you
do the Fandango!" - Queen

Stiletto
User avatar
Stiletto
l33t
 
Posts: 4309
Joined: 2002-7-01 @ 21:57

Re: 3dfx filter shader!

Postby leileilol » 2014-12-06 @ 00:30

Haven't tried that since 1. don't have a Voodoo Graphics card handy and my Voodoo2 is dead, and 2. I'm not sure of what technique it uses or where the info that grabbing tool got the filter implementation from. Probably info on usenet somewhere, though Google groups search is completely unhelpful for that now.

BTW HyperSnap does a similar function in Windows and it can also do the Voodoo3 2x2 OMFG22-BiT1!!!!!!!!!1!!!!! box filter. I should set sights on that, or maybe the very similar INTERNAL TRUE COLOUR!!!!!1!1!!! PowerVR Kyro dither effect. :)

I'm fairly certain my filtering technique is correct though, just needs some value tweaking here and there to match closer. The dithering however is incorrect as voodoo2 doesn't do that in post, it does that on the texture unit itself. You can see the dither pattern retained behind the additive blended blobs in the image at the top of the page for example. Replicating this would need something more ambitious for shader processing, like a custom glide wrapper with generic shader programs for everything and I'm not sure where to get started on that as nGlide and dgVoodoo seem closed source. Hacking OpenGlide?
This also in turn would do the other 2x2 dither table for blended pixels for that familiar 16-bit crosshatch effect
Attachments
filtercompare2.png
New shader after December 3 2014
filtercompare2.png (5.69 KiB) Viewed 2905 times
filtercompare.png
Old shader before December 3 2014
filtercompare.png (4.63 KiB) Viewed 2905 times
by the way, DOSBox is not for running Windows 9x
User avatar
leileilol
l33t++
 
Posts: 9701
Joined: 2006-12-16 @ 18:03

Re: 3dfx filter shader!

Postby leileilol » 2014-12-11 @ 03:20

Ok I began working on texture dither shaders (rather than postprocess), learning how to do it in a more 'proper' way more true to the 3dfx card.

though no vertex colors or alpha modulation yet :(

Prototyping in OA3 because I can't do that anywhere else.
Attachments
3dfxtex2.png
3dfxtex2.png (109.62 KiB) Viewed 2829 times
by the way, DOSBox is not for running Windows 9x
User avatar
leileilol
l33t++
 
Posts: 9701
Joined: 2006-12-16 @ 18:03

Re: 3dfx filter shader!

Postby leileilol » 2014-12-11 @ 17:00

A little update, I have half of the dithering working. Due to how the q3 engine works i'd have to make a multitextured pass shader too so the map could get dithering.

How a glide wrapper would implement this, I have no idea.
Attachments
3dfxtex3.jpg
(87.22 KiB) Not downloaded yet
by the way, DOSBox is not for running Windows 9x
User avatar
leileilol
l33t++
 
Posts: 9701
Joined: 2006-12-16 @ 18:03

Re: 3dfx filter shader!

Postby DracoNihil » 2014-12-11 @ 21:11

That looks amazing, I wish I could play GunDX with this shader...
User avatar
DracoNihil
Oldbie
 
Posts: 1255
Joined: 2011-10-09 @ 14:26
Location: Independence, KS

Re: 3dfx filter shader!

Postby leileilol » 2014-12-12 @ 03:02

I beat it enough to work on everything and have it divided to two shaders messily to use two different dither tables. Here's a video in a more familiar game. Unfortunately it's a bit unstable at that point, it crashes the engine on certain cinematics :(
by the way, DOSBox is not for running Windows 9x
User avatar
leileilol
l33t++
 
Posts: 9701
Joined: 2006-12-16 @ 18:03

Re: 3dfx filter shader!

Postby leileilol » 2014-12-17 @ 08:32

OT but am I going too far?
Attachments
g100lol.png
g100lol.png (30.46 KiB) Viewed 2669 times
by the way, DOSBox is not for running Windows 9x
User avatar
leileilol
l33t++
 
Posts: 9701
Joined: 2006-12-16 @ 18:03

Re: 3dfx filter shader!

Postby leileilol » 2014-12-18 @ 23:12

In anticipation of the PowerVR SGL wrapper I've tried to write a texture shader to mimic the limited alpha blending precision. The blockyness could be done better. No postprocess dither yet


This screenshot looks 'okay' because I wrote the particle system to force alpha modulation for fading anyway as per the alpha mode fallback
Attachments
pcx2lol.png
pcx2lol.png (157.42 KiB) Viewed 2624 times
by the way, DOSBox is not for running Windows 9x
User avatar
leileilol
l33t++
 
Posts: 9701
Joined: 2006-12-16 @ 18:03

Re: 3dfx filter shader!

Postby Matsilagi » 2015-7-09 @ 23:43

Sorry for the bump but i couldn't let this shader die.

Ever tought about rewriting it to ReShade?

Its the same as SweetFX, but more advanced, and automatically does HLSL to GLSL conversion.

It also works with DX8/9/10/11 and OpenGL with the same DLL
Matsilagi
Newbie
 
Posts: 13
Joined: 2015-7-09 @ 23:40

Re: 3dfx filter shader!

Postby leileilol » 2015-7-10 @ 00:31

IIRC one of the reshade shader packs (MasterEffect Reborn) had this shader, but thought it was a "stupid thing, author created unnecessarily messy code so rewriting it is difficult when nobody understands HOW it is actually working,"

Given its copypasted presence in a 'effect pack', what were they expecting, a superHDcalifrasticifier? :|

Also it's not really a "nightmare", it just requires some more passes because the filter must work four times consecutively after the dither (faking a 16-bit pixel buffer). Then lines and gratuitous gamma correction are done after. I haven't looked into Reshade itself yet, but i'm betting it'll be quite easy to have leifx working properly in there. Given that it's a shader to mock the effects of a DAC, it should be done last, but before any signal/monitorscreen shaders.


now if you want MESSY filter code, look at my C version submitted as patches to PCem... X( I have to make lookup tables to keep the performance somewhat sane, and it only really works well with Intel Core processors. But when it works, it looks somewhat good

I feel a form of SIMD could be used here, but I know jack about intrinsics and simd assembly.
Attachments
pcemgta.png
by the way, DOSBox is not for running Windows 9x
User avatar
leileilol
l33t++
 
Posts: 9701
Joined: 2006-12-16 @ 18:03

Re: 3dfx filter shader!

Postby Matsilagi » 2015-7-10 @ 01:14

leileilol wrote:IIRC one of the reshade shader packs (MasterEffect Reborn) had this shader, but thought it was a "stupid thing, author created unnecessarily messy code so rewriting it is difficult when nobody understands HOW it is actually working,"

Given its copypasted presence in a 'effect pack', what were they expecting, a superHDcalifrasticifier? :|

Also it's not really a "nightmare", it just requires some more passes because the filter must work four times consecutively after the dither (faking a 16-bit pixel buffer). Then lines and gratuitous gamma correction are done after. I haven't looked into Reshade itself yet, but i'm betting it'll be quite easy to have leifx working properly in there. Given that it's a shader to mock the effects of a DAC, it should be done last, but before any signal/monitorscreen shaders.


now if you want MESSY filter code, look at my C version submitted as patches to PCem... X( I have to make lookup tables to keep the performance somewhat sane, and it only really works well with Intel Core processors. But when it works, it looks somewhat good

I feel a form of SIMD could be used here, but I know jack about intrinsics and simd assembly.


I wasn't the maker of the pack. I dont even know why i asked him to include it in ME in the first page (i dunno, i think it was because there wasn't a way to merge effects in old versions, dunno)

Do you think this C version can work with ReShade? I tried the SweetFX one but it didn't, i really miss this shader and i dont want 2 wrapper DLLs on my games.
EDIT:Just read trough now, derp, i will wait then.
I also tried adding you on steam a LOONG time ago, no avail, ohwell, incase you ever do, lemme know (steam name is Matsilagi (community link is matsilagi2))
Matsilagi
Newbie
 
Posts: 13
Joined: 2015-7-09 @ 23:40

Re: 3dfx filter shader!

Postby leileilol » 2015-7-10 @ 04:28

I keep my steam to my friends. I used to have a big list, but didn't like it so I did a massive cutdown years ago to help clear my mind from the pressure.



I might look into the reshade thing. which I have to since maybe it'll work with nGlide so I could play those wrapped glide games with this shader finally


It still can't do texture shaders though, which would be vital for the dithering thing for more accurate 3dfx representation.


I mentioned the C version in this thread since it's the latest incarnation of the shader so far and it's being done for SarahWalker's PCem PC emulator's Voodoo emulation software renderer, which is the most logical place where it could possibly go. :) It only does filtering and adds lines.
by the way, DOSBox is not for running Windows 9x
User avatar
leileilol
l33t++
 
Posts: 9701
Joined: 2006-12-16 @ 18:03

Re: 3dfx filter shader!

Postby Matsilagi » 2015-7-10 @ 20:05

leileilol wrote:I keep my steam to my friends. I used to have a big list, but didn't like it so I did a massive cutdown years ago to help clear my mind from the pressure.



I might look into the reshade thing. which I have to since maybe it'll work with nGlide so I could play those wrapped glide games with this shader finally


It still can't do texture shaders though, which would be vital for the dithering thing for more accurate 3dfx representation.


I mentioned the C version in this thread since it's the latest incarnation of the shader so far and it's being done for SarahWalker's PCem PC emulator's Voodoo emulation software renderer, which is the most logical place where it could possibly go. :) It only does filtering and adds lines.


I can confirm it works with POD (GoG) and other old GOG Games.

GLQuake and other quakes support is native, just rename ReShade32.dll and it will work.

EDIT: also, one thing to keep in mind is that during ReShade's rewrites, the shader may run faster on DirectX but run slower on OpenGL, so keep that in mind (or you can try and rewrite the code in a way it doesn't get too heavy)

EDIT2:Guess instead of giving pointless replies, imma just subscribe to the thread and keep checking the leifx page/this thread everyday. Im also open for betatesting the shaders on various games, been doing that a lot on MasterEffect since it got released (and even before its release).
Matsilagi
Newbie
 
Posts: 13
Joined: 2015-7-09 @ 23:40

PreviousNext

Return to Milliways

Who is online

Users browsing this forum: No registered users and 9 guests