• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

PXAA: FXAA without the blur (or how to use 100s of GFLOPs for minor gain)

Durante

Member
Nine months or so back I made a thread about adding FXAA to all PS360 games by playing via a capture card and running the postprocessing on PC using PtBi.

The main drawback of that method was that applying FXAA "blindly" on the whole image doesn't just anti-alias edges, it also slightly reduces texture clarity and, worst of all, negatively affects the clarity and shape of user interface elements.

Well, I finished work on a new post-processing anti-aliasing method that almost entirely eliminates that problem. A somewhat detailed description can be found here. In short, it uses the crazy power of contemporary GPUs (and a really useful OpenGL 4.2 extension) to search image areas that are (almost) certainly aliasing artifacts, and then selectively applies highest quality FXAA to only those areas. TPXAA is an improved version that takes multiple frames into account.

Some comparison images:

detail1.png

Clearly, the anti-aliasing effect is as good as FXAA. If you pay really close attention to the upper left texture you can also see how it's slightly blurred in the FXAA version.

detail3.png

2D/UI content is not blurred or deformed in any way.

I feel confident in saying that unlike FXAA, TPXAA is almost always purely an improvement, it never degrades any aspect of image quality.

Here are the full res images the first comparison above is cropped from (taken from Nier):
No AA
FXAA
TPXAA

What's the catch?
Well, there are two of them. First of all, to use it on console games, you need the right capturing hardware.
The second is performance. For a 720p frame FXAA takes 1.3ms on my setup -- TPXAA can take 2.8 - 3.6. Still easily enough for 60 captured console frames per second, but not a realistic option in any way for high-res PC games.

If anyone has the right equipment and an AMD card I'd be really happy to hear about any results, this was developed and tested on Nvidia so I'm almost certain that some problems may come up.
 

Toma

Let me show you through these halls, my friend, where treasures of indie gaming await...
You are one amazing dude, do you know that? (Awesome favorite game on top of that)

Wont be able to use it, but wow.

Edit: I want more High res anti-aliased Screenshots of current gen games please. Did you make more comparison shots of other games?
 

Durante

Member
You are one amazing dude, do you know that? (Awesome favorite game on top of that)
Thanks, some people would call it "obsessive" but I prefer "amazing" ;)

Edit: I want more High res anti-aliased Screenshots of current gen games please. Did you make more comparison shots of other games?
Not yet, I just finished implementing it.

Aw man, that's awesome! You can't use it with PC games, though? I wish I had a capture card. :(
Well, I guess it would be theoretically possible to adapt an existing "injector" and apply it using that, it only needs a color buffer to work with. But the performance is ~ 4ms in the worst case for a 720p frame. When you scale that up to 1080p, also taking into account that aliased edges could be longer, you're up above 10ms. That's just not feasible.

On PC, there are always better (in terms of quality for performance) methods available, even brute-force methods such as downscaling (if the game doesn't support any AA) will likely look and perform better.
 

EvB

Member
I'd like to see some footage of Halo Reach passed through this, it's a lovely looking game, but jaggy as 'ell.
 

scitek

Member
On PC, there are always better (in terms of quality for performance) methods available, even brute-force methods such as downscaling (if the game doesn't support any AA) will likely look and perform better.

Gotcha! Well, you may convince me to finally buy that HD capture card I've needed for so long. :p
 

TUROK

Member
This is incredibly ingenious, well done.

Three questions, what constitutes a "somewhat capable PC", which specific capture card do you use, and will any of the three Blackmagic models work?

I noticed on the Halo 3 shots that your technique actually seems to sharpen textures, as opposed to blurring them like FXAA. Why is that?
 
I use your program ALOT, i emailed you about it not sure if you remember. Anyway this is fantastic and i thank you for all your hard work.

Id love PS2 era system compatibility but i understand issues lie with that. Im very happy with it still
 

cyberheater

PS4 PS4 PS4 PS4 PS4 PS4 PS4 PS4 PS4 PS4 PS4 PS4 PS4 PS4 PS4 PS4 PS4 Xbone PS4 PS4
What capture card and GPU would I need to accomplish this sorcery.
 

kruis

Exposing the sinister cartel of retailers who allow companies to pay for advertising space.
I'm seriously impressed.
 

dr_rus

Member
This is really good. If I understood the idea correctly it won't work on any aliasing that isn't a result of a relatively long (straight?) contrast edge? Thus it doesn't filter all the pixel sized high contrast areas and that's the reason why it doesn't blur? A shitload of processing power for the result though. Can it be optimized via using CUDA/OpenCL?

ctrl + f "mafia 2"

Mafia 2 needs this.
You can force all types of AA in Mafia 2 on GeForce.
 

Durante

Member
Antialiasing console exclusive games via PC video capture card.
We do what we must because we can.

Three questions, what constitutes a "somewhat capable PC", which specific capture card do you use, and will any of the three Blackmagic models work?
All three should work, but to the best of my knowledge it has only been tested with the Pro and the Shuttle. I use the Intensity Pro. As to the PC, see below.

I noticed on the Halo 3 shots that your technique actually seems to sharpen textures, as opposed to blurring them like FXAA. Why is that?
That's actually the old technique, which uses basic FXAA and follows it up with a sharpen filter. TPXAA doesn't blur, so it also doesn't need a sharpen step (you can still do it if you want though)

What capture card and GPU would I need to accomplish this sorcery.
It should work with any reasonably fast GPU (GTX460+), but so far it has only been tested on NV. But there's no GPU-specific code in there. As for the capture card, one of these: http://www.blackmagic-design.com/products/intensity/

fxaa has multiple presets, high quality will give similar results as your method
Not really. I've tried all the preset, and if you want edge quality as presented in my screenshots above there's no way to prevent some degree of GUI deformation. FXAA is a single-step solution, it doesn't have any way to understand morphological information about the image to the extent something much heavier like PXAA does. (It's still very good and efficient for what it is mind you)
The preset shown in my comparisons is the highest quality FXAA 3.11 one available.

This is really good. If I understood the idea correctly it won't work on any aliasing that isn't a result of a relatively long (straight?) contrast edge? Thus it doesn't filter all the pixel sized high contrast areas and that's the reason why it doesn't blur? A shitload of processing power for the result though. Can it be optimized via using CUDA/OpenCL?
Yes, it specifically detects aliased edges 3 pixels in size or longer. The original plan was to implement it using OpenCL, but since I found the GL_ARB_shader_image_load_store extension allowing scattered writes OpenCL wouldn't really give an advantage any more.
 

Tashi

343i Lead Esports Producer
Hmmmm. I have a Black Magic card. A good PC. A good GFX card (GTX560 ti) I feel like I should try this. Not a graphics whore though so I don't think I'll appreciate the work you've done.

edit: Appreciate it like I really should.
 
If you don't patent it some fat VC or some start-up will steal your solution, release as their own, make a lot of money and then sue you.

P A T E N T
I T
 

TUROK

Member
Patent it. Now. I know a good software patent lawyer in the LA area if you need a hookup.
He has nothing to gain from this. FXAA and those other post-process AA's are open source, so if he patents it, nobody is going to want to use it since other viable alternatives already exist.
 
Wow, pretty impressive stuff. I have a Blackmagic Intensity Pro and I'd love to try it out, but I recently moved and the component cable for my PS3 isn't long enough to hook it up to the computer anymore. :(

Bookmarking for whenever I find a long enough cable.
 
Awesome. I SO hope devs and Sony, MS and Nintendo are Working hard on finding a cure for jaggies themselves.
Jaggies are immensly unimmersive and they ruin the fine art that insanely talented artists make.

Do tou think you can make this process even more effective?

In the Nier screens the texture detail is nicely preserved, but the jaggies are also slightly more visible than with FXAA (on the right, the stairs)
 

Panajev2001a

GAF's Pleasant Genius
Nine months or so back I made a thread about adding FXAA to all PS360 games by playing via a capture card and running the postprocessing on PC using PtBi.

The main drawback of that method was that applying FXAA "blindly" on the whole image doesn't just anti-alias edges, it also slightly reduces texture clarity and, worst of all, negatively affects the clarity and shape of user interface elements.

Well, I finished work on a new post-processing anti-aliasing method that almost entirely eliminates that problem. A somewhat detailed description can be found here. In short, it uses the crazy power of contemporary GPUs (and a really useful OpenGL 4.2 extension) to search image areas that are (almost) certainly aliasing artifacts, and then selectively applies highest quality FXAA to only those areas. TPXAA is an improved version that takes multiple frames into account.

Some comparison images:

detail1.png

Clearly, the anti-aliasing effect is as good as FXAA. If you pay really close attention to the upper left texture you can also see how it's slightly blurred in the FXAA version.

detail3.png

2D/UI content is not blurred or deformed in any way.

I feel confident in saying that unlike FXAA, TPXAA is almost always purely an improvement, it never degrades any aspect of image quality.

Here are the full res images the first comparison above is cropped from (taken from Nier):
No AA
FXAA
TPXAA

What's the catch?
Well, there are two of them. First of all, to use it on console games, you need the right capturing hardware.
The second is performance. For a 720p frame FXAA takes 1.3ms on my setup -- TPXAA can take 2.8 - 3.6. Still easily enough for 60 captured console frames per second, but not a realistic option in any way for high-res PC games.

If anyone has the right equipment and an AMD card I'd be really happy to hear about any results, this was developed and tested on Nvidia so I'm almost certain that some problems may come up.

Impressive job!
 

Durante

Member
About the whole patenting thing, thanks for the support, but:
- There is prior scientific work that does somewhat similar things (even if implemented entirely differently) since at least the mid-90s -- I know of one Japanese paper in particular, and of course the recent Intel MLAA paper (which doesn't cite the Japanese one - bad science :p)
- Patenting stuff sounds like work, and the kind of work that's not as fun as thinking about pixels for hours
- I don't like the whole idea of software patents

At least by publishing this I prevent others from patenting a concept like this.

Do tou think you can make this process even more effective?
Probably by some percent, it's not really optimized (beyond being implemented with an eye or two on efficiency from a start). But I don't think it could ever be effective enough to be a good alternative if anything other than postprocessing the entire finished color buffer is viable.
 
Probably by some percent, it's not really optimized (beyond being implemented with an eye or two on efficiency from a start). But I don't think it could ever be effective enough to be a good alternative if anything other than postprocessing the entire finished color buffer is viable.

Okay thanx.
 

hirokazu

Member
Wait you came up with this algorithm yourself? That's some genius level shit. You should submit a paper to siggraph or whatever people do.
 

InfiniteNine

Rolling Girl
I remembered this while I was playing Valkyria Chronicles at my study, but it appears that PtBi just immediately crashes on my computer now that I'm home. x: I had really wanted to see what it'd do to VC considering it's abundance of jaggies.
 

anthn

Member
How does it compare to SMAA, quality and performance wise? I figure that would be your main "competitor".
 
Top Bottom