SMAA

Materials, textures, lighting, postfx
7 posts Page 1 of 1
Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Fri Sep 11, 2015 3:07 pm
Hi Guys,

Here is an implementation of SMAA from here: http://www.iryoku.com/smaa/

Source Code: https://github.com/rextimmy/Torque3D/tree/SMAA

If someone wants to take this further and produce an official pull request, please go ahead but do note........

There are a few problems:

1) There is a problem with OpenGL. It works perfectly on Direct3D 9 and even our own experimental Direct3D 11. With OpenGL something goes wrong in the second pass(blend weights). I'm not sure if it doesn't like the texture format or it's something else? i'm just not sure. We don't use OpenGL so i didn't bother tracking it down any further.

2) This really needs to be implemented with some sort of options menu that handles the different quality levels or even the different AA options (i.e FXAA). In DM we have done this but that code won't be compatible with T3D, so i have trimmed this implementation down to suit. I tried to comment where i could in the source files about this.

Any questions just ask and i'll try and point you in the right direction.

Results

Sorry i only had time to do one round of screenshots here. Biggest difference you will notice between SMAA/FXAA is the vegetation in these screenshots.

No AA:
Image

FXAA:

Image

SMAA:

Image

Performance:

SMAA is definitely more expensive than FXAA. What i have found though (from testing on a few different GPU/CPU combos), the difference can be negligible if you have a recent rig. T3D is so CPU bound for any mid->high GPU/CPU combo, that the GPU spends more time idling than it does actually working I.E this extra work SMAA makes it do, makes no difference to frame rate for those set-ups.
Last edited by Timmy on Fri Sep 11, 2015 3:27 pm, edited 2 times in total.
Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Fri Sep 11, 2015 3:14 pm
Visually debugging the 3 passes is very simple, just comment out the pass below what you want to debug, than make sure the target in the postfx is set to $backbuffer
andrewmac
Posts: 295
Joined: Tue Feb 03, 2015 9:45 pm
 
by andrewmac » Fri Sep 11, 2015 4:07 pm
I've seen a few implementations in Unity that claim to have it working in OpenGL, but I haven't seen anyone actually get the original posted smaa.hlsl file on github to work with OpenGL. Even after he modified it add GLSL support, I'm not entirely convinced it works.

I hit the exact same issue you did implementing it in Torque 6. I've also found 3 or 4 forum posts around the internet where people hit the same wall myself and you have hit; the blend weight pass just doesn't come out right in GLSL and the final pass falls apart because of it.
JeffR
Steering Committee
Steering Committee
Posts: 764
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Fri Sep 11, 2015 4:09 pm
Most excellent!

I'll have to give this a whirl later.

@
User avatar
andrewmac
Well, I guess if nothing else, at least it's a consistent issue?

Is there any AA technique that's close-ish to SMAA that definitely works on OpenGL?
Timmy
Posts: 308
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Fri Sep 11, 2015 4:13 pm
andrewmac wrote: Even after he modified it add GLSL support, I'm not entirely convinced it works


Gotta say i agree ;)
andrewmac
Posts: 295
Joined: Tue Feb 03, 2015 9:45 pm
 
by andrewmac » Fri Sep 11, 2015 5:20 pm
JeffR wrote:Is there any AA technique that's close-ish to SMAA that definitely works on OpenGL?


I'm quite happy with DLAA. It's simple enough to implement, produces good quality and it's quite fast. That said, I never actually got SMAA working so my opinion is a little biased. Also never had the ability to do a side by side comparison for quality differences either so take the suggestion with a grain of salt :P
JeffR
Steering Committee
Steering Committee
Posts: 764
Joined: Tue Feb 03, 2015 9:49 pm
 
by JeffR » Fri Sep 11, 2015 5:54 pm
Hm, DLAA seems to be surprisingly uncommon. Saw a video comparing it to MLAA and it looks to be a pretty good technique.
7 posts Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest