Better fake AA for deferred lighting

I adapted NFAA(Normal Filter Antialiasing) for Unity 3.0.
I think it looks better than the included Edge Blur,which always ends up losing all the sharpness in the edges.
Compare the edges of the guns in the attached screen,to see how it smoothes out aliasing.(Left side is NFAA,right has no smoothing)

Unity 3.3 version available here: http://dl.dropbox.com/u/10887020/NFAA/NFAA.unitypackage

Hmm… that does look better! How big a performance hit is there?

I didn’t register much of an effect on performance,but it probably takes about as much as default edge blur,possibly a little less as it has only one iteration.

I do subpixel offsets in the shader and it seems they are sometimes clamped to zero in Unity editor when window is not maximized.
So try it maximized or published,if it doesn’t seem to work in Editor window.

Another comparison with no antialiasing,it actually emulates forward rendering antialiasing pretty well:smile:
One thing it cannot do though, is invent detail where there is none, so e.g. thin wires in the distance won’t look as good as with MSAA.

Wow dude, this is pretty epic.

Outstanding work. I’ll give it a try at work tomorrow.

Multivac that works great!!

I am using also color correction and when the CC filter is above the nfaa filter in the script stack the nfaa doesn’t work …
If I put the cc filter after the nfaa filter it works.

Is it based on this? : http://www.gamedev.net/community/forums/topic.asp?topic_id=580517

I was hoping someone would port that, you have my thanks.

yeah,its the same approach,I made some improvements though,I should probably post them in that thread.
the version posted in the thread doesn’t really give good results,but with some better sampling patterns and subpixel offsets it works really well.

:frowning: Doesn´t seem to work with me. I only get a blue screen. Deactivating the Debug mode seems to turn the effect off(?), because I can´t see any difference. What exactly do you mean by “play around with the effect´s position in the stack” ?

Fog, remove all other post effects from the Camera to see if it works or not.

It does indeed seem that it doesn’t like having the CC fillter above it or example.

Thanks, but I´m still having problems with the filter script. I´ve removed all ther effects from the camera, but if I look at the scene in “game-mode” I just see a blue screen.

If I compile the game and run it as “standalone” I can see the blue normal map, but that´s all.

My rig:

Windows 7 Pro, 64 bit
ATI Radeon 4800 Series

@fogGobbler: uncheck the “debug” checkbox from the script dialog.

Yeah, if I turn the debugmode off, I can see the image, but I don´t see any kind of “antialias”-effect. It looks exactly like the version without the effect.

Have you build the application?
It doesn’t work pressing the play button. You have to build.

Thanks for your help, I finally got it working and it looks great :slight_smile: .

Well, I got it running in my scene, but when I try it in the bootcamp project all I get is just a black screen. I´ve deactivated all other effects on the soldier cam and built the project.

Anybody else having problems?

The screen in bootcamp demo is black until you press escape,have you tried that? :wink:

thanks :slight_smile: never thought of that…

So this is kind of a substitue for anti alising… So should we be setting the game to 4x AA and then using this or does it even matter if we use 16x, it would look really crisp on the edges.