VOGONS


First post, by colonny55

User metadata
Rank Newbie
Rank
Newbie

Hello DOSBox developers. I hope I am not breaking any rules. This section seems to be the most appropriate place to post this.

I was wondering about the possibility of developing a graphical filter that would create an anaglyphic effect for DOSBox. The purpose being to be able to play old games in a new way using red and blue paper glasses.

It seems to me a graphics filter would be the best way to do this. The filter would have to create a red and blue tinted version of the graphical image created by DOSBox. It would also have to do a slight positional switch. As a graphical filter it would be optional by default so it wouldn't affect mainstream DOSBox users.

I am aware this would only work for certain games. For example games like Silpheed that are based on CGA or EGA graphics. I think it would be fun to do. Is this idea feasible or is it too far fetched? Let me know what you guys think.

Thank you for your attention.

Reply 1 of 16, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

is the idea of that to get depth in the game ?
As dosbox is totally unaware of what is on the screen, there isn't no way to add depth to certain things.

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 16, by colonny55

User metadata
Rank Newbie
Rank
Newbie
Qbix wrote:

is the idea of that to get depth in the game ?
As dosbox is totally unaware of what is on the screen, there isn't no way to add depth to certain things.

Yes. I was thinking to create something similar to say what RARE did with Rad Racer and 3D World Runner for the original NES. As I understand it to achieve the effect what is only needed is to have a red and blue tint that is alternated between frames (along with a slight horizontal switch). DOSBox would not need to know what is on the screen.

Reply 3 of 16, by Kippesoep

User metadata
Rank Oldbie
Rank
Oldbie
colonny55 wrote:

Yes. I was thinking to create something similar to say what RARE did with Rad Racer and 3D World Runner for the original NES. As I understand it to achieve the effect what is only needed is to have a red and blue tint that is alternated between frames (along with a slight horizontal switch). DOSBox would not need to know what is on the screen.

It would need to know. Without depth information, the perspective of the two images cannot be different, so it would merely result in the entire scene appearing as a flat plane either in front of or behind the monitor.

Reply 4 of 16, by augnober

User metadata
Rank Member
Rank
Member

It would most likely be possible to do this for Glide games, where 3D is rendered via Glide API calls. The Glide implementation could be written to use the depth information to create depth. The key here is that developers could write some code to handle a standard API, and get a bunch of games running in anaglyph mode.

Typically for DOS games though (especially old ones), there is no common 3D API used. The original developers used their own software routines, and hacked away to their hearts' content. In order to get those games working in anaglyph mode, developers would have to reverse engineer the machine code of the game.. and then intercept and/or replace routines at the appropriate times with code that renders in anaglyph mode (and this is somewhat assuming that there really are depth values in the game code rather than trickier illusions or hybrid of some sort.. which would perhaps be more tricky to reverse engineer). So.. It would have to be done on a game by game basis in these cases.. and it's basically too much effort for sane people. I can't really overstate how much work it would be (though I won't go so far as to say that it's impossible, since that would be technically untrue). I can say that there is no general way to do it across games that do not share common rendering routines, and that for DOS games, sharing such code is very much the exception rather than the rule.

I suppose some adventure games (Sierra, Lucasarts, etc.) at least share an engine across games. It probably wouldn't be too extremely difficult to do something silly like make the characters pop out of the scene, but that might be kind of lame and would be much better-handled by ScummVM than DOSBox.

Last edited by augnober on 2009-08-05, 15:37. Edited 3 times in total.

Reply 5 of 16, by colonny55

User metadata
Rank Newbie
Rank
Newbie

Hey thanks for the quick reply guys. The idea is not that 3D advanced 😀

Maybe we are talking about different things, but yes, the effect would be something like what you described. A somewhat emerged flat plane. For that purpose the emulator does not need to know that a certain sprite element is closer or farther away. In my experience with the games I've mentioned the intensity of the effect depends on the colors being used. It would definitely depend the game being played, the colors it uses and its perspective.

Take for example MEKA (sega master system emulator). When it plays games that were designed for use with the SEGA 3D glasses, it only uses one of the frames (removing the positional shift effect). Granted that hardware doesn't use anaglyphic glasses, but I bet MEKA does not know about depth perception either. I hope I am making sense.

EDIT: Here is what I mean. Worth mentioning this game (3D World Runner) purposely does not apply the positional switch and color tint to the status bar. Of course for this idea that would not be the case (or it could if it supported custom tweaking for each game [like augnober suggested]). Although that sounds like it would require more work.

example01.jpg

Last edited by colonny55 on 2009-08-05, 16:02. Edited 3 times in total.

Reply 6 of 16, by augnober

User metadata
Rank Member
Rank
Member

Ah. I suppose it is possible to get some kind of 3D effect sometimes via analysing the framebuffer and handling it according to some presets for the game. In the past that would have been naive, but with fast processors and multicore, there probably are some interesting things that could be done (with still some tweaking required per-game).

After the edit with the screenshots.. I'm less sure that we're on the same page... but assuming that the 3D effect in MEKA actually appears like a few flat layers, perhaps I'm close enough to understanding.

Reply 7 of 16, by colonny55

User metadata
Rank Newbie
Rank
Newbie

I'll try my best to explain. I am not an expert on anaglyphic images so I could be mistaken. As I understand it, to achieve the effect, the graphical filter would have to do:

pseudoloop

1. take a frame and process it to apply a blue tint
2. draw it on the screen on normal position.
3. next frame comes, give it a red tint
4. draw it on the screen, this time shifting it's position a little to the right and/or down.

end loop

This is a very basic, rough draft of how I think it should work. I am assuming this process would appear to the user as the blended image in the photo example I posted. I could be wrong.

Reply 8 of 16, by augnober

User metadata
Rank Member
Rank
Member

From your description, it seems that those SEGA games were in fact specifically developed with shutter glasses in mind. They had to make an effort to generate the correct frames for the left, and then the right eyes.. in sync with the shutters so that the eyes see the appropriate frames. The author of MEKA was then smart enough to see that these could be employed toward an anaglyphic rendering mode (via compositing the left/right eye frames on top of one another as red/blue so that the filters in the glasses make sure the viewer's eyes see the correct frames) so that people can enjoy the games without shutter glasses. Since DOS games weren't written for shutter glasses, your plan doesn't apply to them. All frames are for both eyes, so there's nothing meaningful (in terms of 3D/depth) to extract and employ toward anaglyphic rendering.

Reply 9 of 16, by ADDiCT

User metadata
Rank Oldbie
Rank
Oldbie

This discussion is completely useless. The basic question is: who needs or wants "dirty pseudo 3D"? The simple answer is: no-one at all.

colonny55, if you are convinced your idea works and implementation is possible, feel free to code a filter and submit it to the DOSBox sources.

Other than that i agree with Kippesoep:

It would need to know. Without depth information, the perspective of the two images cannot be different, so it would merely result in the entire scene appearing as a flat plane either in front of or behind the monitor.

"Real" 3D games like Quake or 3DFX games may be a different matter.

This discussion should be in "Milliways", not in the dev forum IMO.

Reply 10 of 16, by colonny55

User metadata
Rank Newbie
Rank
Newbie

From your description, it seems that those SEGA games were in fact specifically developed with shutter glasses in mind. They had to make an effort to generate the correct frames for the left, and then the right eyes.. in sync with the shutters so that the eyes see the appropriate frames. The author of MEKA was then smart enough to see that these could be employed toward an anaglyphic rendering mode (via compositing the left/right eye frames on top of one another as red/blue so that the filters in the glasses make sure the viewer's eyes see the correct frames) so that people can enjoy the games without shutter glasses. Since DOS games weren't written for shutter glasses, your plan doesn't apply to them. All frames are for both eyes, so there's nothing meaningful (in terms of 3D/depth) to extract and employ toward anaglyphic rendering.

The MEKA example just ended up confusing things. MEKA doesn't do anaglyphic but when it is running games meant for the 3D glasses it doesn't know anything the image either (just like DOSBox). That's what I was trying to say.

I am not looking to use shutter glasses. I was asking if the image could be turned into anaglyphic through the use of a filter. The filter would work similar to those Windows software apps from the 90s that would take your pictures and process them into anaglyphic. I was wondering if that could be done in a DOSBox graphics plugin.

Think about games that use red and blue glasses (Rad Racer, 3D World Runner, Contra: Legacy of War). The only way I could show you would be if you could play any of those games yourself. Anyway that's the type of effect I was wondering if it was possible to achieve. I would think if the NES did it then why not DOSBox. Just wish I had the knowledge to do it myself.

Reply 11 of 16, by TeaRex

User metadata
Rank Member
Rank
Member
colonny55 wrote:

...running games meant for the 3D glasses...

And that's the trick. Most DOS games are simply NOT meant for 3D glasses. As such, they lack the left/right frame separation that those SEGA games do have.

tearex

Reply 13 of 16, by augnober

User metadata
Rank Member
Rank
Member

I'm in agreement with the other responses.. ie.. The short answer is that it's not possible. There's more than enough explanation in this thread to explain more now.. but it takes some time on your own to digest it if you haven't dwelled a lot on 3D perception before. It's easier for developers to reach the understanding since they're acutely aware that developers are not magicians and that there's no magic inside. I'm pretty patient though.. which on rare occasion leads to something interesting.

Reply 16 of 16, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

I think I remember someone popping up in here a year or two ago who was doing just that. Never heard from them again tho.

How To Ask Questions The Smart Way
Make your games work offline