Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Anaglyphic 3d anyone?

Author
Message
Dietrich
14
Years of Service
User Offline
Joined: 15th Aug 2009
Location:
Posted: 18th Aug 2009 03:00
I was wondering if there was any way to incorporate anaglyph 3d into Darkbasic games?This would be awesome for a 2d sidescroller I'm working on,it would really make the characters pop!
Cheers,
NiK Dietrich.

"Don't practice 'til you get it right,practice 'til you never get it wrong."
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 18th Aug 2009 04:06
Check out this discussion to perhaps get you started:

anaglyph

Enjoy your day.
pr0fess0r cha0s
15
Years of Service
User Offline
Joined: 6th Oct 2008
Location:
Posted: 1st Sep 2009 05:56
I think that anaglpyh side scrolling is going to be tough. I'm guessing that you already have a game with 2d sprites or something. The following is a theory that I have not tested for such a scenario.

1.Create a bitmap of the screen and save it to memory.

2.move all objects of each depth to the left a certain amount depending on their distance into the screen or oppositely if they are coming out of the screen. If they are at the same perceived distance of the screen, do nothing, except maybe outline them slightly so they don't seem to different from the 3d graphics. then somehow extract the red or blue channel (i'm not sure how), and save that as a bitmap.

3.perform opposite movements away from the norm for the opposite color. save screen as a bitmap.

4.fade the colored bitmaps. You will have to experiment with this.

5.Load all bitmaps to the screen, with the colored bitmaps faded on top of the normal one.

This of course has to be repeated every screen refresh. You may have to tune it so that it displays the combined bitmaps longer than the process of combining them so that it appears fluid. Hopefully the computer will be able to retain really high fps while doing this. Another problem with this is actually extracting the red and blue channels from your bitmap, and doing that with the colors offset for specific glasses/displays. You may have to use the DBC command line functions to call another program that can do that accurately and efficiently and perhaps output it to db somehow. Also, combining the bitmaps might require additional software too using the lock and unlock back buffer commands to access the screen in another program.

In short: 3d will be easier than 2d.
In 3d, I just make a copy of the object for each color, offset it it, dump all of the textures, make it blue or red, and ghost it. 2d will require actual bitmap modifications to appear accurate and retain shading. The outline of the 2d object could perhaps be more easily made 3d, but the object would lose a lot of shading detail in the offset color versions.

The original color bitmaps might be problematic. You might want to display only the red and blue versions faded together.

If anyone knows of a better method for 2d anaglyphs in DBC I would like to know the details. I know that just about any dev software outside of DBC would make this easier, like dbpro.

Here is a great program that you might want to study:

http://www.stereoeye.jp/software/index_e.html

Also, I would suggest looking at lots of anaglyphs and seeing how they were made.

I am really interested in seeing if anyone has a better or working theory for 2d anaglyphs, or anaglyphs in general.

There are 10 types of people in the world: those who understand binary, and those who don't.

Login to post a reply

Server time is: 2024-05-09 12:05:49
Your offset time is: 2024-05-09 12:05:49