Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualMJP

Posted 13 June 2013 - 04:21 PM

1. Yes, that's aliasing. Essentially you have some signal that's stored in a texture, and the fragment shader samples that signal. If the fragment shader doesn't sample at an adequate rate relative to the rate at which the signal changes (the frequency of the signal), then you get aliasing. A black and white checkerboard is basically a series of step functions, and sampling step functions will always result in aliasing because they have an infinite rate of change.

 

2. Yes, that's a similar case of aliasing. In this case the aliasing stems from the rasterizer, which samples some signal (in this case a triangle) at a fixed set of sample positions (usually aligned to the center of pixels). A triangle edge is also a step function, so you get the same aliasing problem.

3. Yes, texture filtering is a very important means of anti-aliasing. Filtering reduces aliasing by attenuating high-frequency components of a signal, but can also remove detail that's present in those higher frequencies. However if you oversample by sampling at a higher rate than your screen resolution and then filter the result when downsampling, you can reduce aliasing while still preserving details. This is the basic premise behind both texture filtering and MSAA. The former works with texture sampling, and the later works with the rasterizer. With texture sampling you typically take 4 texture samples in a 2x2 grid and perform linear filtering, which allows you to avoid aliasing as long as your sampling rate is no less than 1/2 the resolution of your texture. So if you had a 512x512 texture, bilinear filtering won't alias as long as the texture is mapped to an area of the screen that's >= 256x256 pixels. If you need to go lower, you need to use pre-filter by creating a chain of mip maps. This "no less than 1/2 the texture resolution" rule is why you create each mip level to be 1/2 the size of the previous level.

If you're interested in this sort of thing, I have a rather lengthy series of articles on my blog regarding sampling and aliasing. It may put you to sleep, but there's a lot of (hopefully useful) info in there.


#1MJP

Posted 22 May 2013 - 06:15 PM

1. Yes, that's aliasing. Essentially you have some signal that's stored in a texture, and the fragment shader samples that signal. If the fragment shader doesn't sample at an adequate rate relative to the rate at which the signal changes (the frequency of the signal), then you get aliasing. A black and white checkboard is basically a series of step functions, and sampling step functions will always result in aliasing because they have an infinite rate of change.

 

2. Yes, that's a similar case of aliasing. In this case the aliasing stems from the rasterizer, which samples some signal (in this case a triangle) at a fixed set of sample positions (usually aligned to the center of pixels). A triangle edge is also a step function, so you get the same aliasing problem.

3. Yes, texture filtering is a very important means of anti-aliasing. Filtering reduces aliasing by attenuating high-frequency components of a signal, but can also remove detail that's present in those higher frequencies. However if you oversample by sampling at a higher rate than your screen resolution and then filter the result when downsampling, you can reduce aliasing while still preserving details. This is the basic premise behind both texture filtering and MSAA. The former works with texture sampling, and the later works with the rasterizer. With texture sampling you typically take 4 texture samples in a 2x2 grid and perform linear filtering, which allows you to avoid aliasing as long as your sampling rate is no less than 1/2 the resolution of your texture. So if you had a 512x512 texture, bilinear filtering won't alias as long as the texture is mapped to an area of the screen that's >= 256x256 pixels. If you need to go lower, you need to use pre-filter by creating a chain of mip maps. This "no less than 1/2 the texture resolution" rule is why you create each mip level to be 1/2 the size of the previous level.

If you're interested in this sort of thing, I have a rather lengthy series of articles on my blog regarding sampling and aliasing. It may put you to sleep, but there's a lot of (hopefully useful) info in there.


PARTNERS