Timmy Posted September 11, 2015 Share Posted September 11, 2015 (edited) Hi Guys,Here is an implementation of SMAA from here: http://www.iryoku.com/smaa/Source Code: https://github.com/rextimmy/Torque3D/tree/SMAAIf 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.ResultsSorry 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:http://i.imgur.com/HPZctVL.pngFXAA:http://i.imgur.com/9nVDmAJ.pngSMAA:http://i.imgur.com/AdBIWi2.pngPerformance: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. Edited September 11, 2015 by Timmy Quote Link to comment Share on other sites More sharing options...
Timmy Posted September 11, 2015 Author Share Posted September 11, 2015 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 Quote Link to comment Share on other sites More sharing options...
andrewmac Posted September 11, 2015 Share Posted September 11, 2015 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. Quote Link to comment Share on other sites More sharing options...
JeffR Posted September 11, 2015 Share Posted September 11, 2015 Most excellent!I'll have to give this a whirl later.@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? Quote Link to comment Share on other sites More sharing options...
Timmy Posted September 11, 2015 Author Share Posted September 11, 2015 Even after he modified it add GLSL support, I'm not entirely convinced it works Gotta say i agree ;) Quote Link to comment Share on other sites More sharing options...
andrewmac Posted September 11, 2015 Share Posted September 11, 2015 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 Quote Link to comment Share on other sites More sharing options...
JeffR Posted September 11, 2015 Share Posted September 11, 2015 Hm, DLAA seems to be surprisingly uncommon. Saw a video comparing it to MLAA and it looks to be a pretty good technique. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.