|
| Home | Downloads | Screenshots | Forums | Source code | RSS | Donate |
| Register | Log in |
| < Hardware rendering, the funWhy make it simple when it can be complicated? > |
|
Hardware renderer progress Dec 6th 2025, by Arisotura |
|
Hey hey, little status update! I've been having fun lately. The hardware renderer has been progressing nicely lately. It's always exciting when you're able to assemble the various parts you've been working on into something coherent, and it suddenly starts looking a lot like a finished product. It's no longer just something I'm looking at in RenderDoc. Those screenshots were taken with 4x upscaling (click them for full-size versions). The last one demonstrates hi-res rotscale in action. Not bad, I dare say. It's not done yet, though, so I'll go over what remains to be done. Mosaic Shouldn't be very difficult to add. Except for, you know, sprite mosaic. I don't really know yet how I'll handle that one. The way it works is intuitive if you're processing pixels left-to-right within a scanline, but this isn't how a modern GPU works. Display capture What was previously in place was a bit of a hack made to work with the old approach, so I will have to rework this. Atleast now I have the required system for tracking VRAM banks for this. But the whole part of capturing video output to OpenGL textures, and reusing them where needed, will need to be redone. I also need to think of a way to sync hi-res captures back to emulated VRAM when needed. Of course, support for this also needs to be added to the 3D renderers, for the sake of render-to-texture. Shouldn't be too difficult to add it to the compute renderer, but the old OpenGL renderer is another deal. I had designed that rather lazily, just streaming raw VRAM to the GPU, and never improved it. I could backport the texture cache the compute renderer uses, but it will take a while. Mid-frame rendering I need to add provisions in case certain things get changed mid-frame. I quickly did it for OAM, as shown by that iCarly screenshot above. The proof of concept works, but it can be improved upon, and extended to other things too. The way this works is similar to the blargSNES hardware renderer. When certain state gets modified mid-frame, a section of the screen gets rendered with the old state - that section goes to the top of the screen, or wherever the previous section ended if there was any. Upon VBlank, we finish rendering in the same way. There are exceptions for things that are very likely to be changed mid-frame (ie. window positions, BG scroll positions), and are relatively inexpensive to deal with. It's worth noting that on the DS, it's less frequent for video registers to be changed mid-frame, because the hardware is more flexible. By comparison, in something like a SNES game, you will see a lot more mid-frame state changes. Either way, time will tell what is worth accounting for and what needs to be optimized. Filtering Hey, let's not forget why we came in here in the first place. Hopefully, with the way the shaders are structured, it shouldn't be too hard to slot in filters. Bilinear, bicubic, HQX, xBRZ, you name it. What I'm not too sure about is how well it'll work with sprites. It's not uncommon for games to splice together several small sprites to form bigger graphical elements, and I'm not sure how that'll work with filtering. We'll see. Misc. things The usual, a lot of code cleanup, optimization work, fixing up little details, and so on. And work to make the code nicer to work with, which isn't particularly exciting. This gives you a rough idea of where things are at, and what's left to be done. To conclude, I'll leave you with an example of what happens when Arisotura goofs up her OpenGL calls: Have fun! |
| 12 comments have been posted. |
| < Hardware rendering, the funWhy make it simple when it can be complicated? > |
|
somelinuxer says: Dec 6th 2025 |
| This is the kind of stuff I love to see |
|
Zyute says: Dec 7th 2025 |
| Great to see the emulator progress at such a rapid pace. Never a bad thing to see updates like this so burn that midnight oil baby 😉. |
|
poudink says: Dec 7th 2025 |
| I like how in the comments for that mosaic post you linked, you and RSDuck were basically saying that none of the stuff in this post was going to get implemented in melonDS. And now it is. |
|
aradon says: Dec 7th 2025 |
| Thanks for your work. Will there soon be dual screen support for the AYN Thor? |
|
poudink says: Dec 7th 2025 |
| There is no official Android version of melonDS. |
|
Enzx302! says: Dec 7th 2025 |
| FINALLY, we filter it, what I have been waiting for for a long time, I hope that in the next update they will be available, I hope it is the most advanced, the 5xBR 4.0 Very High Configuration as in drasticFINALLY, we filter it, what I have been waiting for for a long time, I hope that in the next update they will be available, I hope it is the most advanced, the 5xBR 4.0 Very High Configuration as in drastic |
|
qwertx says: Dec 8th 2025 |
| would this make anisotropic filtering possible in melonds? |
|
Arisotura says: Dec 9th 2025 |
| possibly, I haven't yet looked into how to do it with OpenGL tho |
|
YAYYYY says: Dec 9th 2025 |
| High resolution display capture!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|
AsPika says: Dec 11th 2025 |
| Awesome! More likes 4K Ultra HD graphic styles! 🤩 |
|
arado says: Dec 13th 2025 |
|
@poudink But there is a MelonDS version in the PlayStore. |
|
poudink says: Dec 13th 2025 |
| Yes and it's unofficial. |