8x OGAA - what's the point?

Discussion in 'General 3D Technology' started by BoddoZerg, Nov 19, 2002.

  1. 3dcgi

    Veteran Subscriber

    Joined:
    Feb 7, 2002
    Messages:
    2,435
    Likes Received:
    263
    Z3's 8-bit slopes are really a form of lossy z compression. It is possible they could result in artifacts, but they likely wouldn't be very noticeable, if at all.
     
  2. SA

    SA
    Newcomer

    Joined:
    Feb 9, 2002
    Messages:
    100
    Likes Received:
    2
    The one byte slopes are lossy in Z3. An error analysis indicates the amount of error is roughly equivalent to the undersampling caused by using 8 samples per pixel.
    The fragment merging can be more problematic, however, depending on the maximum number of fragments and the detailed complexity of the geometry.
    If you really want very high quality AA then reverting to one color - one z per sample when fragments are insufficient is a good solution. Another solution is to increase the number of fragments per pixel and use higher precision slopes.
     
  3. Basic

    Regular

    Joined:
    Feb 8, 2002
    Messages:
    846
    Likes Received:
    13
    Location:
    Linköping, Sweden
    Joe:
    Maybe I was a bit touchy. It's just that now and then there is someone writing something insinuating "if you smart people at this site haven't mentioned this, you might not be so smart at all". Which makes me think "huh, I thought that was implicit in this, this and that discussion".

    But in this case it must have just been me being touchy. Sorry 'bout that.


    Back on topic and to your observation.
    Yes, it is interesting that the pattern SA gave is in the actual measured pattern from a R300. But I would say that it's interesting for a different reason than you said. :)

    When designing the sample pattern, what do you want to optimize?
    First, you'd want it to be good for the angles that has most visible aliasing errors - almost horizontal and vertical edges. To make it good for horizontal edges, you'd distribute the samples evenly in vertical direction. And vice versa for vertical edges.
    This results in positions in a sparse grid. N samples, one on each row, and one on each column in a NxN grid. And this is the optimal case for near vert/horiz edges no matter how your hardware is designed. Even with VSA100 where you can give x/y coordinates for each sample.

    But those rules are of course not enough. Youd'd want it to be good for all other angles too. It can be a bit hard to find a formula for how bad the aliasing in edges in different angles are perceived with different sampling patterns. But a good pattern should have the samples evenly distributed over the pixel area. One way to measure how well distributed the samples are is the minimum distance between subpixels.
    So if you maximize the minimum distance between subsamples, there's a good chance that you'd get a good pattern.

    Doing this optimization results in six different patterns with rotated and mirrored versions, a total of 36 patterns.

    No what I thought was interesting.
    All 36 of them can be found in the sample pattern images you posted above. The "red" and "blue" patterns are two of these 36 patterns. Btw, the pattern SA gave can be found in non-mirrored form, the three lowest blue dots are the three higest in that pattern.


    So the "what's new compared to what we knew about R300" comment were about:
    We already knew a (possible) sample pattern, and it fitted the description "sparse sampled grid". Sample patterns have changed with driver revisions for R200, so they are at least programmable in some sense. I don't remember if I've heard anything about R300, but it's not that far fetched to think they left it. And finaly, even though the sampling pattern fits what SA said, it doen't mean that the implementation is done as he described. (At least in R200 they seemed to have a more flexible method.)

    Ooops, that sounded a lot like "you're wrong, wrong and wrong". Didn't mean it like that. :) Just meant that while your observation was interesting, it didn't reveal new information.
     
  4. SA

    SA
    Newcomer

    Joined:
    Feb 9, 2002
    Messages:
    100
    Likes Received:
    2
    So given the various AA implementation possibilities, my own preference is one that does not sacrifice any quality while maintaining high performance. While this may sound a bit like a paradox, very high quality AA like very high quality pixel shaders is local and typically only needed for a small percentage of the screen area. Nevertheless, it has a global impact on the viewer, just like the shaders.

    Rather than use a lower quality AA over the whole screen, the right choice of methods that I mentioned previously with enough samples in the bit mask, the right patterns, the right fall back, and the right types of filters can provide a means of achieving overall CGI quality AA without sacrificing performance. There is a ways to go yet.
     
  5. arjan de lumens

    Veteran

    Joined:
    Feb 10, 2002
    Messages:
    1,274
    Likes Received:
    50
    Location:
    gjethus, Norway
    A couple of comments/ideas on the Z3 method:
    • The method could conceivably be improved by representing polygon-pixel coverage with polygon edge functions rather than a coverage bitmap sampled at a bunch of grid points. This should give results arbitrarily close to multisampling with an infinite number of sampling points. This method, of course, both produces a storage problem when you need to store multiple edge functions for a polygon, and a new opportunity for compression as edge functions are very similar between adjacent pixels and polygons that share edges.
    • It is possible, although probably uncommon, to get artifacts with interpenetrating polygons even with Z3. Consider two fragments that interpenetrate in a pixel. Presumably, color/texture value is sampled once for each fragment, at the center of the pixel for at least the first fragment. Now, the second fragment can cover the pixel center position, so that the remaining visible part of the first fragment has a color sampled outside its visible part. This effect could produce visible jaggies if the intersection line between the interpenetrating polygons hits a sharp enough color transition in one of the polygons' textures. One partial solution to this problem would be to store RGBA color slopes in addition to just Z slopes, but this gets expensive quickly.
    No AA method is perfect, unless you have the needed resources to actually take the integral of "appropriate" color across the pixel (with, say, a sinc filter; ultra-expensive)
     
  6. SA

    SA
    Newcomer

    Joined:
    Feb 9, 2002
    Messages:
    100
    Likes Received:
    2
    The problem you describe is a problem with multi-sampling in general. Under the majority of conditions the combination of high quality multi-sampling with high quality anisotropic-mipmap filtering is adequate since the texture samples cover most of the pixel. There is still a potential problem, however. The filtering might average an intense color for one fragment that should be hidden by another fragment, however the pixel will still display as intense. Supersampling the colors does not have this problem.

    It is possible to supersample the colors using an adaptation of Z3 or similar coverage mask AA method. It is rarely worth the performance tradeoff at this point. Using a high quality pattern, more samples in the bit mask, a better shaped filter, a high quality fall back, etc. are areas that still need the most focus.
     
  7. Bigus Dickus

    Regular

    Joined:
    Feb 26, 2002
    Messages:
    943
    Likes Received:
    16
    Out of curisoty, what method do off-line rendering programs use? Supersampling?
     
  8. Laa-Yosh

    Laa-Yosh I can has custom title?
    Legend Subscriber

    Joined:
    Feb 12, 2002
    Messages:
    9,568
    Likes Received:
    1,452
    Location:
    Budapest, Hungary
    Waries wildly between renderers... Some can sample geometry and shaders seperately (like 3ds max), some sample them together (like Mental Ray). Sample positions also wary between ordered grid and jittered samples, star patterns, etc. Then you can add in raytracing, GI, photon maps and so on...
    Most AA algorythms are also adaptive and can increase sampling rates (and can sometimes undersample as well). Heavy use of LOD with 4-5 or even more levels and mip-mapping also helps to reduce high frequency details. Tolerance level for the final image quality is pretty low though, even a small amount of noise, crawling or such is usually unacceptable - so you usually end up with upping the sampling rate higher and higher... :)
     
  9. SA

    SA
    Newcomer

    Joined:
    Feb 9, 2002
    Messages:
    100
    Likes Received:
    2
    Multi-sampling with anisotropic filtering is a performance optimization that will continue to grow in importance as pixel shaders come into more general use. Chips are just getting to the point where they can perform some very interesting pixel shader effects at acceptable frame rates for one set of calculations per pixel. It is simply impractical at this point to run pixel shaders for each of 8 or 16 samples per pixel for supersampled AA at every pixel, especially for the small improvement.

    In the future, it is likely that developers will apply supersampling to selective areas under control of the shader. This is especially true of shaders that actually generate the local image such as procedural textures and selective ray tracing.
     
  10. Colourless

    Colourless Monochrome wench
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,274
    Likes Received:
    30
    Location:
    Somewhere in outback South Australia
    SA's 8x Sparse sample pattern produces some really nice looking FSAA.

    I made a small program that would allow me to easily set the samples positions for my V5 6000, and I entered in SA's samples. There was a very noticable improvement over the default Rotated Grid sample pattern that is normally used. Trying to put a number to the amount of difference, the Sparse pattern was probaly 2x as good as the Rotated Grid that was used

    Here is what the default 8x Sample Pattern set by 3dfx in Glide and OpenGL: http://www.users.on.net/triforce/glide8xpos.png Even just looking it, you can tell it's not a very good pattern. There are a number of cols and rows with 2 samples, and a few with none at all.

    Oddly enough, the default 8x Sample Pattern in Direct3D is actually different. Here it is http://www.users.on.net/triforce/d3d8xpos.png It is actually a much better pattern, and produces really nice results. However, it's got some nasty critical angle problems.
     
  11. Althornin

    Althornin Senior Lurker
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,326
    Likes Received:
    5
    Colourless - could you be so kind as to take some comparative screenshots of what those modes look like?
     
  12. jb

    jb
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,636
    Likes Received:
    7
    Dam you v5 6000 owners :)

    Yea thanks for the info Colourless and I am sure a lot of people would like to see any FSAA before/after images you can get with that pattern.
     
  13. Colourless

    Colourless Monochrome wench
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,274
    Likes Received:
    30
    Location:
    Somewhere in outback South Australia
    Sure I'd make some screenshots. My limitation is I can only get them from OpenGL (and Glide) apps. Screenshots from D3D programs do not work. Also, I don't exactly have many apps OpenGL/Glide that I can run.

    I 'would' run Basic's apps, but they are useless for a V5 since FSAA only works in Fullscreen.
     
  14. Althornin

    Althornin Senior Lurker
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,326
    Likes Received:
    5
    Thats fine, i'd just like to be able to look at some side by side shots and KNOW that the ONLY difference between them IQ wise is because of different sample positions. That would let me see how much of an impact various sample positions make. Plus, it would be cool and interesting :)
     
  15. Basic

    Regular

    Joined:
    Feb 8, 2002
    Messages:
    846
    Likes Received:
    13
    Location:
    Linköping, Sweden
    Hrmpfff... :evil:
    :D

    They are useless in another way too.
    I don't think anyone doubt that you can put the subsamples in the positions you say. And that's exactly what the program shows. What would be interesting is a normal in-game scene, to convert the theory into a practical example.

    But isn't it ironic that the reason I came up with the idea for that program was some intensive discussions about the sampling positions of a V5? :D I didn't write the pogram until long time after those discussions had faded though.
     
  16. Colourless

    Colourless Monochrome wench
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,274
    Likes Received:
    30
    Location:
    Somewhere in outback South Australia
    Althornin (and others):

    Here are 2 initial screenshots from Quake 3. They show some minor differences in the step (mostly noticable if you zoom in). Q3 of course is a shocking game to use to tell the difference with 'high quality' FSAA since it doesn't have high enough detail in the world and does have high enough contrast.

    Anyway here they are:
    http://www.users.on.net/triforce/fsaa/default.jpg
    http://www.users.on.net/triforce/fsaa/sparse.jpg

    I'll probably re-install DeusEx and see if I can find some parts of the game with particularily horrid aliasing.

    Basic:

    Way to go making my quote now look out of context (by only quoting part of it) :)
     
  17. Althornin

    Althornin Senior Lurker
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,326
    Likes Received:
    5
    Thanks, Colourless. Thats a decent difference. Man, that 8x image (sparse) looks very clean! bet it looks great in motion.
     
  18. SA

    SA
    Newcomer

    Joined:
    Feb 9, 2002
    Messages:
    100
    Likes Received:
    2
    Here is an example of a 16x sparsely sampled pattern.


    ------------------------------------------------x------------
    ----------------x--------------------------------------------
    --------------------------------x----------------------------
    x------------------------------------------------------------
    --------------------------------------------------------x----
    ------------------------x------------------------------------
    ----------------------------------------x--------------------
    --------x----------------------------------------------------
    ----------------------------------------------------x--------
    --------------------x----------------------------------------
    ------------------------------------x------------------------
    ----x--------------------------------------------------------
    ------------------------------------------------------------x
    ----------------------------x--------------------------------
    --------------------------------------------x----------------
    ------------x------------------------------------------------
     
  19. 3dcgi

    Veteran Subscriber

    Joined:
    Feb 7, 2002
    Messages:
    2,435
    Likes Received:
    263
    Since we're giving out patterns here how about this one for 8x. I believe it will be slightly better than SA's pattern for short edges that are nearly horizontal or vertical, but it might be a little worse for steep angles. The pattern looks more ordered, but I've never really bought into the random is good idea for AA.

    -------------------x---------
    ------------x----------------
    -x---------------------------
    -----------------------x-----
    -----x-----------------------
    ---------------------------x-
    ----------------x------------
    ---------x-------------------

    Although once a decent sparse pattern is choosen refining it more might be picking at straws.
     
  20. arjan de lumens

    Veteran

    Joined:
    Feb 10, 2002
    Messages:
    1,274
    Likes Received:
    50
    Location:
    gjethus, Norway
    That pattern looks like a 9x rotated grid pattern with the center sample missing and the other samples slightly skewed, and will presumably have noticeable worst-case behaviour when polygon edges are at same angles as the grid - unlike SA's grids, which seem to not have any particular class of worst-case behavior at all. And SA's grids, at least for 8x and 16x, look decidedly non-random to me at least.
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...