Can you explain Multisampling?

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

  1. king_iron_fist

    Newcomer

    Joined:
    Feb 6, 2002
    Messages:
    58
    Likes Received:
    0
    Hi guys, sorry to start a dumb thread but its been bugging me for a while exactly how multisampling actually works. Supersampling is ok but my knowledge of multisampling is a bit hazy.

    From what I know multisampling somehow re-uses texture data and for each pixel selects a series of adjacent points to sample and compare pixel colour/data. IIRC these points are sometimes random or sometimes grid based depending on the implementation. Am I right in thinking that theoretically multisampling shouldnt have a fill rate penalty due to it not rendering any *new* pixels? If so then its got to be mainly a bandwidth hit hasnt it?

    I would appreciate any answers that would clear this up for me and if possible can you spare in depth math/programming explanations and just keep it understandable ;).
     
  2. Nupraptor

    Newcomer

    Joined:
    Nov 11, 2002
    Messages:
    79
    Likes Received:
    0
    You've basically got it right. Normal Full Scene Anti-Aliasing eliminates jaggies on both polygon edges and textures. MSAA does nothing for texture aliasing. 2X MSAA works like RGSS. 4X MSAA is more like OGSS.

    It still has a sizeable performance hit, but not quite as bad.
     
  3. king_iron_fist

    Newcomer

    Joined:
    Feb 6, 2002
    Messages:
    58
    Likes Received:
    0
    Um, sorry to awkward but I dont know exactly how RGSS or OGSS work :oops:
     
  4. Nupraptor

    Newcomer

    Joined:
    Nov 11, 2002
    Messages:
    79
    Likes Received:
    0
    OGSS = Order Grid Super Sampling
    RGSS = Rotated Grid Super Sampling

    Sorry about that, I meant to explain that, but I forgot.

    To keep things simple, RGSS > OGSS.
     
  5. king_iron_fist

    Newcomer

    Joined:
    Feb 6, 2002
    Messages:
    58
    Likes Received:
    0
    sorry, im still not completely with you....

    As far as I know supersampling just means rendering the image at a higher resolution and essentially scaling it down. I dont quite see how supersampling is done on a grid basis or how rotating a grid improves IQ. Sorry to be dumb... :wink:
     
  6. Nupraptor

    Newcomer

    Joined:
    Nov 11, 2002
    Messages:
    79
    Likes Received:
    0
  7. Bigus Dickus

    Regular

    Joined:
    Feb 26, 2002
    Messages:
    943
    Likes Received:
    16
    That's entirely dependent on the chip design. While that is true for current nVidia chips, the R300 from ATi uses a rotated grid (well... a sparse sampled or jittered grid) for 2X, 4X, and 6X modes.
     
  8. Nupraptor

    Newcomer

    Joined:
    Nov 11, 2002
    Messages:
    79
    Likes Received:
    0
    I was unaware of how the R300 performed MSAA at all. Thanks for enlightening me. :)
     
  9. king_iron_fist

    Newcomer

    Joined:
    Feb 6, 2002
    Messages:
    58
    Likes Received:
    0
  10. Nupraptor

    Newcomer

    Joined:
    Nov 11, 2002
    Messages:
    79
    Likes Received:
    0
    Do you have Adobe's Acrobat Reader installed?

    That PDF I linked to is for nVidia's cards, regarding the stuff they got from 3DFX.
     
  11. king_iron_fist

    Newcomer

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

    Odd, it just spends ages trying to load but nothing appears. yeah I have the latest version of acrobat installed. Btw why do VIA have a PDF on how Nvidia used 3DFX tech.... ??
     
  12. KimB

    Legend

    Joined:
    May 28, 2002
    Messages:
    12,902
    Likes Received:
    218
    Location:
    Seattle, WA
    Basic idea behind SSAA:

    Each sub-pixel element to be combined for the final pixel color has uniquely-calculated z and color data. In other words, each sub-pixel is just a normal pixel. This allows the hardware to render at a higher resolution, then scale down for the final output.

    Basic idea behind MSAA:

    Each sub-pixel element has its own unique z data, but the color is only calculated once, with each sub-pixel element having the same color. Except, that is, at triangle edges. The color is calculated once per pixel per triangle. Here's a quick example. Imagine this configuration for 4x MSAA:

    1 1
    1 2

    Where the 1's denote those parts of the pixel being covered by triangle one, and triangle two just touches the one part of the pixel denoted by a 2. Here the color value calculated for triangle one will determine 3/4 of the output color, with the final 1/4 being calculated from triangle 2.

    Since Multisampling hardware is generally capable of calculating z values many times each pixel (up to the maximum supported level of AA), there is often very little difference in calculation required whether AA is enabled or not. The only difference is at triangle edges. The only problem is that MSAA does require every bit as much memory bandwidth (assuming no compression) as SSAA. Since modern video cards don't have infinite memory bandwidth, they take a performance hit from enabling MSAA.

    But, that's not the end of the road. Since MSAA color data is often the same for an entire pixel (with 2-6 samples for today's hardware, depending), it turns out that it is very easy to compress. In fact, both the Radeon 9700 and GeForce FX compress framebuffer data. They also compress z-buffer data, which can also often be compressed more easily with FSAA enabled.
     
  13. Tahir2

    Veteran

    Joined:
    Feb 7, 2002
    Messages:
    2,978
    Likes Received:
    86
    Location:
    Earth
    Is MSAA and SSAA the only way to do AA?

    Why did the V5 5500 have AA that is only now being matched?
    Is it through (1) user nostalgia warping their memories or (2) were 3dfx really onto something?

    If it is (2) why hasn't another IHV capitalised on this?

    edit: typo :oops:
     
  14. Althornin

    Althornin Senior Lurker
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,326
    Likes Received:
    5
    V5 used RGSS.
    So, theoretically, up until now, there has not been an AA mode that is as good, edge quality wise. GF3/4 uses OGMS at 4x. The radeon 9700 however, as noted above, uses RGMS at 4x, and a sparsly sampled pattern at 6x.

    Note - super sampling (SS) has some benefits above multi sampliing (MS) - because the image is rendered at a higher resolution, texture aliasing is also cured with SS, while MS leaves texture aliasing up to Aniso/some other filtering algorithm.
     
  15. Tagrineth

    Tagrineth SNAKES... ON A PLANE
    Veteran

    Joined:
    Feb 14, 2002
    Messages:
    2,512
    Likes Received:
    9
    Location:
    Sunny (boring) Florida
    3dfx used a supersampling algorithm. Supersampling is by default better quality than multisampling, as MS actually misses some things like alpha textures (because they're textures, duh).

    Not only that, but... most of the competition until VERY recently has used what's considered an ordered-grid method... basically the chip takes the scene, renders it scaled up, then filters it down... so basically, a GeForce doing 4x FSAA at 800x600 will very simply do the calculation at "1600x1200" and then filter down (it's a little different for MSAA but you can think of it that way, really).

    This results in the sampling being very simple...

    Straight rendering, X is the sample point:

    _ _ _ _ _
    _ _ _ _ _
    _ _ X _ _
    _ _ _ _ _
    _ _ _ _ _

    Regular ordered grid sampling:

    _ _ _ _ _
    _ _ _ _ _
    _ _ X _ X
    _ _ _ _ _
    _ _ X _ X

    So the result is not much more coverage, especially on near horizontal and vertical edges - which will trigger two sample points at once, so there's only one gradient.

    3dfx, on the other hand, went with a MUCH better sampling pattern...

    _ _ _ _ _
    _ _ X _ _
    _ _ _ _ X
    _ X _ _ _
    _ _ _ X _

    Resulting in vastly improved coverage, especially on near-vertical and near-horizontal edges.

    ...there's a tiny bit more to it (subsamples jittered as well) but that's basically the entire reason. And the reason IHV's never capitalised: 3dfx used VERY performance-expensive supersampling. ATi, however, DOES use an identical sample pattern for their 4x MSAA now... so the edge quality is ALMOST as good (as far as anyone knows, ATi doesn't jitter). :)
     
  16. Althornin

    Althornin Senior Lurker
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    1,326
    Likes Received:
    5
    Tagrineth - jittered subsamples IS the same as RG.
    I seem to recall SA telling you that before.
     
  17. 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
    No, there a other ways. It's just that Super sampling (with or without SS of textures) is an easy way of (approximately) implementing AA.

    I think you've got some terms mixed up. Jittered sampling is a way of approximating "minimum distance poisson disc" sampling by taking (usually) regular grid points and randomly displacing them by small offsets.

    AFAICS the 3dfx 2x2 rotated grid looks to be one example of a sparse (regular) sampling pattern.
     
  18. Ailuros

    Ailuros Epsilon plus three
    Legend Subscriber

    Joined:
    Feb 7, 2002
    Messages:
    9,420
    Likes Received:
    179
    Location:
    Chania
    I'd still say that in terms of edge quality ATI's 6xMSAA is quite superior to the T-buffer's 2x2 RGSS.
     
  19. oyvind

    Newcomer

    Joined:
    Feb 14, 2002
    Messages:
    10
    Likes Received:
    0
    Location:
    Trondheim, Norway
    But there is still a need for aniso when using SS, right? To make textures look sharper?

    Thanks,
    Øyvind
     
  20. Ailuros

    Ailuros Epsilon plus three
    Legend Subscriber

    Joined:
    Feb 7, 2002
    Messages:
    9,420
    Likes Received:
    179
    Location:
    Chania
    Supersampling - as implemented so far - filters textures only to a 16-tap aniso equivalent degree.

    So yes for more "defined" textures, one can combine it with a higher degree of anisotropic filtering.
     
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...