Can you explain Multisampling?

Discussion in 'General 3D Technology' started by king_iron_fist, Dec 2, 2002.

  1. RoOoBo

    Regular

    Joined:
    Jun 12, 2002
    Messages:
    308
    Likes Received:
    31
    Supersampling doesn't solve the problem Anisotropic is addressed to solve, the problem when the area of the pixel projected over the texture isn't a 'circle' but some kind of deformed ellipsis. It just provides more filtering (say 4X Trlinear) for textures. The filtering is still isotropic filtering ('circle based filtering').
     
  2. andypski

    Regular

    Joined:
    May 20, 2002
    Messages:
    584
    Likes Received:
    28
    Location:
    Santa Clara
    When performing supersampling the extra texture samples will be taken at different sample points in screen space - if you project the resulting sample footprint for the final combined sample back into texture space the resulting filter is no longer necessarily circular - the shape changes depending on the projection of the texture into screen space.

    Therefore it is no longer isotropic.

    In fact, the filtering you get from supersampling in screen space is superior to simply applying anisotropic filtering in texture space since it is not the texture values that are being filtered but the results of the shading calculation over the sampled positions.

    As an example, currently filtering of bump maps produces incorrect results because hardware filters are designed for colour values, not normals. If you linearly filter between normals the results become denormalised and as a result inaccuracies are introduced in subsequent shading calculations.

    However, if you point sample the bump map while supersampling in screen space then the resulting filter will produce the correct values.
     
  3. moichi

    Newcomer

    Joined:
    Jul 22, 2002
    Messages:
    36
    Likes Received:
    0
    Location:
    Japan
    At NVIDIA's MSAA:

    Z-values of every sub-sample points are same.

    Is this true?
     
  4. Tagrineth

    Tagrineth SNAKES... ON A PLANE
    Veteran

    Joined:
    Feb 14, 2002
    Messages:
    2,512
    Likes Received:
    9
    Location:
    Sunny (boring) Florida
    Thanks. If I'd said it I would've sounded like an idiot :lol:

    Well, yeah, sparse sampling will do that.

    But as mentioned, 3dfx also jittered the subsamples slightly to eliminate patterns. The human eye picks up on patterns VERY VERY quickly and gets sick of them almost immediately, thus losing the effect somewhat... that's why all the 3dfx fans have always said, see 3dfx's FSAA in action[/i] then judge for yourself. I've seen both and granted the edge quality is brilliant in ATi's 6x but I still like 3dfx's 4x most (it's wrong to call it 2x2... it's a sparse grid).
     
  5. Ailuros

    Ailuros Epsilon plus three
    Legend Subscriber

    Joined:
    Feb 7, 2002
    Messages:
    9,420
    Likes Received:
    179
    Location:
    Chania
    I said equivalent as in output.
     
  6. Ailuros

    Ailuros Epsilon plus three
    Legend Subscriber

    Joined:
    Feb 7, 2002
    Messages:
    9,420
    Likes Received:
    179
    Location:
    Chania


    I can hear 3dfx trumpeting the superiority of T-Buffer AA, even if there appears a 10x times better sollution in every aspect in the future. What exactly makes you think that I haven't experienced both yet anyway?

    I still prefer ATI's sparsely sampled 6x sollution for more than one reasons. One of them would be performance in ultra-high resolutions and with 32bpp colour depth if you don't mind.
     
  7. king_iron_fist

    Newcomer

    Joined:
    Feb 6, 2002
    Messages:
    58
    Likes Received:
    0
    Cheers guys, you've been really helpful so far. :D

    I'm still not 100% on all of it though..... :eek:

    Right, random thoughts/questions :
    The difference between rotated/ordered grids is its designed to improve AA on near horizontal and vertical edges. However surely this comes at the expense of reducing AA quality on diagonal edges?

    From what I currently understand Multisampling "picks up" pixels on edges and then samples adjacent or semi adjacent pixels and blends the colour value. How does it recognise edge pixels though, is it through Z checks?

    Surely the Gpu has to do *some* work to do multisampling as it has to retrieve and blend a massive amount of pixel values, the performance hit can't just be bandwidth related.... Or is this where dedicated AA hardware comes in?

    In very crude terms it seems that multisampling has a very similar effect as to what would happen in photoshop if you manually went over all edge pixels with a blur tool......?

    One scenario I can't get my head around is if you have a polygon which is only one pixel thick i.e. an aerial. If you take samples of the surrounding pixels then it won't show up on any of them and it will only register on the existing pixel - therefore the aerial will barely exist. Surely it would get fainter the more samples you take and at 16xAA it would barely register.

    Sorry to keep on asking dumb questions by the way, I just really want to make sure I've properly understood it :wink:
     
  8. Tagrineth

    Tagrineth SNAKES... ON A PLANE
    Veteran

    Joined:
    Feb 14, 2002
    Messages:
    2,512
    Likes Received:
    9
    Location:
    Sunny (boring) Florida
    Yeah, this is true. But it's sort of like anisotropic filtering, it just isn't really needed everywhere on the screen at once. Aliasing isn't really as visible on diagonals as near horizontals and verticals. Try it yourself.

    Precisely.

    Yep! GeForce3 and 4 have no less than four Z-test units per pixel pipeline (rather than the standard one on any older core), so the computation for 4x MSAA is for all intents and purposes, free. Sorta like bilinear and trilinear filtering - at this point the TCU's can fetch the texels and blend 'em just fine :) But there's still a slight perf. difference... due to bandwidth.

    Similar, but not really. In photoshop you'll get a solid, 50/50 blend on all edges; however MSAA uses weighted averages to blend the lines. So say you have a diagonal line that, in 4x AA, has three samples per pixel on one side of the line, and the remaining one is on the other side. The video core will give a 3/4 weight to the first side with three samples.

    In PS the weight will be 1:1 no matter what.

    Actually you have it backwards. If all the sample points miss, more samples won't result in a fainter picture - zero samples on the aerial means 0% aerial colour. However, having more and more sample points vastly improves the odds that at least one point will hit the aerial, and having more and more points means more samples will be on the aerial.

    3dfx demonstrated this very well with some of their early AA demos, for example the biplane one - there was a lot of pixel flicker on the beams between the wings on the no-AA side, but on the antialiased side the beams were always visible... because at a given time, at least one sample point was always on-target.

    It's no problem at all! The only truly stupid question is the one that goes un-asked.

    That isn't to say there are no such things as stupid questions, of course... :lol:
     
  9. king_iron_fist

    Newcomer

    Joined:
    Feb 6, 2002
    Messages:
    58
    Likes Received:
    0
    Hey cheers for that :D

    last question (I think) so when blending the sub pixel values for a given pixel is the value of the original pixel included or not?
     
  10. king_iron_fist

    Newcomer

    Joined:
    Feb 6, 2002
    Messages:
    58
    Likes Received:
    0
    Ah yeah, can you try and explain the jittering thing used by 3dfx in their supersampling in an idiot proof way? :wink:
     
  11. 3dcgi

    Veteran Subscriber

    Joined:
    Feb 7, 2002
    Messages:
    2,435
    Likes Received:
    263
    The subpixel values are part of the pixel so there is no "original pixel" value at this point.
     
  12. Hyp-X

    Hyp-X Irregular
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,170
    Likes Received:
    5
    No its not true.

    The only (consumer) AA solution that has uniform Z values is Parhelia's FAA.
    The problem with such approach is that it cannot antialias poligon intersections.
    Matrox choose that so they could achieve 16 samples per pixel. (apart from storing fragment mask - a way of MSAA compression.)
     
  13. KimB

    Legend

    Joined:
    May 28, 2002
    Messages:
    12,902
    Likes Received:
    218
    Location:
    Seattle, WA
    Not when you take performance into account.

    For example, if you totally ignore memory bandwidth, and just look at fillrate, then two images that are taken at the same performance levels will show that the anisotropic implementation will usually do a better job of filtering the textures.

    But there are certainly benefits to be had from supersampling. I just think that if it's going to be done, it should be done on a per-primitive level, only applied where it's needed (This should be possible with the pixel shaders on the NV30, don't know about the R300). Applying supersampling globally just wastes performance.
     
  14. Tagrineth

    Tagrineth SNAKES... ON A PLANE
    Veteran

    Joined:
    Feb 14, 2002
    Messages:
    2,512
    Likes Received:
    9
    Location:
    Sunny (boring) Florida
    Granted.

    But combining AF and SuperSampling results in thoroughly incomparable IQ.

    You should see such a solution in action... :)
     
  15. Ailuros

    Ailuros Epsilon plus three
    Legend Subscriber

    Joined:
    Feb 7, 2002
    Messages:
    9,420
    Likes Received:
    179
    Location:
    Chania
    The R200 and KYRO's (only up to 2xLevel aniso) allow a AF/SS combination. If you mean that supposed Feline implementation in VSA-100 I don't want to even hear about it again.

    To all those I prefer a 4xS/32-tap combination. Still an AF/SS combination in a way.
     
  16. SA

    SA
    Newcomer

    Joined:
    Feb 9, 2002
    Messages:
    100
    Likes Received:
    2
    Multisampling can be performed in several ways.

    In the case of tilers, the pixel color can be computed once and applied to the visible samples in the pixel based on the sample's z values. When the tile is done, the filter can be applied to the tile and the results written to the frame buffer.

    On IMRs multisampling is best done using some version of the A buffer. In this case, triangle fragments (those portions of a triangle within a pixel) set the bits of a coverage mask with one bit per sample. A single color and z value is stored for the fragment. Since there are usually only one or two fragments in a pixel, this allows significant compression of the color and z data. For 8x AA it allows up to 4 to 1 compression without loss for two fragments.

    It does assume, however, that the z values are the same for each sample, which is usually not the case. Z3 handles this by including the z slopes along with the z value at the center. Other problems occur when the number of fragments exceeds what is allocated (usually two are allocated since most pixels have one or two fragments).

    There are a number of sample patterns.

    Ordered grids - standard row-column pattern
    Staggered grids - every other row offset half a column (close packed)
    Rotated grids - ordered grid rotated by a fixed angle
    Sparsely sampled grids - NxN grid for N samples, one sample per row and one sample per column
    Jittered grids - a uniform grid with each sample randomly jittered in +/- x and y up to half a sample step. Requires a large number of samples to work well. Similar to Poisson distribution.
    Poisson pattern - a uniformly sampled random pattern. Requires a large number of samples to work well. Difficult to implement in hardware.
    Others

    The important aspects of a good sample pattern are:

    For small numbers of samples ( say <32) a pattern that provides approximately the same number of intensity gradations as the number of samples is of primary importance. Ideally this would be true for edges at all angles, but this is especially true for near horizontal and near vertical edges. Sparsely sampled grids is best, followed by rotated grids.

    The next most important factor (especially for a small number of samples) is uniform sampling. This prevents pixel popping. Care must be taken with all the above patterns to make sure the samples are fairly uniform in their coverage of the pixel and do not aggregate in clumps or along characteristic lines.

    To break up aliasing across pixels, a pattern library is often used. These patterns are interleaved across several pixels (say 4x4 pixels). To avoid pixel popping, care must be taken that the pattern boundaries do not cause non-uniform sampling. Ideally, the whole 4x4 pattern looks like one uniform pattern much like seamless texture tiles.

    Of course it goes without saying the more samples the better. For IMRs coverage mask (A buffer) techniques easily allow 8x, 16x, or even 32x AA without much extra memory bandwidth since it simply requires a larger bit mask. Tilers can also easily increase the samples without incurring extra bandwidth.
     
  17. andypski

    Regular

    Joined:
    May 20, 2002
    Messages:
    584
    Likes Received:
    28
    Location:
    Santa Clara
    I'm not going to argue too much about this. What you say is largely correct.

    I was talking purely from a quality standpoint, the key issue being that while textures have evolved so that they no longer exclusively hold colour or luminance information, filtering techniques are still based around the assumption that the information in the texture map can be linearly interpolated. Generally this assumption is a good one for many types of data, but if you imagine the case where a normal stored in a texture flips from (1,0,0) to (-1, 0, 0) there will be a point where the interpolated normal is (0, 0, 0) - not very good ;)
     
  18. king_iron_fist

    Newcomer

    Joined:
    Feb 6, 2002
    Messages:
    58
    Likes Received:
    0
    :eek:

    You lost me after "Multisampling can be......" ;)
    Seriously though I've never heard anything about an "A buffer" before, how does this approach differ to the normal?
    Erm, what exactly is Z3?
    I'm also quite baffled how a uniformly sampled random pattern would work in a poisson distribution. Does this mean a new random pattern is generated every frame and repeated?
    I'm also not too sure what you mean by the term intensity graduations?
    And can you explain the term 'coverage mask'?

    Cheers for the help :)
     
  19. Simon F

    Simon F Tea maker
    Moderator Veteran

    Joined:
    Feb 8, 2002
    Messages:
    4,560
    Likes Received:
    157
    Location:
    In the Island of Sodor, where the steam trains lie
    King iron fist,
    With the possible exception of Z3, most of those topics are very well covered in a good 3D graphics book. If you can't afford to buy one, find your local technical library.
    Try "Computer Graphics. Principles and Practice" by Foley, van Dam et al, or "Advanced Animation and Rendering Techniques" by Watt & Watt.
     
  20. king_iron_fist

    Newcomer

    Joined:
    Feb 6, 2002
    Messages:
    58
    Likes Received:
    0
    ok, thanks - I'll check them out.
     
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...