dosbox-staging / dosbox-staging

DOSBox Staging is a modern continuation of DOSBox with advanced features and current development practices.
https://www.dosbox-staging.org/
Other
1.28k stars 154 forks source link

Implement authentic Voodoo output blur filter shader #3822

Open johnnovak opened 2 months ago

johnnovak commented 2 months ago

Overview

Implement a shader that accurately emulates the actual observable image of a Voodoo card connected to a CRT monitor. The card has an internal blur filter to make the 16-bit dither patters "melt away" into continuous colour gradients. This creates extra horizontal blur, but this is how the output of the Voodoo card was designed to look.

PCem used to implement this, not sure if it's still present in the lates PCem version.

Detailed description from the filter author's website:

This web page is dedicated to the development of an experimental shader to recreate the 4x1 linear filter of the once ubiquitous 3dfx Voodoo Graphics and Voodoo2 3d accellerators. Their internal filters are intended to approximate a 24-bit image by filtering a 16-bit image in the buffer (which itself was dithered down from a 24-bit source). This shader aims to recreate that effect. This filter is usually tied with a lot of nostalgia for the early 3dfx accelerators mostly because comparably with other cards of the time, it's much brighter and distinctively blurry. The common complaint about an nVidia card back then (Riva128 & TNT series) and a game such as GLQuake or Quake2 is that it is dark - this is because of the common exposure of 3dfx's default gamma via their MiniGL wrapper. (source)

Further Vogons comment from the author of the filter:

The ingame blurriness in your Q2 video though (i.e. the 3-pixel purple streak off that edge) ? That's normal and by design. That is the screen filter and it is working properly to save your eyes from ICKY GRAINY DITHER PATTERNS. There's environment variables you can set to turn this off if you desired (SST_VIDEO_FILTER_THRESHOLD = 0x000000 off the top of my head, but probably wrong). The default gamma of 1.7 also heavily accentuates this filter, so turning that down to 1.0 should make the 3dfx appear like the other contemporary 3d video cards of the era.

Yeah there's not a lot of awareness about the filter. It's an important aspect of 3dfx that's gone ignored by wrappers, emulators, and retrospectives. I had to do my own clean room research to implement it for PCem's Voodoo Graphics / Voodoo2 emulation a couple of years ago. MAME doesn't have this yet, but should, and i've made an issue to raise awareness about the relevant register involved... (source)

References

Torinde commented 2 months ago

Probably related:

MX9000 commented 2 months ago

In PCem's implementation apparently there are accuracy issues for LOD (Level Of Detail bias) as well:

johnnovak commented 2 months ago

In PCem's implementation apparently there are accuracy issues for LOD (Level Of Detail bias) as well:

This is not related to this ticket, please only post issues that are related.

mip-mapping, 2x2 filter

Not related either... I won't delete these, but please guys, read and understand these things first before you start pasting links 😄 Pattern matching on "blur" is not enough 😏

Amaroq-Clearwater commented 1 month ago

I look forward to seeing some comparison screenshots when this is implemented.