Post subject: Depixelizing emulators
Joined: 3/25/2004
Posts: 459
Hay guyz, http://johanneskopf.de/publications/pixelart/ How hard would it be to pull the sprites from a ROM at startup, depixelize them, save them to a hashmap or something, and render them instead of the original sprites? Make emulators at movies beautiful.
Editor, Reviewer, Skilled player (1352)
Joined: 9/12/2016
Posts: 1646
Location: Italy
http://johanneskopf.de/publications/pixelart/paper/pixel.pdf The hq4x looks better to me. By the way, I think it would be impossible to implement such thing in an emulater without getting CPU use about 1 million times heavier.
my personal page - my YouTube channel - my GitHub - my Discord: thunderaxe31 <Masterjun> if you look at the "NES" in a weird angle, it actually clearly says "GBA"
Joined: 3/25/2004
Posts: 459
Why? And aren't computers a million times faster than the NES?
Noxxa
They/Them
Moderator, Expert player (4107)
Joined: 8/14/2009
Posts: 4089
Location: The Netherlands
Ramzi wrote:
And aren't computers and million times faster than the NES?
Clock speed of the original console does not matter that much. There are many other factors in play for emulation speed, such as hardware quirks. For instance, emulating a SNES accurately costs about 3 GHz, despite the actual SNES processor clocking at only 3.58 MHz. Sure, many emulators for e.g. NES are plenty fast, but I'm not sure you can find one today that runs at 60,000,000 FPS unthrottled on current computers.
http://www.youtube.com/Noxxa <dwangoAC> This is a TAS (...). Not suitable for all audiences. May cause undesirable side-effects. May contain emulator abuse. Emulator may be abusive. This product contains glitches known to the state of California to cause egg defects. <Masterjun> I'm just a guy arranging bits in a sequence which could potentially amuse other people looking at these bits <adelikat> In Oregon Trail, I sacrificed my own family to save time. In Star trek, I killed helpless comrades in escape pods to save time. Here, I kill my allies to save time. I think I need help.
Post subject: Re: Depixelizing emulators
Site Admin, Skilled player (1250)
Joined: 4/17/2010
Posts: 11468
Location: Lake Char­gogg­a­gogg­man­chaugg­a­gogg­chau­bun­a­gung­a­maugg
Ramzi wrote:
How hard would it be to pull the sprites from a ROM at startup, depixelize them, save them to a hashmap or something, and render them instead of the original sprites?
ThunderAxe31 wrote:
By the way, I think it would be impossible to implement such thing in an emulater without getting CPU use about 1 million times heavier.
Putting bitmaps on top of background takes little processing power. If the depixelized sprites are indeed taken from the ROM and saved separately, this is pretty doable (with some code tweaks probably):
gui.gdoverlay([int dx=0, int dy=0,] string str [, sx=0, sy=0, sw, sh] [, float alphamul=1.0])
gui.image    ([int dx=0, int dy=0,] string str [, sx=0, sy=0, sw, sh] [, float alphamul=1.0])
gui.drawimage([int dx=0, int dy=0,] string str [, sx=0, sy=0, sw, sh] [, float alphamul=1.0])
There's even this: http://forums.nesdev.com/viewtopic.php?f=3&t=9935
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Joined: 3/25/2004
Posts: 459
This looks great. https://youtu.be/NfqtOXZoyVo
Post subject: Re: Depixelizing emulators
Editor, Reviewer, Skilled player (1352)
Joined: 9/12/2016
Posts: 1646
Location: Italy
feos wrote:
Putting bitmaps on top of background takes little processing power. If the depixelized sprites are indeed taken from the ROM and saved separately, this is pretty doable (with some code tweaks probably):
gui.gdoverlay([int dx=0, int dy=0,] string str [, sx=0, sy=0, sw, sh] [, float alphamul=1.0])
gui.image    ([int dx=0, int dy=0,] string str [, sx=0, sy=0, sw, sh] [, float alphamul=1.0])
gui.drawimage([int dx=0, int dy=0,] string str [, sx=0, sy=0, sw, sh] [, float alphamul=1.0])
There's even this: http://forums.nesdev.com/viewtopic.php?f=3&t=9935
Ok, it's not impossible, but it would still require a lot of time because every game's sprites would have to be processed differently. Using a single method for rendering any game would be ineffective, not to mention that the render mothod(s) would be very arbitrary. Also, emulators used for TASes are built in order to get emulation accuracy, in order to be the most faithful to the actual platform, so this topic has probably little to do with TASing.
Ramzi wrote:
This looks great. https://youtu.be/NfqtOXZoyVo
Ok, it's interesting, but at this point wouldn't be better to work on DS/Wii ROM hacking?...
my personal page - my YouTube channel - my GitHub - my Discord: thunderaxe31 <Masterjun> if you look at the "NES" in a weird angle, it actually clearly says "GBA"
Joined: 3/25/2004
Posts: 459
Joined: 3/25/2004
Posts: 459
The pixel shading method is general. And for other sprites, individual HD models can be set. It shouldn't affect emulator performance. Even if it were to take forever to render, more beautiful movies could be made. It doesn't affect the game physics any. Viewers could choose to watch the original or the graphically enhanced TAS.
Post subject: Re: Depixelizing emulators
Editor, Skilled player (1437)
Joined: 3/31/2010
Posts: 2106
Ramzi wrote:
Hay guyz, http://johanneskopf.de/publications/pixelart/ How hard would it be to pull the sprites from a ROM at startup, depixelize them, save them to a hashmap or something, and render them instead of the original sprites? Make emulators at movies beautiful.
I can't speak for every system, but in many games, sprite data for characters is cut up into small chunks and only assembled on the screen at runtime, as seen here. Running the smoothing algorithm on the individual sprite chunks would likely result in suboptimal results, as the algorithm doesn't know where edges are supposed to meet. It's generally impossible to tell beforehand how sprites are supposed to combine ingame without applying game-specific knowledge. If you try to run the smoothing algorithm on the combined sprites at runtime, you still might not know which sprites are supposed to go together, like when Mario overlaps with a goomba. For better results, you will have to develop a game-specific solution, and apply the new renderer into your emulator of choice. It gets unweildy very quickly if you want to do it for more than one game. You may be better served by just enabling HQ2X on your games, but that only does so much.
Joined: 3/25/2004
Posts: 459
Is there a way to apply it to the final screen render? How does RetroArch do it?
Joined: 7/2/2007
Posts: 3960
Yeah, sprites on the NES are actually 8x8, so accomplishing anything of significant size requires large numbers of sprites working in unison.
Ramzi wrote:
Is there a way to apply it to the final screen render?
You'd then have the problem of the smoothing algorithm "smoothing" sprites into the background, I suspect. That article you linked has been talked about here in the past; it made quite a splash the first time with people theorizing about how it might be applied to encodes. The fact that nobody followed through on it suggests that it's more difficult to achieve than you'd first think. I'm not saying it's impossible, nor that the prior discussions mean that a new discussion isn't worth having; I just want you to be aware.
Pyrel - an open-source rewrite of the Angband roguelike game in Python.
Joined: 3/25/2004
Posts: 459
So how does RetroArch do it?
Dwedit
He/Him
Joined: 3/24/2006
Posts: 692
Location: Chicago
The HQx series is nowhere near the XBR series. XBRZ and SuperXBR are the leaders for now, depending on what you are scaling. Screenshot of Sonic 1 using 4xBRZ: http://i.imgur.com/Ri9o177.png
Post subject: Re: Depixelizing emulators
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Ramzi wrote:
How hard would it be to pull the sprites from a ROM at startup, depixelize them, save them to a hashmap or something, and render them instead of the original sprites?
Uh... Thanks, but no thanks. The official Mario64 encode is hideously ugly enough. We really don't need the same for any other game!
Spikestuff
They/Them
Editor, Publisher, Expert player (2630)
Joined: 10/12/2011
Posts: 6435
Location: The land down under.
You know. Just mainly because you completely avoided responding to a post that was especially made for you to respond to. Since, I don't want to repeat it word for word, with a quote and because it was actually dedicated to that discussion at that place, and you're bringing it up here once more, I'll just link my post here about the original discussion and wait for your response. Be sure to respond at the dedicated place which is where it all started, which is not this thread thanks.
WebNations/Sabih wrote:
+fsvgm777 never censoring anything.
Disables Comments and Ratings for the YouTube account. Something better for yourself and also others.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Spikestuff wrote:
You know. Just mainly because you completely avoided responding to a post that was especially made for you to respond to. Since, I don't want to repeat it word for word, with a quote and because it was actually dedicated to that discussion at that place, and you're bringing it up here once more, I'll just link my post here about the original discussion and wait for your response. Be sure to respond at the dedicated place which is where it all started, which is not this thread thanks.
You seem to have some kind of attitude problem. The original poster asked about changing the graphics of games, and I expressed my disapproval of it. I find those modified graphics ugly to the extreme, and I believe I'm entitled to express my opinion. What exactly do you want? Everybody to simply agree with it? Is disagreement not allowed here anymore? Who decides what is and isn't an appropriate topic to disagree with? You?
Samsara
She/They
Senior Judge, Site Admin, Expert player (2098)
Joined: 11/13/2006
Posts: 2821
Location: Northern California
There's disagreeing with something and then there's beating people over the head with your disagreement until they agree just to shut you up. Take a moment to reflect on your actions and your experiences with the site and categorize yourself accordingly.
TASvideos Admin and acting Senior Judge 💙 Currently unable to dedicate a lot of time to the site, taking care of family. Now infrequently posting on Bluesky
warmCabin wrote:
You shouldn't need a degree in computer science to get into this hobby.
Invariel
He/Him
Editor, Site Developer, Player (171)
Joined: 8/11/2011
Posts: 539
Location: Toronto, Ontario
There's also twisting a conversation from the question asked by the poster to "hey, let me just step in for a moment to express my disapproval".
Warp wrote:
The original poster asked about changing the graphics of games, and I expressed my disapproval of it.
No.
Ramzi wrote:
How hard would it be to ...
Not, "Hey, should I ..." or "Would anyone be offended if I ...". This, specifically, isn't an opinion question as to the end result, it's an opinion question of the difficulty of the task.
I am still the wizard that did it. "On my business card, I am a corporate president. In my mind, I am a game developer. But in my heart, I am a gamer." -- Satoru Iwata <scrimpy> at least I now know where every map, energy and save room in this game is
Joined: 3/25/2004
Posts: 459
Everybody get naked. This shit is amazing: https://youtu.be/GSeLdQASixE
Noxxa
They/Them
Moderator, Expert player (4107)
Joined: 8/14/2009
Posts: 4089
Location: The Netherlands
Ramzi wrote:
Everybody get naked. This shit is amazing: https://youtu.be/GSeLdQASixE
This has nothing to do with emulation anymore.
http://www.youtube.com/Noxxa <dwangoAC> This is a TAS (...). Not suitable for all audiences. May cause undesirable side-effects. May contain emulator abuse. Emulator may be abusive. This product contains glitches known to the state of California to cause egg defects. <Masterjun> I'm just a guy arranging bits in a sequence which could potentially amuse other people looking at these bits <adelikat> In Oregon Trail, I sacrificed my own family to save time. In Star trek, I killed helpless comrades in escape pods to save time. Here, I kill my allies to save time. I think I need help.
Joined: 10/14/2013
Posts: 335
Location: Australia
The best way I've found to achieve such a thing is to do it to the whole video. As mentioned by scrimpeh, sprites are often broken up into tiles and that causes quite a lot of abnormalities if you apply it on a per-sprite basis. PointSize for AVISynth is very effective at doing this. xBRZ(scale=6) is what I use when I'm after this specific effect. A while ago I often did personal encodes for my own viewing with one audio track and three video tracks - one with the original pixel output point-scaled up, one with xBRZ and one with a scanline/CRT simulated effect. It was time consuming, but I could switch through several ways of viewing the video as I watched it and I quite enjoyed that.
I'm not as active as I once was, but I can be reached here if I should be needed.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Samsara wrote:
There's disagreeing with something and then there's beating people over the head with your disagreement until they agree just to shut you up. Take a moment to reflect on your actions and your experiences with the site and categorize yourself accordingly.
MOD EDIT: This sort of bickering is not helping anyone's case, so please drop this sub-conversation (this goes for each of you). Stick to the topic. -Mothrayas
Joined: 3/25/2004
Posts: 459
It'd be nice if games could automatically be rendered in Unreal Engine 4.
Noxxa
They/Them
Moderator, Expert player (4107)
Joined: 8/14/2009
Posts: 4089
Location: The Netherlands
Ramzi wrote:
It'd be nice if games could automatically be rendered in Unreal Engine 4.
High-definition textures, models, and particle effects don't come out of nowhere.
http://www.youtube.com/Noxxa <dwangoAC> This is a TAS (...). Not suitable for all audiences. May cause undesirable side-effects. May contain emulator abuse. Emulator may be abusive. This product contains glitches known to the state of California to cause egg defects. <Masterjun> I'm just a guy arranging bits in a sequence which could potentially amuse other people looking at these bits <adelikat> In Oregon Trail, I sacrificed my own family to save time. In Star trek, I killed helpless comrades in escape pods to save time. Here, I kill my allies to save time. I think I need help.