Talk:Bilinear filtering
![]() | This redirect does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||
|
Untitled
editWe need images! Suggested:
- normal bilinear filtering, possibly both scaling down and scaling up.
- one showing how filtering fails when you scale down too far.
- one showing the abruptness.
Java Algorithm x_index and y_index
editWhat exactly is the x_index and y_index? are they really just floor(u) and floor(v). they appear in the u_ratio and v_ratio formulae and are never used again.
Sample Code
editThe sample code is wrong/misleading. You need the size of the source image and the size of the filtered image to apply a bilinear filter. Instead of "u *= tex.size;" you have to multiply it with a scale factor e.g. "fac=src->size/dst->size;". By the way I don't understand "so we must make three or four calculations of y, one for each channel". Three (or more) calculations for each pixel are needed but what is y? --SupperTina (talk) 17:08, 4 April 2009 (UTC)
Is it more pleasant textures?
edit"The bilinear filtering method of texture rendering uses the weighted average of four texture pixels. This results in more pleasant textures than those that result from point mapping." I think better point mapping, than bilinear (at least not for near pixels). I though it for distance pixels (texels; for far objects), but can it be for all? — Preceding unsigned comment added by Versatranitsonlywaytofly (talk • contribs) 14:50, 20 February 2012 (UTC)
- In a sense, yes. It is usually not a good idea to enlarge ANY texture to more than double size, but if the texture is quite smooth, for example a plasma cloud as in the Plasma effect article, or similar textures with more realistic color maps (these are useful for example to render water or clouds), then, yes, linear filtering will yield more acceptable results. If you take a screenshot of said article and magnify it in Paint, you'll see the pixel boundaries quite clearly. If you use an image processing program (or the image viewer in Windows XP or newer OSes), you can resample the image using bilinear or bicubic (sometimes only bilinear) interpolation. The result will be much smoother than the detail view in Paint.
- Sometimes, point sampling is superior, for example if you want to render a mosaic floor or any other object with colored rectangles of equal size, but these cases are rare. So, yes, usually, bilinear is superior.
- Bicubic interpolation is not THAT computationally expensive either. The main issue with bicubic is not its cost but the fact that you need to specify more carefully what happens if you approach the edges of the texture -- you need TWO pixels in all directions with bicubic. Ohterwise it would probably be the standard filtering by now[citation needed] rather than bi/trilinear.- ¡Ouch! (hurt me / more pain) 11:47, 20 April 2012 (UTC)