[cairo] MIPMAPPING cairo.

Frédéric Plourde frederic.plourde at polymtl.ca
Thu Oct 16 06:45:13 PDT 2008



Jeff Muizelaar a écrit :
> On Wed, Oct 15, 2008 at 09:14:04AM -0400, Frédéric Plourde wrote:
>   
>>> Are you sure this bilinear sample is correct? It looks far worse than 
>>> anything I have seen. Looks more like the image was scaled to 50% and 
>>> the binlinearly scaled up. The current algorithim only fails if the 
>>> scale is less than 60% or so.
>>>       
>> Mhh.. yep, pretty sure. What's happening maybe is that the source image 
>> "http://img58.imageshack.us/img58/8669/src1231x1504np1.png" gets 
>> automatically resized in FF3 (and other browsers ?), but is really 
>> bigger than it seems. So, we're really talking about downscaling with a 
>> large factor.... which kills text image as you've seen.
>>     
>
> It looks to me like
> http://img388.imageshack.us/img388/6500/dest1231x1504to840x1026cw3.png          
> is the wrong image. Bilinear filtering shouldn't look that, and it
> doesn't match what I get when I run the test program myself.
>
>   

Finally guys, you were all right ! ;-)
I don't know what happened, I think ImageShack has screwed up that 
bilinear image... weird !
so here it is as it should be :
http://img519.imageshack.us/img519/5170/dest1231x1504to840x1026my3.png

and I just realized I showed you images that were downscaled less than 
2X ! duh !
To really see the differences between bilinear and mipmapping perf, 
let's see those other ones  :

* Former 'nearest' and 'bilinear" modes :
  nearest : 
http://img293.imageshack.us/img293/7351/dest1231x1504to144x267nhx4.png
  bilinear : 
http://img293.imageshack.us/img293/2761/dest1231x1504to144x267bui5.png

* New mipmaping modes :
  nearest_mipmap_linear : 
http://img293.imageshack.us/img293/2817/dest1231x1504to144x267nuz6.png
  linear_mipmap_nearest : 
http://img293.imageshack.us/img293/2213/dest1231x1504to144x267lft6.png
  linear_mipmap_linear : 
http://img293.imageshack.us/img293/563/dest1231x1504to144x267tlf1.png

The improved quality here is really clear!  One can even see that 
trilinear (linear_MM_linear) is not - in that case - so different from 
the linear_MM_nearest one.  This is because the target scale is "close" 
to mipmap levels.
The really iinteresting mode is LINEAR_MIPMAP_NEAREST.

-fred-



More information about the cairo mailing list