"Pixel-perfect" rendering upscaled to fullscreen resolution possible?

900 views
Skip to first unread message

madi...@gmail.com

unread,
Apr 27, 2015, 8:35:34 PM4/27/15
to mupen...@googlegroups.com
Hi list,
I noticed that regardless of video plugin, bitmap graphics like e.g. text in various games, the start screen of F-Zero X and textures in Mischief Makers always look more or less deformed. So I read up on the resolution capabilities of the N64 and saw that most games run at 256x224 or 256x240. Now, I don't care much for high-resolution rendering of old games because that just makes them look their age and crappy and creates a jarring contrast to the deformed low-res bitmaps, I also don't care for user-created high-res texture packs.

So, basically I want to render games at their native resolution (be it 256x224 or 640x480, whatever the game requested on the original console), but with 8x FSAA and 16x AF, and have the emulator upscale it aspect-ratio-correct with preserved pixel-pitch to the native resolution (2560x1440 in my case) and inserting black bars where appropriate. Kind of like the "1-4x native resolution" option in Dolphin. My monitor understands just the usual PC resolutions like 640x480 and smaller resolutions are then put into a corner. And NVidia's Linux driver doesn't seem to offer an easy way of making the GPU scale everything (on Windows, scaling results in games were, uh, fugly).

So is this possible from within the emulator (on Linux, Fedora 21) or do I have to look elsewhere?

Best regards,
Nikolaus

William Shipley

unread,
Apr 27, 2015, 9:19:00 PM4/27/15
to mupen...@googlegroups.com
The only things that currently aren't rendered at full resolution are textures. Antialiasing (MSAA, ie the good kind) is already supported with Glide64Mk2 (also Rice, I think), and the 3D models are rendered at full resolution. (That's what setting the rendering resolution does).

If you're after pixely, rather than blurry textures (which, by the way, is NOT faithful emulation, as the N64 did interpolation on the console) the setting in Glide64Mk2 is "filtering = 2".  For Rice, it's "Mipmapping = 0". However, doing this causes some problems.

Here's an imgur album with and without blocky textures. Both screenshots are rendered at 1280x960 with 16xMSAA, and if you look at the 3D models you will be able to see that they are being rendered at full resolution, not TV resolution.


You'll note that disabling the intended texture blurring causes problems with the landscape. This is because the developers made it gradually shift in color by appying a transparent, extremely low-resolution coloring texture, which is now blocky and easily visible.

There is no easily-handled distinction between UI textures and background textures, since games handle 2D rendering in a variety of ways. 

Without providing some way to obtain higher resolution textures there's not much of a way to improve the quality you see here. HQ4x and the like only work well with high-contrast textures with lots of distinct edges, which doesn't apply to most N64 games. The rough equivalent for photographic-style textures with lots of detail is to go with various types of interpolation, like bilinear or bicubic, which Glide64mk2 already does. Bad news: that's what's making things blurry.

Hope that helps.


--
You received this message because you are subscribed to the Google Groups "mupen64plus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mupen64plus...@googlegroups.com.
To post to this group, send email to mupen...@googlegroups.com.
Visit this group at http://groups.google.com/group/mupen64plus.
For more options, visit https://groups.google.com/d/optout.

madi...@gmail.com

unread,
Apr 28, 2015, 8:07:21 PM4/28/15
to mupen...@googlegroups.com
Hi,
I'm not specifically looking for blocky, but for a more even appearance of bitmaps. I uploaded some screenshots at 640x480 and marked some things with red circles: http://imgur.com/a/3XfZZ. I figured this "unevenness" of bitmaps is either because the video plugin does something or because the image gets stretched and then mangled due to incorrect aspect ratio (256x224 and 256x240 are both different ARs from 640x480) or non-integer-scaling. That's why I am looking for something like Dolphin's "render at 1-4x the native resolution and upscale for fullscreen display" option that uses the resolution set by the game and reacts to resolution changes (PD, Turok 3?).

I may be wrong about my hunch though, so if what mupen does is technically correct, I will have to deal with it.

William Shipley

unread,
Apr 28, 2015, 8:29:41 PM4/28/15
to mupen...@googlegroups.com
Ah, that glitch. It's actually unrelated to your resolution, and will appear at any size, including the native resolution.

It's a bug caused by a change in the context where texture interpolation occurs. What you're seeing is the edges between multiple textures. The emulator interpolates the textures when it loads them, not when they're on the screen, and doesn't adjust their sizes to account for the edge textures. So, you have a very nicely smoothed texture with some very hard square edges on it that aren't influenced by nearby textures.

The real hardware does the interpolation every frame, which prevents this from occurring, but is much harder to emulate.

Note that I said it happens even in the native resolution. Any time a game expects multiple textures to tile well after interpolation (like many title screens) OR has a texture smooth in a way that would draw over the edge in a noticeable way (Perfect Dark's fonts) you will see a hard square line around that texture.

Basically, the emulator "blurs" the textures before tiling them together, and the N64 does it after. It could probably be fixed with a few well-placed render-to-texture hacks, but I'm not familiar enough with the glide64mk2 code to do it myself.

So, in conclusion:

It's a bug, and not how it renders on hardware.
It's not resolution or scaling-related (although turning off interpolation WILL fix it, while introducing other visual problems)
There is no setting to fix it as of now that will not disable interpolation.

madi...@gmail.com

unread,
Apr 29, 2015, 8:53:10 AM4/29/15
to mupen...@googlegroups.com
Ah! Very interesting, thanks for the explanation. There seems to lots of headroom left in N64 emulation ;)

William Shipley

unread,
Apr 29, 2015, 4:10:05 PM4/29/15
to mupen...@googlegroups.com

No problem! If you ever feel like taking a crack at fixing it, we'd love to see the results.

On Apr 29, 2015 6:53 AM, <madi...@gmail.com> wrote:
Ah! Very interesting, thanks for the explanation. There seems to lots of headroom left in N64 emulation ;)

--
Reply all
Reply to author
Forward
0 new messages