Jump to content

  • Log In with Google      Sign In   
  • Create Account

FXAA, why not use Depth


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
10 replies to this topic

#1 dpadam450   Members   -  Reputation: 949

Like
0Likes
Like

Posted 25 July 2012 - 03:14 PM

I have not implemented FXAA yet due to not needing to. But I find it odd that they are trying to find edges by luminance instead of depth. Depth will give you an exact edge. From the Nvidia demo paper it shows a mostly non-contrasted image. I saw another nvidia youtube video showing real games using it but it doesn't show the edge detection that it picks up from the algorithm. I'm worried about high contrast textures getting blurred as a result of fxaa. So why not use depth (linearized before had or in pixel shader)? Is there a downside that I'm missing?

Edited by dpadam450, 25 July 2012 - 03:14 PM.


Sponsor:

#2 Rattenhirn   Crossbones+   -  Reputation: 1816

Like
4Likes
Like

Posted 25 July 2012 - 03:37 PM

There are AA alorithms out there that use depth. But the big seller for FXAA is, that it only needs the backbuffer as input and does everything in one fairly simple pass. It's simple to integrate and fast to boot.

It can also smoothe edges with no depth information, for example reflections or refractions, as well as edges created by post processing.

In my experience, purely image based algorithms don't get signigicantly better than that.

#3 Ashaman73   Crossbones+   -  Reputation: 8005

Like
1Likes
Like

Posted 25 July 2012 - 11:23 PM

Depth will give you an exact edge

This is not always the case. I.e. I render lot of things which don't update the depth buffer (particles, effects, outlines etc.), in this case a depth depending AA would introduce some very ugly artifacts. A pure image based algorithm has the advantage of being usable for almost every rendering technique around, even if it has the disadvantage of smoothing out wanted contrasts. But to be honest, if you have textures with very high contrasts, you will have some other artifacts without AA applied to the texture itself, i.e. flickering when moving.

#4 MJP   Moderators   -  Reputation: 11790

Like
1Likes
Like

Posted 26 July 2012 - 01:13 AM

Depth alone also isn't enough to detect discontinuities in normals or other material parameters at triangle edges.

#5 dragon.R   Members   -  Reputation: 247

Like
0Likes
Like

Posted 30 July 2012 - 02:31 AM

In my project I detect the edge using depth first, then use the stencil buffer to do FXAA only on the edge,just like in MLAA. Doing this increased the efficiency,and it also avoid FXAA to blur sharp pixels.

#6 B_old   Members   -  Reputation: 668

Like
0Likes
Like

Posted 30 July 2012 - 02:40 AM

In my project I detect the edge using depth first, then use the stencil buffer to do FXAA only on the edge,just like in MLAA. Doing this increased the efficiency,and it also avoid FXAA to blur sharp pixels.

How do you get the edge information into the stencil buffer?

#7 dragon.R   Members   -  Reputation: 247

Like
0Likes
Like

Posted 30 July 2012 - 02:49 AM


In my project I detect the edge using depth first, then use the stencil buffer to do FXAA only on the edge,just like in MLAA. Doing this increased the efficiency,and it also avoid FXAA to blur sharp pixels.

How do you get the edge information into the stencil buffer?


I just detect and render the edge in the first pass,open the stencil writting.So I can clip pixels using stencil test in the FXAA pass.

#8 Hodgman   Moderators   -  Reputation: 31968

Like
0Likes
Like

Posted 30 July 2012 - 09:52 PM

I'm worried about high contrast textures getting blurred as a result of fxaa.

Yes, high-contrast textures that produce aliasing will be anti-aliased. You'll have to tune/judge the algorithm on your scene to see if it's acceptable. It doesn't take long to integrate :)

So why not use depth?

Because that wasn't Mr Lottes' design goal -- making an luminosity-based edge filter was.
Also, geometrical-edge aliasing isn't the only cause of aliasing (as mentioned above), for me, the softening of shader-aliasing was very useful.

#9 B_old   Members   -  Reputation: 668

Like
0Likes
Like

Posted 31 July 2012 - 03:19 AM

I just detect and render the edge in the first pass[...].

Any more info on that part?

#10 dragon.R   Members   -  Reputation: 247

Like
0Likes
Like

Posted 31 July 2012 - 09:32 PM

Any more info on that part?


It`s same to the first pass of MLAA,which was introduced in the <GPU PRO2>.Render a screen quad and sample the depth to find edge,discard other pixels.

#11 B_old   Members   -  Reputation: 668

Like
0Likes
Like

Posted 01 August 2012 - 06:30 AM


Any more info on that part?


It`s same to the first pass of MLAA,which was introduced in the <GPU PRO2>.Render a screen quad and sample the depth to find edge,discard other pixels.

OK, thanks!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS