What are Mipmaps? Texture Filtering in GLSL [Shaders Monthly #6]

Поділитися
Вставка
  • Опубліковано 29 сер 2024

КОМЕНТАРІ • 9

  • @antontretyakov486
    @antontretyakov486 Рік тому +6

    These series are pure gold. Thank you sir for provision of such a great exemplification!

  • @Katlex_threejs
    @Katlex_threejs 4 дні тому

    Thank you! It's really informative

  • @MDLeide
    @MDLeide 2 місяці тому +1

    That was excellent.

  • @Enesb852
    @Enesb852 2 місяці тому

    Thank you

  • @rouchy_
    @rouchy_ Рік тому +2

    It's not clear to me why we getting noise effect on 19:38, is that because the result pixel color is the nearest of four texels, and due to plane rotation and thus perspective interpolation the texture coordinate is varying in time, and amount of the texel also probably varying, thus resulting in different result color in time? Can you pls eleborate why that happens)

    • @gsn-composer
      @gsn-composer  Рік тому +2

      I think you got that right. If there are many texels per framebuffer pixel, the true solution would be to average all the texels within the framebuffer pixel's footprint on the texture. This averaging is approximated using mipmaps (shown at 3:48 min:sec). This is close to the true solution and therefore produces little noise. In contrast, if we use the nearest-neighbor interpolation on the original texture (without mipmaps), the color is only determined by the nearest texture pixel. Which texel is the closest is "kind of" random (of course it is a deterministic process, but since the scene is dynamic, different texels are selected each time, which produces sampling noise, called "aliasing"). Imagine there was a black and white checkerboard of texels within the framebuffer pixel's footprint on the texture. The true solution would be medium gray, which can be achieved with mipmaps. The nearest-neighbor interpolation would toggle between black and white.

    • @rouchy_
      @rouchy_ Рік тому

      ​@@gsn-composer Now I think I understand, thank you for eleborating

  • @starbuck3980
    @starbuck3980 2 роки тому +1

    So, it is useful so that if i have a far object doesnt use the original texture but something with lower resolution and so save memory?

    • @gsn-composer
      @gsn-composer  2 роки тому +3

      Yes, the resolution is reduced for a far object (larger mipmap level). But not to save memory but to prevent sampling artifacts (aliasing). This is shown at 19:38 min:sec in the video. The mipmap level is determined per framebuffer pixel and not per triangle/primitive.