6 ms·
Aliasing and you
- ricardobeat 15y agoAmazing. I always thought that something better than super-sampling had to exist. I hope this becomes standard on PS3 titles, it's painful seeing all those ragged edges on screen, knowing you have a few gigaflops of processing power sitting there, doing nothing :(
- maximilianburke 15y agoA number of PS3 titles use a technique called morphological anti-aliasing (MLAA) which is more computationally expensive than FXAA but can look better (to art directors and rendering engineers anyways :)) and, because it runs well on the SPUs, it is able to offload the GPU for it to begin on its batch of work.
- luchak 15y agoI thought it was a little odd that he says the proper way to solve the problem is to have a higher-res screen, just before he says that we can't do super-sampling because it's too expensive.
- ConstantineXVI 15y agoHigh-res screen: expensive[money] Super-sampling: expensive[cpu]
- daeken 15y agoA high-res screen isn't just expensive money-wise -- at the resolutions you need to avoid AA techniques, you're rendering at the same resolution you'd be rendering at for AA techniques. So it's more expensive in terms of money and in CPU/GPU time.
- baddox 15y agoBut wouldn't normal sampling on a high-res screen be just as expensive[cpu] as super-sampling on a normal-res screen?
- daeken 15y agoFXAA is neat, but the idea of using pixel-based edge detection on games is, IMO, a bit silly. Why not use detect edges on the depth buffer? You'll much more easily see the contrast and you will be far, far less likely to blur your textures. I might have to whip up a quick WebGL demo of this.
- hormis 15y agoFXAA and other similar techniques are only relevant when dealing with deferred rendering only. Detecting edges on the depth buffer may sound as the solution until you realize that two planes at right angles has an edge between that can alias. The change there is in the normal and not the Z. Also modern graphics cards do not give programmatic access to the z-buffer as the z-buffer format is often proprietary. Deferred shading based renderers often duplicate the z-value also into a texture. Deferred rendering can render large number of dynamic, unshadowed lights very efficiently. It can be used as approximate global illumination technique.
- daeken 15y ago> FXAA and other similar techniques are only relevant when dealing with deferred rendering only. Why is that? While techniques like FXAA are needed for deferred rendering due to the order of operations, I don't see why FXAA isn't acceptable on non-deferred renderers. > Detecting edges on the depth buffer may sound as the solution until you realize that two planes at right angles has an edge between that can alias. The change there is in the normal and not the Z. If you have two planes at a right angle to each other, you'd see that in the depth buffer. Imagine you're looking at a line of pixels and you're doing this on each pixel -- you'd look to see if the pixels on either side of the one you're on are trending in opposite directions from the current one, and know it's an edge. > Also modern graphics cards do not give programmatic access to the z-buffer as the z-buffer format is often proprietary. As far as I'm aware, all modern graphics cards allow you to render the depth buffer to texture just like the color buffer. > Deferred rendering can render large number of dynamic, unshadowed lights very efficiently. It can be used as approximate global illumination technique. Sure, but there's no reason you can't do post-AA using the RTT depth buffer and your composited color buffer.
- dazbradbury 15y agoSMAA is even better and faster than FXAA. http://www.iryoku.com/smaa/ http://www.iryoku.com/smaa/ Also there is software that automatically injects SMAA into your d3d9, d3d10 or d3d11 games: http://mrhaandi.blogspot.com/p/injectsmaa.html http://mrhaandi.blogspot.com/p/injectsmaa.html Pulled directly from codinghorror comments, posted by: Mārtiņš Možeiko
- rsanchez1 15y agoI was hoping someone else would say that. Have you really tried SMAA? What is your opinion of it on a few games?
- DannoHung 15y agoAm I like the only person in the world who hasn't been able to see jaggies in like.. 6 years?
- jaylevitt 15y agoInteresting... in audio, we've basically had affordable super-sampling for a few years. That's exactly what "record at 96KHz or 192KHz" is; all your plugins run against a waveform that's higher-bandwidth than you can hear, and then you downsample and dither at the end to 44.1 or 48KHz in mastering. Some of the best equalizer plugins had internal upsampling, so that even if your source material was 48KHz, the processing was all done at 96KHz. The quality gain from the higher resolution offset the quality loss from resampling. (In audio, there are other benefits to higher resolution, like latency; a 256-sample buffer adds 6ms at 44.1KHz, but only 1ms at 192KHz.)
- daeken 15y ago> (In audio, there are other benefits to higher resolution, like latency; a 256-sample buffer adds 6ms at 44.1KHz, but only 1ms at 192KHz.) But the buffer is there to allow you to gather data up before sending it across the pipe (physical or virtual) so you're not incurring latency you don't need to. Increasing the resolution of your data doesn't decrease latency, as you're just incurring that hit more frequently. If that worked, you could just do away with the buffer and send a continuous stream of data at whatever sampling rate you wanted.
- jaylevitt 15y agoI'm thinking of setups which often have some absolute minimum buffer size, maybe due more to the protocol (e.g. ASIO) than the converter design; my RME Digiface setup can't work below 56 samples, no matter what the sample rate.
- klodolph 15y agoDon't forget that the air between you and the speakers is another buffer, holding about 150 samples at 44.1 kHz, assuming near field monitors.
- jaylevitt 15y agoYep, which is why it's so amazing that bands play to a beat that doesn't really exist - it's an agreed-upon moment in time that we pretend is the same for all of us, but when you're standing 20 or 30 feet apart, it isn't. But latency is critical for tracking through headphones, especially singers; a little bit of latency can screw up your pitch perception as well as your timing.
- burgerbrain 15y agoI guess I'm probably the only person in the world that prefers the look of no-AA...
- rottencupcakes 15y agoNo, you're not alone. I've never liked the strange colored edge effects you get from normal AA. They're as annoying as jaggies. As an aside, the FXAA touted in this blog post looks washed out and generally terrible.
- zyb09 15y agoMost of the time, you loose the "crispness" of the final image with AA and everything tends to look a little bit blurry. Couple that with fact, that it drops the FPS by quite a bit and over time I got slowly conditioned against AA. However in some games it looks very good. WoW for example has a much better image quality with AA. Of course it also runs with 60 FPS pretty much everywhere.
- lmkg 15y agoAs the author mentions, non-AA looks worse in motion. I could take it or leave it for static images, but when the location of an aliased boundary is moving, it tends to flicker as pixels around the edge make discrete jumps across the boundary. It addition to looking bad, I also find the extra activity distracting.
- jQueryIsAwesome 15y agoIf you are going to analyze all pixels on the screen, it would be better to use some kind of median filter[1]. It looks smoother and more focused: http://i.imgur.com/hsq84.jpg http://i.imgur.com/hsq84.jpg [1]http://en.wikipedia.org/wiki/Median_filter http://en.wikipedia.org/wiki/Median_filter
- alextgordon 15y agoNo wonder it looks smoother. The pixels are half the size!
- malkia 15y agoMedian filter has to sort pixels (3x3, or 5x5) and get the median (this is by memory, haven't looked at wikipedia). As such it might be or might not be better solution. Also it can't be done in-place (or can it?)
- regularfry 15y agoYou could do it in-place with a memory cost of one pixel row (for 3x3, or two for 5x5) plus one (or 2) pixels. That might make be worthwhile depending on where you're actually doing it. It might be more efficient - it's worth implementing both to see.
- ck2 15y agoThat was a good primer for a non-gamer like me. Can it be used to make flash graphics and webgl lower load too?
- exDM69 15y agoI don't know about Flash, but I'd say this is a bit unlikely. You need special shader programs for custom antialiasing tricks like FXAA. For WebGL, you should be able to write the shaders and a multi-pass renderer framework that does the antialiasing. However, with WebGL, you're constrained to using somewhat simpler texture formats than you have available with a modern desktop. If you have to use 8 bit RGBA textures, you will probably suffer from color banding and other nasty artifacts compared to 16 bit floating point textures that are normally used on the desktop.
- john2x 15y agoHuh, I've always thought that that was how anti-aliasing in games worked; take the entire scene and smooth it, Photoshop filter style. TIL.