Skip to main content
Inspiring
March 4, 2017
Question

FXAA

  • March 4, 2017
  • 1 reply
  • 3239 views

Hi. I've drawn a curved line but it's very jagged and don't know how to smooth it. Does anyone know if it's possible to implement FXAA or a similar method?

I've considered drawing my line at a much higher res and then downscaling, but I think FXAA would be more efficient. Thanks!

This topic has been closed for replies.

1 reply

françois leroy
Inspiring
March 5, 2017

Hi James!

'Super sampling' (writing at higher scale then reducing) gives good results, but you'll have to handle large EffectWorlds.

It used to be a bummer, but nowadays, machines can deal with it, so it can be an easy way to go.

I don't know of any built in function for FXAA. I'm using OpenGL, so I just added a FXAA shader...

But you could adapt it to an iteration function pretty easily. You'll have to try to be sure, but I think Super Sampling can be faster than iteration.

Otherwise, if you're only drawing lines, the easiest is to draw antialiased lines directly!

You can check this link https://en.wikipedia.org/wiki/Xiaolin_Wu

Hope it helps!

François

Inspiring
March 6, 2017

Thanks for the info Francois. Super noob question, can AMD cards run FXAA? I believe it was developed by an Nvidia employee so it wouldn't surprise me if they kept it to themselves.

I did see that link, would be good but I'm doing curved lines .

françois leroy
Inspiring
March 6, 2017

Well, any card can run it, as long as you write your own shader. Cos' it doesn't rely on any specific function, it is very basic Glsl.

I use a slightly modified version of this one: (Tested) Fast Approximate Anti-Aliasing (FXAA) Demo (GLSL) – Page 3 – Geeks3D

You can start from there if you want to implement it for an AE iteration function.

Now about curves: curves can be seen as straight segments put together! So you can split your curves in pieces and write them already antialiased. :-)

Cheers,

François