a 3D video filter for SNES

This is for people involved in the developement of Snes9x, or SNES emulators in general.
BUG REPORTS BELONG IN TECH SUPPORT/BUG TRACKING!
Post Reply
industrai
Snes9x White Belt
Posts: 7
Joined: Wed Feb 09, 2011 11:13 pm

a 3D video filter for SNES

Post by industrai »

I'm wondering if it would be possible to display the 5 layers and sprites and in 3D to provide a sense of depth. If you've ever played a Virtual Boy game, you've seen the depth effect and have an idea of what I'm talking about.

I made a mock up 3D image of a game that makes use of layers, Joe & Mac. I took a screenshot of each layer, then in a photo editor pasted them side by side and moved each layer 5 pixels to the left or right.

Image

To see the effect, cross your eyes slightly until you see a dot in the center bottom, then look up at the image that appears in the center.
industrai
Snes9x White Belt
Posts: 7
Joined: Wed Feb 09, 2011 11:13 pm

Post by industrai »

also sorry if this hurts your eyes ;)
SparroHawc
Official Android Porter
Posts: 303
Joined: Mon Feb 07, 2011 9:20 pm
Location: All up in your business

Post by SparroHawc »

Unfortunately there's no really effective way to do this without specific emulator settings for each game or game engine. Different games will deal with parallax in different ways, and on top of that, you would need to shift the background each time a new screen loads AND make the background images slightly wider or restrict the traversable areas a bit l. It's a minor gain for a lot of work, and it would have to be repeated for every ROM.

Sorry. :/
industrai
Snes9x White Belt
Posts: 7
Joined: Wed Feb 09, 2011 11:13 pm

Post by industrai »

If the offset was adjustable per game, it could still be useful. There could even be a repository of conf files for games, user created. I could see the 3D community getting into this.
SparroHawc
Official Android Porter
Posts: 303
Joined: Mon Feb 07, 2011 9:20 pm
Location: All up in your business

Post by SparroHawc »

industrai wrote:If the offset was adjustable per game, it could still be useful. There could even be a repository of conf files for games, user created. I could see the 3D community getting into this.
It's not even just a matter of adjustable offset. It's the method that you'd have to use to -get- the offset in the first place - there's a lot going on behind the scenes, and you'd have to dig into the ROM's programming to figure out what has to be done. Without having access to the source code that was used to make the ROM in the first place, you'd have to decompile the thing, work through the machine code to find what needs to be tweaked (which would require the expertise of a ROM-hacking god), and try the tweak and hope like the dickens that it doesn't make things break horribly. Somehow, you'd have to fool the game into thinking that you're a bit left (or right) of where you're actually standing. This simply isn't feasible.

Once you have that, as long as it doesn't negatively affect anything, it wouldn't be all that difficult to rig up a custom emulator that runs two sessions side-by-side, the hacked version and the regular version. But even then, you'll run into issues with the far left and far right side of the playing field hitting the 'edge' and killing your 3D as the game proceeds to stop at the same place on both screens instead of having the offset that's so necessary for the effect to work.

It's easy to make a game that uses an established 3D graphics library into proper stereoscopic 3D, such as OpenGL or Direct3D. Cobbling stereoscopy into a game that has no support for anything but 2D is difficult at best, futile at worst.
industrai
Snes9x White Belt
Posts: 7
Joined: Wed Feb 09, 2011 11:13 pm

Post by industrai »

I understand that each game is different, but couldn't something rudimentary be built without having to work perfect for each game right off the bat?

In snes9x you can press 1-5 to turn on and off the layers of any game. Would you really need to dig into each rom's programming to offset those layers, say ctrl+1+up and ctrl+1+down to increase the offset on layer 1 etc.?
industrai
Snes9x White Belt
Posts: 7
Joined: Wed Feb 09, 2011 11:13 pm

Post by industrai »

Perhaps this will be a more popular topic once snes emulation comes to the 3DS
User avatar
kolechovski
Snes9x Brown Belt
Posts: 1100
Joined: Fri May 28, 2004 6:16 pm

Post by kolechovski »

I think computer software would have to be wayyyyyyyyyyyyyyyy more developed before you could really consider soemthing like this relistically (at least for this to be automatic, which would be best). Perhaps someday, but still years down the road at the earliest.
The soldier was forced to desert his dessert in the desert.
industrai
Snes9x White Belt
Posts: 7
Joined: Wed Feb 09, 2011 11:13 pm

Post by industrai »

kolechovski wrote:I think computer software would have to be wayyyyyyyyyyyyyyyy more developed before you could really consider soemthing like this relistically (at least for this to be automatic, which would be best). Perhaps someday, but still years down the road at the earliest.
I don't think computer software has to be way more developed for this to happen. The layers are there, the emulators can detect them, and enable/disable them with a simple keystroke. I don't believe it would be that much more difficult to offset the layers. It doesn't have to be automated, it could be user controlled, and saved per game as a txt file, and exported for future gamers.
SparroHawc
Official Android Porter
Posts: 303
Joined: Mon Feb 07, 2011 9:20 pm
Location: All up in your business

Post by SparroHawc »

Automatic detection is more the issue - adjusting it by hand just seems messy, and very hack-ish. It also simply doesn't fit the objective of SNES9x as well, which is accurate emulation and portability.

Now, if you can pick out the parts in the source code pertaining to drawing of backgrounds, I might be able to throw something together - but I haven't delved very far into the source myself. It's an interesting idea for a hack though.
industrai
Snes9x White Belt
Posts: 7
Joined: Wed Feb 09, 2011 11:13 pm

Post by industrai »

Doing a quick search for BG1, I see in gfx.cpp the following:

void RenderScreen (uint8 *Screen, bool8 sub, bool8 force_no_add, uint8 D)
{
bool8 BG0;
bool8 BG1;
bool8 BG2;
bool8 BG3;
bool8 OB;

GFX.S = Screen;

not sure if that is a good starting point or not.
SparroHawc
Official Android Porter
Posts: 303
Joined: Mon Feb 07, 2011 9:20 pm
Location: All up in your business

Post by SparroHawc »

It just might be. I'll give it a look when I have a chance.
Post Reply