VOGONS

Common searches


3dfx filter shader!

Topic actions

  • This topic is locked. You cannot reply or edit posts.

Reply 40 of 67, by leileilol

User metadata
Rank l33t++
Rank
l33t++

Just placing these screenshots here for reference on how 3dfx's actual dither looked for future replication in the shader.

Attachments

apsosig.png
long live PCem

Reply 41 of 67, by leileilol

User metadata
Rank l33t++
Rank
l33t++

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

apsosig.png
long live PCem

Reply 42 of 67, by leileilol

User metadata
Rank l33t++
Rank
l33t++

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
    Filename
    NewFilter.png
    File size
    377.55 KiB
    Views
    4994 views
    File license
    Fair use/fair dealing exception

apsosig.png
long live PCem

Reply 44 of 67, by Stiletto

User metadata
Rank l33t++
Rank
l33t++

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

Reply 45 of 67, by leileilol

User metadata
Rank l33t++
Rank
l33t++

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

3dfxshader35.png

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
    Filename
    3dfxshader39.png
    File size
    249.18 KiB
    Views
    4938 views
    File comment
    the filter as implemented in OA3 (OpenGL)
    File license
    Fair use/fair dealing exception

apsosig.png
long live PCem

Reply 46 of 67, by leileilol

User metadata
Rank l33t++
Rank
l33t++

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

  • Filename
    3dfx-ge642.png
    File size
    50.51 KiB
    Downloads
    No downloads
    File license
    Fair use/fair dealing exception

apsosig.png
long live PCem

Reply 47 of 67, by Stiletto

User metadata
Rank l33t++
Rank
l33t++

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

Reply 48 of 67, by leileilol

User metadata
Rank l33t++
Rank
l33t++

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
    Filename
    filtercompare2.png
    File size
    5.69 KiB
    Views
    4890 views
    File comment
    New shader after December 3 2014
    File license
    Fair use/fair dealing exception
  • filtercompare.png
    Filename
    filtercompare.png
    File size
    4.63 KiB
    Views
    4890 views
    File comment
    Old shader before December 3 2014
    File license
    Fair use/fair dealing exception

apsosig.png
long live PCem

Reply 49 of 67, by leileilol

User metadata
Rank l33t++
Rank
l33t++

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
    Filename
    3dfxtex2.png
    File size
    109.62 KiB
    Views
    4814 views
    File license
    Fair use/fair dealing exception

apsosig.png
long live PCem

Reply 50 of 67, by leileilol

User metadata
Rank l33t++
Rank
l33t++

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

  • Filename
    3dfxtex3.jpg
    File size
    87.22 KiB
    Downloads
    No downloads
    File license
    Fair use/fair dealing exception

apsosig.png
long live PCem

Reply 52 of 67, by leileilol

User metadata
Rank l33t++
Rank
l33t++

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 🙁

apsosig.png
long live PCem

Reply 54 of 67, by leileilol

User metadata
Rank l33t++
Rank
l33t++

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
    Filename
    pcx2lol.png
    File size
    157.42 KiB
    Views
    4609 views
    File license
    Fair use/fair dealing exception

apsosig.png
long live PCem

Reply 56 of 67, by leileilol

User metadata
Rank l33t++
Rank
l33t++

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... 😵 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
    Filename
    pcemgta.png
    File size
    463.11 KiB
    Views
    3955 views
    File license
    Fair use/fair dealing exception

apsosig.png
long live PCem

Reply 57 of 67, by Matsilagi

User metadata
Rank Newbie
Rank
Newbie
leileilol wrote:
IIRC one of the reshade shader packs (MasterEffect Reborn) had this shader, but thought it was a "stupid thing, author created u […]
Show full quote

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... 😵 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))

Reply 58 of 67, by leileilol

User metadata
Rank l33t++
Rank
l33t++

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.

apsosig.png
long live PCem

Reply 59 of 67, by Matsilagi

User metadata
Rank Newbie
Rank
Newbie
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 […]
Show full quote

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).