POV-Ray : Newsgroups : povray.unofficial.patches : Mipmapping and trilinear filtering in povray : Mipmapping and trilinear filtering in povray Server Time
2 Nov 2024 11:23:56 EDT (-0400)
  Mipmapping and trilinear filtering in povray  
From: Nieminen Juha
Date: 9 Nov 1999 07:43:37
Message: <382816f9@news.povray.org>
When you use image maps, you can tell povray to use bilinear filtering
when rendering it. This means that when the texels of the projection of the
image map on screen are bigger than the screen pixels, povray will calculate
the in-between pixels by interpolating the 4 nearby texels of the image map.
  This does a good job when the image map is zoomed so big that it's texels
are bigger than the screen pixels.
  However, when the texels are smaller than the screen pixels, the bilinear
interpolation doesn't help much. Not every texel of the image map will be
taken into account when rendering and so there will appear unwanted effects,
like broken lines, moire patterns, etc (even when antialiasing is on). They
don't look very good. The smaller the texels with respect to screen pixels,
the worse the result.
  In most 3D engines (renderers, 3D games, 3D video cards...) this problem
is corrected by calculating mipmapping and trilinear filtering.
  Mipmapping is the calculation of smaller versions of the same image map
with some algorithm (the simplest one would be calculating a 4 times smaller
image map by averaging 4 pixels of the original).
  The idea behind this is that when the image map is zoomed out so that its
texels would be smaller than the screen pixels, we switch to the smaller
version of the image map. The texels of this smaller version will be bigger
than the screen pixels, so bilinear filtering will still give a very good
result. When this one is small enough, we switch to an even smaller version,
and so on.
  This has the problem that the change between mipmaps is abrupt. If you
have a polygon so that one end is near the camera and the other end is
far away (like a floor), you will clearly see straight lines where the
mipmap changes.
  Trilinear filtering corrects this. Besides bilinear filtering, it also
interpolates between mipmaps so that instead of abrutply changing from one
mipmap to another at a certain distance, it smoothly interpolates between
them.
  The result is very good.

  Now, povray only supports bilinear filtering. How about adding automatic
mipmapping and trilinear filtering to it?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.