Post subject: Antialias, scaling, etc., why and how? Demonstrations here.
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
I find myself often having to explain my policy on how rendering at large size and rescaling to smaller size is a good thing, and how anisotropic filtering and antialias should be maximized. So I created these demonstration videos using POV-Ray to demonstrate the effects of different levels of filtering. Each of these videos shows the same scene at 320x240 resolution. The sizes of the files vary from 2 MB to 7 MB. Vanilla rendering: No antialiasing or anisotropic filtering. http://bisqwit.iki.fi/jutut/kuvat/antialiasdemo/1x.avi 4x antialias and 4x anisotropic filtering: http://bisqwit.iki.fi/jutut/kuvat/antialiasdemo/4x.avi 16x antialias and 16x anisotropic filtering: http://bisqwit.iki.fi/jutut/kuvat/antialiasdemo/16x.avi Ideal rendering (perfect): http://bisqwit.iki.fi/jutut/kuvat/antialiasdemo/infx.avi As one can see, each step reduces the amount of jitter that can be observed in the wall at the back. Each step also reduces the moire patterns in the texture on the floor and the ceiling, and smoothes the edges between the walls and the floor. In display cards, the two filters are separate (antialias smoothes edges while anisotropic filtering reduces jitter), but in these renderings both are improved simultaneously. The perfect video was rendered at 320x240 with the "+a +am2" settings in povray, i.e. recursively subpixel-rendering until the differences in neighboring pixels become insignificant. Each of the other videos were rendered with no antialias settings, by rendering it at 1x, 2x and 4x sizes, yielding 1x, 4x and 16x respective quality improvements. As one can observe, rendering at a double size and downscaling to normal size gives a significant improvement to the video quality, equivalent to a quadruple increase in the "anisotropic" and "antialias" ratings of the display card. I would like to see our 3D renderings matching the "ideal (perfect)" setting, i.e. where no jitter exists or pixelation artifacts exist at all, but in practise, I will settle on 64x filtering (i.e. 16x hardware filtering plus 2x software scaling). I hope no further justifications are needed. :) Disclaimer: This may be slightly different from what the display card's hardware does. Still, the point stands that increasing the number of samples gives a better approximation of the original intent and reduces jitter etc. artifacts, when perfect representation is not available. (I.e. it applies to 3D content and _some_ 2D content, but not bitmap content such as NES videos.)
Active player (411)
Joined: 3/16/2004
Posts: 2623
Location: America, Québec
Can you create a guide to how to create "perfect" video because I don't understand a single thing in that post.
Emulator Coder, Site Developer, Former player
Joined: 11/6/2004
Posts: 833
Call up your video card's settings. Find the various antialiasing settings. Turn the dial WAY up. Save. Another trick is to make your temp AVI at a high resolution like 1024x768 (disk space is something I like to call "your problem") and then downscale it to 320x240.
Active player (411)
Joined: 3/16/2004
Posts: 2623
Location: America, Québec
From what I know, it's not all video plugins that let you configure Antialiasing + anisotropic. I think a guide which explains how-to for each video and maybe sound plugins to make the best would be nice. Theory is good but for a minority of people. We want results, not just blah blah. ;P
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
The "ideal (perfect)" version shown in my post is not attainable with current hardware. It is a guideline. Instructions towards best settings: Open your video card settings. Find DirectX & OpenGL settings, and find there the anisotropic filtering and antialias settings. Put them at maximum. If there is a checkbox that forbids application from modifying them, check that box. In mupen64, check the video plugin settings, and find anisotropic filtering and antialias gauges. Crank them at maximum. When making video from mupen64, render it at large resolution (such as 1024x768), and when you make the AVI, then downscale it (such as with mencoder options "-vf scale=512:384 -sws 9").
Emulator Coder, Site Developer, Former player
Joined: 11/6/2004
Posts: 833
The thing is the official encoders are supposed to be able to carry out these kinds of things. And it's not just video plugins. Your actual drivers should allow you to do this, usually somewhere in the Display control panel settings. Check it out.
Player (206)
Joined: 5/29/2004
Posts: 5712
Okay, I went way in-depth through the Display settings, and I found some brief information on some drivers, but nothing about antialiasing. I did see some interesting color control stuff, though.
put yourself in my rocketpack if that poochie is one outrageous dude
Active player (411)
Joined: 3/16/2004
Posts: 2623
Location: America, Québec
So, in short, it is the same thing mentioned 1-2 years ago. Record at higher resolution then reduce it while using max antialiasing+ anisotropic. I don't agree with "The thing is the official encoders are supposed to be able to carry out these kinds of things." If there is no guide and such, people can't guess and afaik, there is't many people encoding N64 runs. Unless I miss something.
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Bag of Magic Food wrote:
Okay, I went way in-depth through the Display settings, and I found some brief information on some drivers, but nothing about antialiasing. I did see some interesting color control stuff, though.
Well, for me it looks like this. http://bisqwit.iki.fi/jutut/kuvat/antialiasdemo/sets.png It's from a Finnish version so I added some labels for translation. Phil, yes it was also discussed 1-2 years ago.
Player (206)
Joined: 5/29/2004
Posts: 5712
Okay, am I getting anywhere close? http://img.photobucket.com/albums/v299/RyanFerneau/display.jpg (Aww darn I forgot Photobucket resizes stuff now)
put yourself in my rocketpack if that poochie is one outrageous dude
Joined: 11/11/2006
Posts: 1235
Location: United Kingdom
I figured I could put some information on scaling types as well. These are all done with images, but the basic premise is the same. Source Image: http://www.bluetoaster.net/tasvideos/compare/odolwamassive.png Nearest Neighbour (Worst): Bilinear: Bicubic: Lanczos (Best): Comparing NN and Lanczos: Comparing Biliniar and Lanczos: I have to say I can't really notice the difference between the last two. Perhaps a bad picture example? Edit: Apparently the big sword edge and the top of the sword "swoosh" from links swords are places to look. Also, for ATI users with the Catalyst Control Center, open it up and look here. max out most of these settings for maximum quality (url to avoid stretching): http://www.bluetoaster.net/tasvideos/compare/catcontrolcent.png
<adelikat> I am annoyed at my irc statements ending up in forums & sigs
Active player (411)
Joined: 3/16/2004
Posts: 2623
Location: America, Québec
Since that 1-2 years ago, I never understood where that lanczos come from. If you want your encoders to be up-to-date, you should explain. If you want people to help you, help them. :P
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
Phil wrote:
Since that 1-2 years ago, I never understood where that lanczos come from. If you want your encoders to be up-to-date, you should explain.
From this comparison. http://bisqwit.iki.fi/kala/filt/ These are made with Imagemagick. Imagemagick does not have a filter called "bilinear", but I think the "triangle" one is the closest corresponding to it by function. In this table, I think Lanczos preserves the intent best. However, this applies to scaling into larger size... I should perhaps also make a version that scales into smaller size.
Active player (411)
Joined: 3/16/2004
Posts: 2623
Location: America, Québec
Oh ok, at this era, I was judge and encoder, I was wondering where it is. After not finding it, I thought that if I can't find such option then I am no good at encoding N64 games. I didn't have a single clue that lanczos is an imagemagick feature. Imo, it's not really related to encoding n64 movies. Next time be clear. :P
Player (206)
Joined: 5/29/2004
Posts: 5712
Okay, but, wait, well, now, does this process even make the finished picture look more authentic, or does it just make it look "nicer"?
put yourself in my rocketpack if that poochie is one outrageous dude
Emulator Coder, Site Developer, Former player
Joined: 11/6/2004
Posts: 833
Nicer. And nicer is easier on H264 to compress. And it looks a lot better when you take a small image like 320x240 and make it full-screen on your 1280x960 monitor. So in the end it's a great idea.
Joined: 11/11/2006
Posts: 1235
Location: United Kingdom
Phil wrote:
Oh ok, at this era, I was judge and encoder, I was wondering where it is. After not finding it, I thought that if I can't find such option then I am no good at encoding N64 games. I didn't have a single clue that lanczos is an imagemagick feature. Imo, it's not really related to encoding n64 movies. Next time be clear. :P
In the mencoder command line, "-sws 9" is lanczos. Just to clear that up.
<adelikat> I am annoyed at my irc statements ending up in forums & sigs
Active player (411)
Joined: 3/16/2004
Posts: 2623
Location: America, Québec
Well, thanks Raiscan. You just confirmed me that a guide is urgently needed. Without telling me that, I wouldn't have found myself. There are ~1000 if not more parameters in mencoder. Sorry but studying them is a tedious task and why should I study them if some people already did that. Just writing a guide is simpler for everyone and it's not that nobody hasn't studied them. Bisqwit, the admin which wants help :P, seems to had already done so. P.S. Uses of "I" doesn't explicitly mean me, Phil. Also I'm not saying that I will encode movies but often people ask me questions, I wrote some guides myself, about how to encode movies and the lack of information at the site. I just want information to be clear and easily understandable for everyone.
P.JBoy
Any
Editor
Joined: 3/25/2006
Posts: 850
Location: stuck in Pandora's box HELLPP!!!
So if you set the resolution up to 5120x3840 and then resized is down to 320x240 it would give 256 times better results?
Editor, Active player (297)
Joined: 3/8/2004
Posts: 7469
Location: Arzareth
P.JBoy wrote:
So if you set the resolution up to 5120x3840 and then resized is down to 320x240 it would give 256 times better results?
Yes, or no. You can't really compare "better" that way. The amount of samples is 256 times larger, but the difference in noise level may be just 10% of the image or less.
Joined: 7/26/2006
Posts: 1215
So for n64 movie encodes, lanczos scaling to 320x240 is recommended? Is there also a recommended quantizer to stay close to? like 25?