Archived

This topic is now archived and is closed to further replies.

Mayrel

Mitchell Filtering

Recommended Posts

Mayrel    348
I can't find much information on Mitchell filtering, and was wondering if anyone could point me in the right direction. What little I have found about it suggests that it uses spline-based interpolation, rather than linear interpolation. However, I'm no expert on splines, and I'd imagine my filter would be much slower than necessary.
Just Plain Wrong Although I hear that Mitchell filtering isn't as good as cubic filtering... [edited by - Mayrel on June 7, 2002 6:21:41 AM]

Share this post


Link to post
Share on other sites
Yann L    1802
Hmm, I assume that you posted this as a follow up to your blurry mipmap problem in the OpenGL forum ? If not, then ignore the rest of this post

The problem with the Mitchell filter is that, even though it has a far better resampling quality than a box filter, it will render your images even more blurry.

Look at those examples here.

The box filter is not very high quality (very blocky), but it is still somewhat sharper than the Mitchell filter (last image).

I personally never used it. I use standard 2x2 box filters for my mipmaps, they are good enough quality for my purposes. However, I run a slight sharpen filter over the original image before building the mipmaps, that can''t really hurt.

/ Yann

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
The Mitchell filter is designed for image *enlargement*. I would not use it for image reduction. I would especially not use it for image reduction and then run a sharpen filter over the result. I''d expect that to be poor.

In my column in Game Developer Magazine, I spent two months going over the high-quality-mipmapping problem. There''s code for those articles at http://www.gdmag.com/code.htm ... it builds mipmaps for some Max Payne textures in various different ways and lets you see the results.

-Jonathan.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
P.S. About the image comparisons you pointed out:

http://www.acdsystems.com/English/Community/ColumnsArticles/TechTips/tech-2002-04-20.htm

Those are total crap. It does not make much sense to filter images down, then look at wackily-enlarged versions of them and say "Hey look, the Mitchell filter is blurrier!!!!"

(By wackily-enlarged, I mean: They re-upsampled the box filtered version with box, the Mitchell version with Mitchell, etc.)

The comparisons they are making are pretty meaningless because what you care about is the *downsampled* version of the image. By re-enlarging things in non-uniform ways, they have obfuscated what''s going on. Probably, this means whoever wrote that article doesn''t understand digital filtering.

-Jonathan.

Share this post


Link to post
Share on other sites
Yann L    1802
quote:

would especially not use it for image reduction and then run a sharpen filter over the result. I'd expect that to be poor.


What about reading my post, before replying ? I run a sharpen filter on the original image, and sample down after that. The results are very far from being poor quality.

quote:

Those are total crap. It does not make much sense to filter images down, then look at wackily-enlarged versions of them and say "Hey look, the Mitchell filter is blurrier!!!!"


Oh, it makes perfect sense. Because this is exactly what the hardware is doing in your 3D engine. It will reapply a HW box enlargement filter on your downsampled mipmaps. You will often have the case of magnified mipmaps, esp. if not using anisotropic filtering. This is exactly the situation that makes a rendered image look blurry (except for textures that are already blurry in the first place).

quote:

By re-enlarging things in non-uniform ways, they have obfuscated what's going on


In a realworld 3D engine, mipmaps are almost *always* reenlarged in a non-uniform way.

BTW: I pointed out this simple comparison site, because I think that Mayrel wouldn't care very much about Fourier diagrams and frequency analysis. He was interested in the visual endresult, and what to expect in a 3D scene.

/ Yann


[edited by - Yann L on June 9, 2002 3:51:07 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
Hey Yann, it seems in your message that you''re trying to talk down to me. I''m trying to help, here. If you don''t appreciate my comments, then fine, but be nice about it.

You''re talking to someone who has been a professional game programmer for 7 years, as a professional programmer much longer than that, and who has worked on shipping games for several different platforms (PC, Xbox, GameCube, PS2). You''re also talking to someone who has had long discussions with Don Mitchell about the Mitchell filter. So chill, ok?

So, I misread your post (I was reading really fast). Sorry about that. You sharpen before reduction, not after. That produces an image with less information content than one that was just reduced straightforwardly. Perceptually, it might produce results that look interesting to you, but I think that if you run a broad suite of tests, you will find image degradation problems. You say it "can''t really hurt" but in fact it can.

--- Yann wrote: ---
Oh, it makes perfect sense. Because this is exactly what the hardware is doing in your 3D engine. It will reapply a HW box enlargement filter on your downsampled mipmaps. You will often have the case of magnified mipmaps, esp. if not using anisotropic filtering. This is exactly the situation that makes a rendered image look blurry (except for textures that are already blurry in the first place).
------

Yes, you will have the case of magnified mipmaps, but they will all be magnified *by the same method*, that of a tent filter (not usually a box filter, unless you have point sampling turned on, which nobody ever does. But you could. Or hey, turn on anisotropy, or whatever you want; it doesn''t really matter, as long as THE SAME FILTER is used to reconstruct all textures). This is not what is shown on that web page, and that''s why the web page is bad.

--- Yann wrote: ---
BTW: I pointed out this simple comparison site, because I think that Mayrel wouldn''t care very much about Fourier diagrams and frequency analysis. He was interested in the visual endresult, and what to expect in a 3D scene.
------

Except that what''s on the web page doesn''t show him what he would get from a 3D scene when building mipmaps with the various filters. In fact, it''s extremely misleading, and that''s what I was complaining about.

The software that I pointed out on the gdmag web site, however, does show this.

-Jonathan.



Share this post


Link to post
Share on other sites
Yann L    1802
quote:

Hey Yann, it seems in your message that you''re trying to talk down to me. I''m trying to help, here. If you don''t appreciate my comments, then fine, but be nice about it.

You''re talking to someone who has been a professional game programmer for 7 years, as a professional programmer much longer than that, and who has worked on shipping games for several different platforms (PC, Xbox, GameCube, PS2). You''re also talking to someone who has had long discussions with Don Mitchell about the Mitchell filter. So chill, ok?


Good. Guess we are on the same level here. And if you read your other 2 posts again, I wouldn''t really classify them as ''friendly''.

quote:

So, I misread your post (I was reading really fast). Sorry about that. You sharpen before reduction, not after. That produces an image with less information content than one that was just reduced straightforwardly. Perceptually, it might produce results that look interesting to you, but I think that if you run a broad suite of tests, you will find image degradation problems. You say it "can''t really hurt" but in fact it can.


I have done my research, don''t worry. Actually, I had Mayrel''s problem several years ago: what to use for a mipmap filter. At that time, 3D cards didn''t use anistropic sampling, so the issue was even more important than today. I have done indepth analysis of various methods, reqarding frequency response, dynamic ranges, information loss and s/n ratios. Guess what ? Game textures are far from being the optimal mathematical case. Game textures (esp. photorealistic ones, scanned from photographs) do contain noise, are blurry from the beginning on and (very often) contain far less information than the actual texture resolution could hold.

So, what do I want to get with my textures ? A good visual result. Nothing else. And if my textures aren''t resampled in the optimal frequency domain, or if my mipmapping switchover point slightly violates the Nyquist limit, guess what ? I don''t care, as long as the visual results are good. And adding a sharpen filter over a texture, that is oversampled in the first place, will not remove information. It will add noise. And this is exactly what I want, since it increases the subjective visual quality.

quote:

Yes, you will have the case of magnified mipmaps, but they will all be magnified *by the same method*, that of a tent filter (not usually a box filter, unless you have point sampling turned on, which nobody ever does. But you could. Or hey, turn on anisotropy, or whatever you want; it doesn''t really matter, as long as THE SAME FILTER is used to reconstruct all textures). This is not what is shown on that web page, and that''s why the web page is bad.


OK, I agree that it would have been nicer, if they had remagnified all methods using simple bilinear interpolation. But even if it isn''t, the only difference you have is an overly exagerated effect of the particular filter. It might not be exactly what you''ll get on a 3D card, but it gives you a basic idea.

Game programming isn''t about mathematical correctness, it''s about creating visually pleasing results, even if that implies violating accepted mathematical/physical laws...

/ Yann

Share this post


Link to post
Share on other sites