Bilinear Filtering - A weird frame rate boost trick.

If you're having problems with Snes9x, or think you've found a bug, this is the place to be.
Post Reply
natsumerio
Snes9x White Belt
Posts: 31
Joined: Fri Apr 08, 2011 7:54 am

Bilinear Filtering - A weird frame rate boost trick.

Post by natsumerio »

My computer's OS = Windows 7 home premium, 32-bit American english language version.
HP Pavilion dv6000 (RX019AV#ABA)
Mobile Intel(R) 945 Express Chipset Family
Processor = 1.86 GHz Intel Celeron M CPU
Physical RAM = 1 GB
Screen's resolution = 1280 x 800 32bit 60hz
Snes9x = 1.53
Snes9x 1.53 Output method = DirectDraw (Using Direct3D gives me the message "Failed to initialize currently selected display output.)

This will sound weird, but you can combine "Bilinear Filtering" with slow graphics filters to get a frame rate boost. I used to hate "Bilinear Filtering" (I still hate it by itself), but now that I know about this trick, I can use it to gain a frame rate boost if the frame rate is beLow 60 (ntsc) or 50 (pal). Below is a list of ALL of Snes9x 1.53's graphics filters & their frame rate's both without & with "Bilinear Filtering", so that everybody can know how much of a frame rate boost to expect. I have also tested & listed some of Themaister's graphics filters.

If your "OutputMethod" is set to "DirectDraw" & you use any built-in graphics filter (see next paragraph for 2 possible exceptions) & have "Bilinear filtering" turned ON, the graphics won't LOOK bilinear filtered, unless the graphics filter that you use is designed to look bilinear filtered. If your "OutputMethod" is set to "OpenGL" & you use any built-in graphics filter & have "Bilinear filtering" turned ON, the graphics will have the effects of both the graphics filter that you're using & bilinear filtering.

For my own PC (see top of post), with the OutputMethod" set to "DirectDraw", the graphics filters "None" & "Forced 1X" have bilinear filtering without & with "Bilinear filtering" turned ON. If this happens to you too, either set the "OutputMethod" to "OpenGL" ("2" in the snes9x.conf file), or use the graphics filter "Simple 2X", "Simple 3X", or "Simple 4X".

The test game is "Secret of mana (USA)". I went into the Inn in Potos Village & made a save state there. Those with weaker or stronger PC's than mine (see top of post) might get slightly different frame rate's, but your DIFFERENCE between without & with "Bilinear Filtering" should be the same as everybody else's. Also, PAL displays's usually have a different hz rate than NTSC displays's. To make sure of the results (& because these are the settings that I ALWAYS use anyway; I just don't trust auto-frame skipping), I had "Frame Skipping" set to "Fixed" & "Amount skipped" set to zero. Some of the numbers fluctuated by both -1 & +1. When that happened, & only if the frame rate spent an EQUAL amount of time at all 3 numbers, then I just wrote down the middle number. The "OutputMethods" used were "DirectDraw" & "OpenGL". "Direct3D" wasn't tested because snes9x gives me the message "Failed to initialize currently selected display output".

From left to right, the first number is the frame rate with the "OutputMethod" set to "DirectDraw" & "Bilinear Filtering" turned OFF. The 2nd number is the frame rate with the "OutputMethod" set to "DirectDraw" & "Bilinear Filtering" is turned ON. The 3rd number is the frame rate with the "OutputMethod" set to "OpenGL". With the "OutputMethod" set to "OpenGL", the frame rates are the same both without & with "Bilinear Filtering". The graphics filters that have an * to the left of their names have a difference in frame rate's if the "OutputMethod" is set to "DirectDraw" & "Bilinear filtering" is turned ON.

Best viewed with type font "Courier new".
DirectDraw...........................| OpenGL
-------------------------------------+-------
None......................60......60 | 60
Forced 1X.................60......60 | 60
Simple 2X.................60......60 | 60
Scanlines.................60......60 | 60
TV Mode...................60......60 | 60
Blargg's NTSC (Composite).60......60 | 60
Blargg's NTSC (S-Video)...60......60 | 60
Blargg's NTSC (RGB).......60......60 | 60
SuperEagle................60......60 | 60
Super2xSal................60......60 | 60
2xSal.....................60......60 | 60
* hq2x....................52......60 | 60
* hq2xS...................57-60...60 | 60
* hq2xBold................58-61...60 | 60
EPX A.....................60......60 | 60
EPX B.....................60......60 | 60
EPX C.....................60......60 | 60
* Simple 3X...............57-60...60 | 60
* TV Mode 3X..............42-43...60 | 60
* Dot Matrix 3X...........56......60 | 60
* hq3x....................36......55 | 52-53
* hq3xS...................45......60 | 55-56
* hq3xBold................35......60 | 60
* lq3xBold................52-53...60 | 60
EPX3......................60......60 | 60
* Simple 4X...............34-35...60 | 60
* hq4x....................28......47 | 37

For these next graphics filters, the number is the frame rate with the "OutputMethod" set to "OpenGL". The frame rates are the same both without & with "Bilinear Filtering".

Themaister's graphics filters. Only tested using "OpenGL".
-----------------------------
Blinky................38
Edge..................45
Scanlines.............40
Waterpaint hicontrast.13
Waterpaint............12

Those who want to use Themaister's graphics filters in their snes9x can find them here. You'll also need to download Overfiend's snes9x cg dlls. Put the cg dlls in the same folder that you installed snes9x in. You can put Themaister's graphics filters anywhere, but for convience I put them a sub folder in snes9x's main folder.

Themaister's graphics filters
https://github.com/Themaister/Emulator- ... all/master

Overfiend's snes9x cg dlls for 32 bit systems
http://download.sessionclan.de/overfien ... g_dlls.zip

Overfiend's snes9x cg dlls for 64 bit systems
http://download.sessionclan.de/overfien ... ls_x64.zip
User avatar
OV2
Official Win32 Porter/Dev
Posts: 679
Joined: Thu Aug 30, 2007 10:15 pm

Post by OV2 »

Just to clear it up: enabling bilinear filter in directdraw causes snes9x to use video memory for the output image. Up till winxp, that would cause the image to be filtered bilinear. From vista on upwards, directdraw never uses bilinear filtering.
Using video memory also gives a small speedup, that's probably what you are seeing.
odditude
Snes9x Green Belt
Posts: 445
Joined: Tue May 03, 2011 2:35 pm

Post by odditude »

reposting for legibility, if not usefulness...

Code: Select all

DirectDraw...........................| OpenGL
-------------------------------------+-------
None......................60......60 | 60
Forced 1X.................60......60 | 60
Simple 2X.................60......60 | 60
Scanlines.................60......60 | 60
TV Mode...................60......60 | 60
Blargg's NTSC (Composite).60......60 | 60
Blargg's NTSC (S-Video)...60......60 | 60
Blargg's NTSC (RGB).......60......60 | 60
SuperEagle................60......60 | 60
Super2xSal................60......60 | 60
2xSal.....................60......60 | 60
* hq2x....................52......60 | 60
* hq2xS...................57-60...60 | 60
* hq2xBold................58-61...60 | 60
EPX A.....................60......60 | 60
EPX B.....................60......60 | 60
EPX C.....................60......60 | 60
* Simple 3X...............57-60...60 | 60
* TV Mode 3X..............42-43...60 | 60
* Dot Matrix 3X...........56......60 | 60
* hq3x....................36......55 | 52-53
* hq3xS...................45......60 | 55-56
* hq3xBold................35......60 | 60
* lq3xBold................52-53...60 | 60
EPX3......................60......60 | 60
* Simple 4X...............34-35...60 | 60
* hq4x....................28......47 | 37
adventure_of_link
Hero of Hyrule | Official Port Recruiter
Posts: 2588
Joined: Mon May 24, 2004 5:06 pm
Location: 255.255.255.255

Post by adventure_of_link »

moved to tech support... :arrow:
Image

Unofficial Test Monkey For:
* Snes9X GX (Wii)
* Snes9X EX (Android)
* Snes9X 64-bits (PC/Mac)

ZSNES|Ben Heck|NSRT|Bob Smiley
squall_leonhart69r

Re: Bilinear Filtering - A weird frame rate boost trick.

Post by squall_leonhart69r »

OV2 has already given a clear answer as to why bilinear improves ddraw's performance.
Post Reply