How to get square pixels without using 8:7 aspect ratio?

If you're having problems with Snes9x, or think you've found a bug, this is the place to be.
Post Reply
Xenphor
Snes9x White Belt
Posts: 15
Joined: Fri Feb 11, 2011 5:48 am

How to get square pixels without using 8:7 aspect ratio?

Post by Xenphor »

As far as I can tell, the only way to get square pixels is to use the simple1x,2x,3x filters which feature the snes's native aspect ratio. The downside to these filters is that the Snes's native aspect ratio is stretched vertically and is not what appears on a TV. Unfortunately, when switching to 4:3 in Snes9x, the pixels become warped, killing the image quality. Is there a way to have a non-stretched aspect ratio but also retain square pixels in Snes9x?

The only way I've seen to do this is to use the NTSC filter. This filter somehow manages to maintain a normal aspect ratio and also features square pixels. The only downside of this filter is that, as far as I can tell, it only works correctly at 640x480. At any other resolutions the scanlines will become distorted and mess up the image.

So, is there any other way I can achieve what I'm looking to do without resorting to some ugly filters or bilinear filtering?
odditude
Snes9x Green Belt
Posts: 445
Joined: Tue May 03, 2011 2:35 pm

Re: How to get square pixels without using 8:7 aspect ratio?

Post by odditude »

Xenphor wrote:As far as I can tell, the only way to get square pixels is to use the simple1x,2x,3x filters which feature the snes's native aspect ratio. The downside to these filters is that the Snes's native aspect ratio is stretched vertically and is not what appears on a TV. Unfortunately, when switching to 4:3 in Snes9x, the pixels become warped, killing the image quality. Is there a way to have a non-stretched aspect ratio but also retain square pixels in Snes9x?

The only way I've seen to do this is to use the NTSC filter. This filter somehow manages to maintain a normal aspect ratio and also features square pixels. The only downside of this filter is that, as far as I can tell, it only works correctly at 640x480. At any other resolutions the scanlines will become distorted and mess up the image.

So, is there any other way I can achieve what I'm looking to do without resorting to some ugly filters or bilinear filtering?
it is impossible to display 256x244 square pixels and have the resultant image not be in a 8:7 aspect ratio. by definition, if a 256x224 image needs to be displayed in a 4:3 aspect ratio, each pixel must be stretched horizontally to a 7:6 ratio.

the NTSC filter does not output square pixels, it just stretches them in a way which you are finding visually pleasant.
Xenphor
Snes9x White Belt
Posts: 15
Joined: Fri Feb 11, 2011 5:48 am

Post by Xenphor »

Well I've experimented some more and found the best thing to do was use a CRT monitor, select a simple filter, and then simply squish the screen with the monitor's on screens controls. Unfortunately this is not possible on an LCD.

I guess what I've found is that the 4:3 option somehow stretches the pixels too much to where they become warped. The NTSC filter stretches, that I can see, but not as much as the 4:3 setting does. What I get with the NTSC filter is actually a window-boxed display at 640x480. I guess it squishes the image a tad and then stretches it horizontally just a tad. It gets rid of the native vertically stretched image but doesn't go too far like the 4:3 option does.

So I'm still not sure what to do for a full screen, high res display. Oddly enough, a 3x window that is 4:3 stretched does not warp the image as much as a full screen 4:3 stretch. What I'm looking for is the best full screen, high res option (1280x1024) that can horizontally stretch the native resolution just enough to even out the image.
odditude
Snes9x Green Belt
Posts: 445
Joined: Tue May 03, 2011 2:35 pm

Post by odditude »

Xenphor wrote:Well I've experimented some more and found the best So I'm still not sure what to do for a full screen, high res display. Oddly enough, a 3x window that is 4:3 stretched does not warp the image as much as a full screen 4:3 stretch. What I'm looking for is the best full screen, high res option (1280x1024) that can horizontally stretch the native resolution just enough to even out the image.
a 1280x1024 square-pixel display is 5:4, not 4:3. a proper 4:3 image (at 1280x960) would be letterboxed on that monitor.
Xenphor
Snes9x White Belt
Posts: 15
Joined: Fri Feb 11, 2011 5:48 am

Post by Xenphor »

Well I tried 1280x960 at 4:3 stretched and it fills the screen; it is not letterboxed. In fact, every time I use the 4:3 option it always stretches and fills the screen no matter what resolution I choose. Is there no way to select 4:3 and not have it stretch the image?


I see that there are two options there: Maintain Aspect Ratio and Stretch Image. When I deselect Stretch Image, Maintain Aspect Ratio becomes greyed out. When this option is greyed out, switching between 4:3 and 8:7 does nothing to the image. It is only when I select Stretch in addition to Maintain Aspect Ratio does the image change when selecting 4:3. So it seems there is no way to change the aspect ratio without stretching the screen at the same time, distorting the image in the process.


I tried 1280x960 on my 4:3 CRT with 4:3 stretched mode and it distorts the image as well. The image I'm looking for still seems to be best produced by using simple filters and manually squishing it with CRT controls. This way the pixels can stretch and still maintain their integrity.
SparroHawc
Official Android Porter
Posts: 303
Joined: Mon Feb 07, 2011 9:20 pm
Location: All up in your business

Post by SparroHawc »

Xenphor wrote:I see that there are two options there: Maintain Aspect Ratio and Stretch Image. When I deselect Stretch Image, Maintain Aspect Ratio becomes greyed out. When this option is greyed out, switching between 4:3 and 8:7 does nothing to the image. It is only when I select Stretch in addition to Maintain Aspect Ratio does the image change when selecting 4:3. So it seems there is no way to change the aspect ratio without stretching the screen at the same time, distorting the image in the process.
Unchecking Stretch Image means one pixel drawn by the SNES is displayed as one pixel on your computer monitor (or four pixels if you're using a 2X filter, or nine pixels if you're using a 3X filter, et cetera). The pixels will always be square unless you're using filtering that does some pixel scaling/squishing. Computer monitors have perfectly square pixels; TVs do not. This is what causes the disparity you're experiencing. I believe even modern TVs have square pixels now (correct me if I'm wrong), although if you use s-video to hook your computer up to a TV it may display at the 'correct' aspect ratio.

Unfortunately, checking 'maintain aspect ratio' keeps the pixels square instead of adjusting to the same aspect ratio as TVs. I, personally, wouldn't mind seeing an option for using NTSC-style rectangular pixels, potential scaling oddities be damned.
I tried 1280x960 on my 4:3 CRT with 4:3 stretched mode and it distorts the image as well. The image I'm looking for still seems to be best produced by using simple filters and manually squishing it with CRT controls. This way the pixels can stretch and still maintain their integrity.
That's pretty much what you'll have to do, yeah. The NTSC filter will accomodate for the difference in pixel geometry though, and scale the pixels appropriately. If you want an experience that's as close as you can get to playing it on an old CRT television, that's the way to go. Of course, bilinear filtering works alright too, if you can stand the fuzzy nature of it - but as you noticed, you'll have to tweak the aspect ratio yourself.
odditude
Snes9x Green Belt
Posts: 445
Joined: Tue May 03, 2011 2:35 pm

Post by odditude »

SparroHawc wrote:Computer monitors have perfectly square pixels; TVs do not.
this is incorrect.

fixed-pixel displays usually have square pixels. examples include LCD TVs, plasma TVs, and LCD monitors.

CRT-based displays (your big old tube TV/monitor) have variable-sized pixels.
Xenphor
Snes9x White Belt
Posts: 15
Joined: Fri Feb 11, 2011 5:48 am

Post by Xenphor »

Well things are making a little more sense now and I guess I can just keep using the NTSC filter or use a CRT if necessary.

I actually had another question though if somebody knows the answer. In 1.53, OpenGL doesn't work at all for me. Every time I select it and start a game, Snes9x just crashes. Now from what I've read, OpenGL was just put back in for this release and is supposed to be working. I don't suppose there are any development libraries I need to download are there? Is it just a problem with my video card? I have an Intel 965 express chipset which does work with OpenGL under Linux. I have updated my drivers in Windows.
SparroHawc
Official Android Porter
Posts: 303
Joined: Mon Feb 07, 2011 9:20 pm
Location: All up in your business

Post by SparroHawc »

odditude wrote:fixed-pixel displays usually have square pixels. examples include LCD TVs, plasma TVs, and LCD monitors.

CRT-based displays (your big old tube TV/monitor) have variable-sized pixels.
I stand corrected then! Thanks for the addendum.

As for the OpenGL issue, I don't know how good the OpenGL support is on the Intel GPUs. It may be that SNES9x is trying to use a function that isn't supported by that chip's Windows driver, or that the OpenGL implementation for Windows doesn't have a software rig for whatever it might be missing. Simple answer is, use DirectX instead. Chances are there'll be someone looking at tweaking the OpenGL renderer for better compatibility in the future, as well. In the meantime, it's definitely good to know what GPUs don't work with it at the moment.
Xenphor
Snes9x White Belt
Posts: 15
Joined: Fri Feb 11, 2011 5:48 am

Post by Xenphor »

Okay I have yet another question. Under DirectDraw and Direct3d, I get substantial tearing of the image if I don't have Vsync and Triple Buffering enabled. The problem is, if I enable these, the tearing goes away, but then I get some noticeable input lag. I also am not able to get a completely smooth image (very little hiccups or stutters) unless I run at 640x480 at 60hz. For some reason, higher resolutions and refresh rates cause a slight amount of stuttering in the image (not a completely smooth scroll in games that scroll the screen).

Is my video card to blame for not being able to handle Snes9x without tearing or will most video cards need to have Vsync and Triple Buffering enabled to avoid tearing? It would be nice to get a smooth image without having to sacrifice some input lag.
SparroHawc
Official Android Porter
Posts: 303
Joined: Mon Feb 07, 2011 9:20 pm
Location: All up in your business

Post by SparroHawc »

What happens if you just use vsync and leave off triple buffering? That should at least get rid of the tearing, though I wouldn't be surprised if there's a bit of a stutter.

I could see your graphics chip causing some trouble with large screen sizes; the Intel graphics chipsets aren't exactly high performers. Running something full-screen means a lot of data has to be getting pumped through the graphics card at 60 frames per second.

Another thing to keep in mind, though, is that scaling an image takes a good amount of CPU if you aren't using hardware bilinear filtering. Also, the SNES runs at almost exactly 60 frames per second; if you aren't using a 60hz refresh rate, you're going to get some stuttering when the SNES's refresh and your monitor's refresh occur too far from each other. Fortunately, if you're using a flatscreen, you won't suffer any from a 60hz refresh rate.

So, first things to try - use vsync and not triple buffering, and try larger resolutions at 60hz.

--EDIT--

I'm discovering that if I am running SNES9x on my second monitor, specifically, the frame rate tends to bog down - especially on larger window sizes. It seems my graphics card doesn't have near the capabilities on the second display as the first. So, lower-end graphics chips can definitely affect your framerate, even with a fairly modern comptuer.
Xenphor
Snes9x White Belt
Posts: 15
Joined: Fri Feb 11, 2011 5:48 am

Post by Xenphor »

I tried vsync without triple buffering but still got tearing. For some reason, both must be enabled in order to eliminate it entirely (as far as I can tell).

As far as performance goes, I actually get a solid 60fps according to the FPS counter in Snes9x at a variety of resolutions. I also never use any filters besides the Simple1x,2x,3x and NTSC as I mentioned before. I use my monitor's native res (1280x800@60hz laptop, 1280x1024@75hz LCD-[not good-bad refresh rate], and variable on CRT).

What I'm talking about is the noticeable hiccups that can be seen when the screen is scrolling smoothly in one direction. When that happens (in any horizontal shooter, platformer, etc), then the slight stuttering becomes noticeable.
SparroHawc
Official Android Porter
Posts: 303
Joined: Mon Feb 07, 2011 9:20 pm
Location: All up in your business

Post by SparroHawc »

hrr. What happens if you try it in windowed mode, with the desktop display set to 60hz?
Xenphor
Snes9x White Belt
Posts: 15
Joined: Fri Feb 11, 2011 5:48 am

Post by Xenphor »

Window mode is even worse. I get tearing even if I have both Vsync and Triple Buffer enabled no matter what resolution/refresh rate.

edit: I thought I might mention that MESS actually does what I was looking for originally in regards to aspect ratio. Using DirectDraw, No Hardware Stretch, 1280x800, Pixel Aspect, and Switch Resolution to Fit, the end result is that SNES games appear ever so slightly stretched horizontally but still retain non-warped pixels.
SparroHawc
Official Android Porter
Posts: 303
Joined: Mon Feb 07, 2011 9:20 pm
Location: All up in your business

Post by SparroHawc »

Yeah, at this point I think I'm just going to throw my hands in the air and blame your graphics card.

Incidentally, triple-buffering only works if you have it set to fullscreen, so that's no big surprise.

What's really bugging me is that vsync doesn't seem to be working. Except with triple-buffering, which makes no sense. I'm starting to wonder if the Intel graphics chip does something wonky with its desktop display that causes the tearing, 'cause I have zero issues with that running windowed mode on my aging nVidia card. (GeForce 8400 GS)

Ugh. Anyone else have any ideas? :[
Xenphor
Snes9x White Belt
Posts: 15
Joined: Fri Feb 11, 2011 5:48 am

Post by Xenphor »

So you can run in Window mode without Vsync or Triple Buffering and still get no tearing? That seems like it would be the optimal setup for me. What about fullscreen?
SparroHawc
Official Android Porter
Posts: 303
Joined: Mon Feb 07, 2011 9:20 pm
Location: All up in your business

Post by SparroHawc »

I try to avoid fullscreen 'cause it screws with my screen layout. I can give it a try though.

doot de doot de doo...

----

In windowed mode, there's a noticeable difference between VSync being on and off. With it on, it's perfectly smooth, no tearing, no noticeable jittering (I'm testing on Road Runner's Death Valley Ralley, if you're wondering).

Running fullscreen, 1280x1024, 16-bit, 60hz, no triple buffering, vsync on, no filtering, stretched image, 4:3 aspect, stretching on, bilinear filtering on...

Exactly the same. Perfectly smooth, no tearing.

I do get a barely perceptible hitch maybe once every 15-30 seconds, but that's likely attributable to the fact that I'm running it on a PC that has a lot of other stuff going on in the background.
User avatar
Camo_Yoshi
Snes9x Purple belt
Posts: 922
Joined: Thu Nov 08, 2007 7:59 pm

Post by Camo_Yoshi »

Xenphor wrote:Well things are making a little more sense now and I guess I can just keep using the NTSC filter or use a CRT if necessary.

I actually had another question though if somebody knows the answer. In 1.53, OpenGL doesn't work at all for me. Every time I select it and start a game, Snes9x just crashes. Now from what I've read, OpenGL was just put back in for this release and is supposed to be working. I don't suppose there are any development libraries I need to download are there? Is it just a problem with my video card? I have an Intel 965 express chipset which does work with OpenGL under Linux. I have updated my drivers in Windows.
Short answer: Intel GPUs do not support OpenGL. You'll need to use a different renderer.
Snes9x FAQs | Forum Rules
What operating system are you using? 32 or 64bit? Version of Snes9x? Is the text at the bottom of the window white when you load the game?
These suggestions are usually the solution to your issue!
Post Reply