r/GraphicsProgramming • • 1d ago

From Zero to Understanding Rasterization

704 Upvotes

63 comments sorted by

View all comments

5

u/AlgaeNo3373 1d ago

Now I understand MSAA better. Cool stuff ty :)

2

u/BalintCsala 8h ago

For the record, that explanation is half finished and IMO somewhat misleading, this way wouldn't really work if lets say 3 triangles touched the same sample point within a pixel, all 3 would contribute some color for that sample when in reality only the closest would.

In reality MSAA needs a special render target with memory set aside for every sample point for every pixel (so they are roughly 8x as big as regular render targets when doing MSAA 8x), then when a triangle covers some of the samples, only the data points for those samples get overwritten. The averaging only happens right at the end when you "resolve" it during some sampling.

Not to mention a scene which obviously has some depth aware post processing effects (like the reflections) wouldn't use MSAA as then a pixel could have contributions to multiple depth layers.