I'm working to address the shortcomings of melonDS's OpenGL renderer.
Namely, if you've already used upscaling in melonDS, you may have noticed that it doesn't work right when the game renders 3D graphics to both screens: they flicker between the high-resolution render and a low-resolution copy. Technically, the DS can only render 3D graphics to one screen at a time, and games use a feature called display capture to work around that limitation.
Display capture records video output to VRAM (where it can later be reused). Hence the issue in melonDS: the upscaled framebuffer needs to be scaled back down to 256x192 so it can fit in VRAM. So instead, we need to detect when a given VRAM region contains a display capture and when it gets reused elsewhere, and replace it with a high-res version.
The original renderer was a bit of a hack. It did its job well, allowed for 3D upscaling with good performance, but the approach was simple and limited. As I tried to expand upon it to support high-res capture, it became clear that I was reaching the limits.
So instead, I decided to start building a proper OpenGL-based 2D renderer.
The advantage is that this opens up a lot of fun possibilities. Not only is it easier to integrate high-res 3D graphics, but even 2D graphics can be improved upon. For example: high-res rotation/scale. You can see it in action in that Super Mario 64 screenshot: look at that bottom screen minimap.
Filtering, too! I had attempted to add a xBRZ filter before, even made some videos of it, but never released it. The reason was that it was beyond the limits of what the old renderer could allow, it was a massive pain to work with and it never worked right, there were always oddball issues and glitches. But now, with this new renderer, it should be way easier to implement filtering for 2D elements.
There's still a bunch of things to be taken care of, but so far this is looking pretty promising.
YESSSSSSSSSSSSSSSSS
thanks for all your hard work, melonDS is great and only getting better.
Oh wow. That's super cool!! I usually play at native resolution, but this is a big feature for people who like to play scaled up!
Would this fix 2x rendering during battles in Golden Sun Dark Dawn? I think that game uses a frame buffer for that old school “motion blur” / ghosting effect.
Either way… fantastic work!!!
As long as it doesn't do any postprocessing on the CPU, it should work. Actually, I haven't implemented VRAM display yet, but that won't be very hard to do.
Happy to see someone else mention that game ahah
Wow! Thanks for your hard work and the cool writeup!
You can check out the melonDS site if you want, I write more in detail about those things :)
This is really awesome!!!
Thank you for the amazing work your doing. Any plans for vulkan support too?
One of the goals is to make the code structure easier to work with, so it would be easier to add different renderers. We might add a Vulkan renderer later, but I don't think Vulkan does anything that OpenGL doesn't do that might benefit us here - the main benefit would be using a more recent graphics API, I guess. Still worth it if OpenGL ever gets deprecated.
There's no reason to deprecate OGL, just have it as library on top of Vulkan so drivers don't need to implement it, link Zink does pretty much.
Maaaan. Im so thankful for talented engineers like you. <3
As an aside, what's that first game with
MarioRed Plumber Brother holding the bow?Edit - found it, it's
MarioRed Plumber Brother & Sonic at the Olympic Games.explains why there is a chao hotair balloon in the background
Red Plumber Brother & Blue Hedgehog at the Olympic Games.Keep up the good work!
I think this might also address the issue with Golden Sun Dark Dawn’s battle screen being low res.
Hopefully! As I said in another post, I hope it's not one of those games that do postprocessing on the CPU - because if it does, it's gonna be low-res, nothing we can really do there :/
Excellent progress !
does your work help to get texture replacements in the future ? No begging, just try to understand
Texture replacements would be a possibility, but not my focus for now - prolly later.
Thanks for your hard work!!!
Would this fix the black lines when upscaling Pokemon Gen 4 games?
Yay!
Awesome work, mate!
Awesome work. Excited to try it.
MelonDS is amazing and I love you.
This looks awesome!! Melonds has been on a massive run for the past two years, and it's only getting better. Thank you so much for your contributions, you deserve all the praise ❤️😊
The rest of the team deserve it too, but thanks! :)
Got me there! You've all done an amazing job, especially with the second screen feature, been loving it so much I even attach my steam deck to a tv and play it there like a wii u! Super fun, and not to mention the many improvements that have been carried over to vitor's kingdom hearts melon mix project! All possible thanks to yall 😉
Ive been waiting for this for so long, before i'd have to use DeSmuME for some games to get them to upscale 3D properly. Thank you Arisotura!
NSMB looks so good now.
[deleted]
Does it not have support for the windows version? It has retroachievements for the android version and the retroarch core.
MelonDS shaping to be amazing, ty for the hard work!
This is great! Will this be a step towards solving the stuttering issue when playing with OpenGL on android?
The Android version is unofficial, so presumably not.
Incredibly thankful for your work mate. 🙏
Will this new hardware renderer be easier to port to android?
The unofficial Android port already supports hardware rendering.
Not this new hardwarer renderer no
Well, duh. This new hardware rendererer hasn't even been merged into melonDS's main branch yet. It's not in any version of melonDS right now.
OP was asking whether it would be "easier" to port, which to me seems like a weird question to ask when the exisiting Android port supports hardware rendering just fine, so I wanted to make sure OP knew that.
Would fix this the graphical bugs like the black lines in Pokemon Gen 4 games when upscaling?
This is new renderer is mainly for 2D graphics afaik, so probably not. The compute renderer which has been available for a while does fix the black lines in Pokémon, but I have no clue if the Android ports have it.
They do not😢
Would this new renderer fix the issue Ni no Kuni has with battles? On MelonDS, characters and enemies in battles always looked blurry as if they can't be upscaled while overworld 3d models and 3d cutscenes upscaled just fine.
Cool read and great start! Any chance the renderer work is what leads to abilities in other emulators that allow for things like texture replacement? I always think DS games would benefit so much from this ability.
Thank you for making gaming better for all of us.
Wow this is incredible, amazing work!
Why not using Vulkan?
super cool
Make Melon DS great again! 🤩