3

I'm rendering a scene using scanline method. In order to get rid of aliasing we need to render a scene with higher resolution (2x, for example). I'm trying to figure out how to calculate the color of a sample when it is not taken from the center of the subpixel. For example, we have 4 subpixels per 1 pixel, where the blue circle is the center of the subpixel, and the red circle is the sample position.

enter image description here

I tried to find information about sample calculation, but got nothing. I assume that I need to calculate sample color using 4 neighboring subpixels and apply bilinear interpolation to them to find the color.

enter image description here

Is my guess true, or does it have to somehow calculate the color of the sample in a different way?

  • What are the samples and subpixels in this context? Are you ray-tracing, sampling a texture, or something else entirely? – Dan Hulme Sep 20 '18 at 19:39
  • @DanHulme I'm rendering a scene using scanline method. In order to get rid of aliasing we need to render a scene with higher resolution (2x, for example). After that we have 4 subpixels per 1 pixel. As I know, the easiest way to downsample a frame is to calculate the average color of all subpixels (regular grid algorithm?). But I can't figure out how to calculate the color of a sample which is not positioned in the center of subpixel. I think that it's calculated using 4 neighbouring subpixels,but I'm not sure. – Paviel Kraskoŭski Sep 20 '18 at 20:02
  • @PaviełKraskoŭski i need any tutorial to understand this problem – information Sep 23 '18 at 23:29
  • @x-rw Here you can read about supersampling at the beginning of the article before "SUPERSAMPLING EVOLVES INTO MSAA". Wikipedia. Link on the Wikipedia page to the reference article. – Paviel Kraskoŭski Sep 25 '18 at 09:27

0 Answers0