Comparison of Bilinear, Trilinear and Anisotropic Filtering

aeriic

Newcomer
I am in the process of acquiring sources for a class project in which I plan to make a comparison
between BF, TF and AF. I have already implemented bilinear texture mapping using affine mapping and computing the bilinear interpolation for a previous class assignment. For the project I wanted to take this further and make a comparison between the different filtering techniques. I've been looking through ACM for something relating to the three techniques, but the papers I'm finding seem a little too advanced for what I need. This only needs to be a simple demonstration of the differences between the methods. It's required that I have sources from journals, papers, etc...

Do any of you know of a good source that may help me implement TF or AF in their simplest forms? Also, how difficult would it be to implement them? I have roughly a month to complete this work, so we were advised to try something that isn't too complicated.

I would also welcome any suggestions on other topics that you think may be interesting and doable in the time allotted. One in particular that I find interesting is generating terrain from texture data. I am required to do this in OpenGL and C++, since it has to be OS and hardware independent...

Thanks!
 
For an AF algorithm (if you want to try to write one) either look at the OpenGL extension for anisotropy filtering or the source code of our simulator (link in signature). I think the Feline paper (well, there a couple of versions of that paper) is actually a good explanation of the different AF algorithms (4 different algorithms are explained in the paper) even if not being a beginners guide into 'anisotropy'. For that I think there was a small article in the B3D archives. The description of EWA at Heckbert's thesis is obscure for a non math guy like my but you may want to take a look.

Feline: Fast Elliptical Lines for Anisotropic Texture Mapping
 
Thanks RoOoBo. I actually have the same Feline paper already, but I was hoping to find some other sources as well. Unfortunately I can't use any source code unless it's associated with a whitepaper or something else. I did take a peek at your texture emulator though. ;)

I may have to bump it down a notch and to a comparison between point sampling, bilinear and trilinear filtering for time sake. I've never actually seen an AF algorithm until a few days ago, and it seems a lot more involved than the others...
 
Aeriic,
If you want a simple to implement approach for anisotropic, you can always supersample your data and use trilinear on the supersamples. Since you aren't after real-time performance, it will do the job for you.

Simon
 
Thanks Simon. I'll look into the supersampling with trilinear filtering method you suggested. You're right, I'm only looking for proof-of-concept approaches since the end result is most important in this case. BTW, is there a name for this particular approach to AF?
 
Thanks Simon. I'll look into the supersampling with trilinear filtering method you suggested. You're right, I'm only looking for proof-of-concept approaches since the end result is most important in this case. BTW, is there a name for this particular approach to AF?

A name? Probably not. It's really just a combination of William's MIP mapping and, IIRC, the way Catmull did AA in the original texture mapping (i.e. lots of sample).
 
A name? Probably not. It's really just a combination of William's MIP mapping and, IIRC, the way Catmull did AA in the original texture mapping (i.e. lots of sample).

I see... I have Williams' "Pyramidal Parametrics", as well as Ewin's "MIP-Map Level Selection..." paper. But I can't seem to find Catmull's thesis paper (at least not in downloadable form). I'm not sure if this is the one you were talking about though. Do you know where this particular combination of algorithms may have been implemented? I would need to have a source for it if I am to present it in my paper/presentation.

From what I've been able to read on AF, the MIP mapping involved has non-square aspect ratios, and are selected according to the camera's viewing angle from the surface. Is this always true? With MIP mapping in general, what is the best way to downsample a texture? I was thinking of just averaging adjacent texels.

Also from my understanding of filtering methods (please correct me if I'm wrong):

Linear filtering: affine mapping with point sampling (easy to implement, worst quality)
Bilinear filtering: affine mapping with bilinear interpolation (already implemented, better than PS)
Trilinear filtering: affine mapping with bilinear interpolation between MIP map levels (better than BF)
Anisotropic filtering: MIP mapping described above, with some form of filtering between MIP levels...

(with affine mapping, I mean calculating a different mapping matrix for each triangle. not sure if this is really the best way to map texels, but it's the only one I've learned so far)

Sorry for all the questions. I'm somewhat new to graphics theory, but I am enjoying the learning experience...:smile:
 
I see... I have Williams' "Pyramidal Parametrics", as well as Ewin's "MIP-Map Level Selection..." paper. But I can't seem to find Catmull's thesis paper (at least not in downloadable form). I'm not sure if this is the one you were talking about though.
I was thinking of Catmull's "Computer Display of Curved Surfaces" which was republished in the ACM's "Seminal Graphics: Pioneering Efforts that Shaped the Field". I had a quick search but couldn't find it online. I've only got a dead tree copy.

Do you know where this particular combination of algorithms may have been implemented? I would need to have a source for it if I am to present it in my paper/presentation.
Do you mean where (texture) supersampling + bi/trilinear was implemented? Well, CLX2/Dreamcast supported it but I suspect that there were earlier implementations. It's a fairly simple approach but not the most efficient.

From what I've been able to read on AF, the MIP mapping involved has non-square aspect ratios, and are selected according to the camera's viewing angle from the surface. Is this always true? With MIP mapping in general, what is the best way to downsample a texture? I was thinking of just averaging adjacent texels.
OK, you can sort of assume that a screen pixel maps onto a (soft-edged) ellipse in texture space.

Standard MIP mapping a la Williams (and to a lesser extent some earlier work (can't recall the reference) that didn't use trilinear) uses equal x:y ratios, so sort of approximates the ellipse with a square/circle.

IIRC, there is a reference in Foley & van Dam to a technique that uses several samples of higher resolution MIP maps to build an approximation to the elliptical texture sampling footprint.

Also, there's a technique called, IIRC, RIP mapping which uses different X and Y scalings but that doesn't really help much if the texture sampling footprint's main axis is not close to horizontal or vertical. The same applies to Summed Area Tables.

Also from my understanding of filtering methods (please correct me if I'm wrong):

Linear filtering: affine mapping with point sampling (easy to implement, worst quality)
Bilinear filtering: affine mapping with bilinear interpolation (already implemented, better than PS)
Trilinear filtering: affine mapping with bilinear interpolation between MIP map levels (better than BF)
Anisotropic filtering: MIP mapping described above, with some form of filtering between MIP levels...
Well, you could include point sampling with and without MIP mapping, to bring your total up to 5.

MIP mapping is really just an acceleration technique that uses precalculation to reduce the filtering costs during renderering. It's not actually essential but very, very useful.
(with affine mapping, I mean calculating a different mapping matrix for each triangle. not sure if this is really the best way to map texels, but it's the only one I've learned so far)
Well, you have to compute the hyperbolic mapping parameters for every triangle to get the texture mapping to look correct.
Sorry for all the questions. I'm somewhat new to graphics theory, but I am enjoying the learning experience...:smile:
No worries. I was there myself at one time and I'm still learning. :)
 
I was thinking of Catmull's "Computer Display of Curved Surfaces" which was republished in the ACM's "Seminal Graphics: Pioneering Efforts that Shaped the Field". I had a quick search but couldn't find it online. I've only got a dead tree copy.

I was finally able to find his thesis paper, which (IIRC) is the original version of this paper. Quite a read...

Do you mean where (texture) supersampling + bi/trilinear was implemented? Well, CLX2/Dreamcast supported it but I suspect that there were earlier implementations. It's a fairly simple approach but not the most efficient.

Yes, I was just looking for a source where it was implemented, but I came across Heckbert's EWA paper that explains the "true AF algorithm" in somewhat simpler terms, so I may just go "all out"...;)

OK, you can sort of assume that a screen pixel maps onto a (soft-edged) ellipse in texture space.

Standard MIP mapping a la Williams (and to a lesser extent some earlier work (can't recall the reference) that didn't use trilinear) uses equal x:y ratios, so sort of approximates the ellipse with a square/circle.

IIRC, there is a reference in Foley & van Dam to a technique that uses several samples of higher resolution MIP maps to build an approximation to the elliptical texture sampling footprint.

Also, there's a technique called, IIRC, RIP mapping which uses different X and Y scalings but that doesn't really help much if the texture sampling footprint's main axis is not close to horizontal or vertical. The same applies to Summed Area Tables.

I read up on RIP mapping and SAT, but it seems that those techniques are not very popular because of the end result doesn't justify the cost of implementation. Are these techniques used in modern 3D apps or hardware? Apparently there was speculation that ATI was using RIP in their AF algorithm a few years back (which they denied). IIRC, the problem with these is that they still produce blurry results at angles that go diagonally on the MIP map...

Well, you could include point sampling with and without MIP mapping, to bring your total up to 5.

MIP mapping is really just an acceleration technique that uses precalculation to reduce the filtering costs during renderering. It's not actually essential but very, very useful.

I don't think I completely understand this statement. I can see how MIP mapping is not essential in PS, BF and EWA - but how is trilinear filtering implemented without MIP mapping? I must have the wrong idea of how it works...

Well, you have to compute the hyperbolic mapping parameters for every triangle to get the texture mapping to look correct.

Ahh, thanks for the heads up. It seems that hyperbolic mapping gives the best balance of performance and quality when compared to perfect mapping (best quality-worst performance) and affine mapping (low quality-good performance). I'll have to do some more research on this, as it seems to be more complicated than affine.

EDIT: Just found Blinn's "Hyperbolic Interpolation" in the catacombs of my university's library. Seems like a good intro, but I'm gonna have to look for more material...

No worries. I was there myself at one time and I'm still learning. :)

Thanks again Simon!
 
Last edited by a moderator:
Back
Top