Page 1 of 1

Disable the bilinear filtering in the VDP?

Posted: Wed Jul 03, 2013 9:17 pm
by eggerman
Any way to disable this or was this native to the megadrive/genesis?

Posted: Thu Jul 04, 2013 7:32 am
by TmEE co.(TM)
There is none of such happening on the hardware. Your emulator is the one that blurs out the image for whatever reason.
...Unless you consider something such filtered bilinearly :
http://www.tmeeco.eu/BitShit/S3%26KfuckerDead.jpg

Posted: Thu Jul 04, 2013 11:46 am
by eggerman
Well, comparing the shot to to regen genesis emulator, the VDP window in exodus has a blurred (and ugly) look to it:

Image

Posted: Fri Jul 05, 2013 10:07 pm
by SoullessSentinel
That appears to be filtering to allow the graphics to appear closer to how it would on a traditional CRT TV.

This is a GOOD thing, it's not an 'ugly' filter. It allows for visual effects that depend on it, such as the transparency of the waterfalls in Green Hill Zone to function correctly.

Example:

Clean:
Image

Filtered:
Image
.
Notice how in the second screenshot, the waterfall and the shield are fully transparent.

The same thing happens with the 'tubes' in Chemical Plant zone in Sonic 3.

Posted: Sat Jul 06, 2013 7:22 am
by TmEE co.(TM)
^ This above has nothing to do with CRT and more to do with NTSC and/or PAL video signal simulation.

The filtering kicks in whenever your window is not exact intended size of the image. When the window is supposed to be 640 x 480 and you resize it to 600 x 400 it'll be filtered.

Posted: Thu Jul 11, 2013 4:49 am
by eggerman
Regardless of whether it's a good thing or not, I'd like to humbly suggest it be optional.

Posted: Thu Jul 11, 2013 7:55 am
by Stef
Depending the API you use to blit the screen surface the filter can happen automatically, i remember i experienced that with GDI blit API and depending the graphics driver. To avoid that it's better to use the DirectX methods which are much more versatile.

Posted: Fri Jul 12, 2013 3:16 am
by Nemesis
I fully understand why you'd want the filtering to be optional. There's a bit of a problem with that though that you may not realize. In H32 mode, the Mega Drive actually generates non-square pixels. Of course, the real system doesn't have "pixels", it has scanlines, where each line is effectively an analog voltage waveform for the R, G, and B signals, and it can change at any point and in any way along that line. In H32 mode, you basically have 4:3 aspect ratio pixels. This can't be visualized on a computer monitor without displaying them at the incorrect aspect ratio (like gens does), or resampling them (Like Exodus and Kega do).

I could add an option to force H32 pixels to be square, which would generate an incorrect image, but give you the non-filtered look you're going for, but there's a further problem: Exodus is the only Mega Drive emulator that supports changing the screen mode mid-frame, IE, having the top half of the screen in H32 mode, and the bottom half in H40 mode, or even alternating every line if you want to. For each line the VDP renders, that line is actually being resampled to the display width, to ensure the entire image is displayed in the correct aspect ratio. If I allow resampling to be turned off, what should I do with mixed-mode images like this? Should I center H32 scanlines horizontally? That will severely break the image though.

I can add an option to disable filtering, and center H32 lines rather than resampling them, but it would need to be well understood that could actually be displaying an incorrect screen image, not only at the wrong aspect ratio, but also potentially with incorrect relative alignment for scanlines within the image.

Posted: Sat Jul 13, 2013 2:30 pm
by Huge
One intermediate solution could be to output to 1280x960 (plus the overscan), in which mode H40 pixels are drawn 4 times bigger in both direction, while H32 ones are drawn 5 times wider and 4 times taller.

Of course, the huge window size could be a problem for some users, but this would be the only pixel correct way.

Posted: Mon Jul 15, 2013 12:30 am
by LocalH
Another possible solution could be to only apply bilinear filtering horizontally, while applying nearest-neighbor resampling vertically (and locking window height to integer multiples of 240, with width locked to create an appropriate aspect ratio as Exodus already does in both video modes). This would more accurately model the signal output from the MD in RGB mode.

Posted: Mon Aug 12, 2013 6:58 pm
by panzeroceania
Huge wrote:One intermediate solution could be to output to 1280x960 (plus the overscan), in which mode H40 pixels are drawn 4 times bigger in both direction, while H32 ones are drawn 5 times wider and 4 times taller.

Of course, the huge window size could be a problem for some users, but this would be the only pixel correct way.
I really like this idea