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 Professional Discussion / Best method for stereoscopic rendering?

Author
Message
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 2nd May 2010 13:09
Hi,

So what is the best method for rendering a stereoscopic scene? I have tried 2 methods, and none worked.

The first I tried is rendering the scene filtered red, then next loop rendering the scene filtered with cyan and so on, but you get a horrible scrape across the monitor.

The second method I tried was with two cameras, where you filter each to the appropriate color, and then fuse the two images together, but it was too slow.


Any help?

TheComet

Van B
Moderator
23
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 2nd May 2010 15:07
There are built in commands to support stereoscopic, both the fancy double screen specs, and those magenta and cyan ones. Works a treat too, just find the newsletter which covered it (one of Lees articles).


Health, Ammo, and bacon and eggs!
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 2nd May 2010 21:03
http://www.thegamecreators.com/pages/newsletters/newsletter_issue_67.html

It works well, I tried a Particles Pack explosion and it really did come out of the screen. I was using the two-colour technique, the commands allow polarised options too.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 2nd May 2010 22:26
Cool, thanks! I'll try it

TheComet

TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 2nd May 2010 23:11 Edited at: 2nd May 2010 23:27
Quote: "commands allow polarised options too"


I'll have to read up how that's done. I've just received half a dozen pairs of different 3D glasses that I ordered on-line.

One of them is a pair of polarized, but I've since discovered that monitors can't create the two differently polarized images - apparently you actually need a projector (or a movie theatre) to do it.

[Edit] Yes - a special monitor is required for polarized 3D. As another downer, I can't use my LCD shutter glasses either - without a faster (120) flat screen monitor. I'll just have to wait until they come down to a reasonable price...

TDK

Neuro Fuzzy
19
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 2nd May 2010 23:53
Quote: "As another downer, I can't use my LCD shutter glasses either"

Awwwwww...
I guess you could write some complicated syncing code, and maybe your own driver, to fix this problem... but... that sucks.


Dia
21
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 3rd May 2010 14:27
Quote: "I've just received half a dozen pairs of different 3D glasses"


ok, now you have me worried.... just how many eyes do you HAVE?

This is not the Sig you are looking for....
The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 3rd May 2010 20:09
I have come across a piece of code somewhere here that actually worked quite nicely. I believe GG at one point was working on a shader to do this as well.

I could try to find the code when i get home if you want.

www.myspace.com/norseblod
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 3rd May 2010 20:23
@ The Viking

That would be great ^^ I just tried what lee said, and it failed. It was rendering it, but not correctly. I also noticed that it was WAY to slow, it ran at like 15 fps.

Is there some other possibility? I suppose that faster computers could take what I coded, but I doubt that many out there have such a good computer.

...

Just tried it on my new computer, it runs smoothly at 66 fps. Maybe it is just my old computer...

TheComet

TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 3rd May 2010 21:02
Quote: "just how many eyes do you HAVE?"


It's more to do with the number of different 3D glasses there are out there actually. Red/Blue, Red/Cyan, Red/Green, Linear Polarized, Circular Polarized and so on.

I just bought one of each as I wasn't sure which I was going to need.

TDK

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 3rd May 2010 21:17
Quote: "without a faster (120) flat screen monitor."


Aww, you can screw it down to 60... Our eye can handle 24 fps without noticing anything, so by coding an engine yourself by switching between both frames at 60 fps, you can run a game at 30 fps and not notice anything.

TheComet

TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 4th May 2010 00:51
Apparently not. It appears to be a requirement of the nVidia Stereo driver you have to use.

And BTW - it's not FPS I'm talking about it's the frequency.

My shutter glasses (which connect to the VGA of the graphics card and use a pass-through for the monitor) need a 120Hz screen (most LCD's - including mine - are 60Hz). They used to work great on my two old 17" CRT monitors.

But, a) they make literally ANY game true 3D and b) are way, way better 3D quality than red/blue anaglyph glasses.

http://en.wikipedia.org/wiki/Liquid_crystal_shutter_glasses

Mine are similar but are quite old now so they have a cable instead of being wireless.

But, I just noticed that on that page it says "In order to achieve an equivalent minimum refresh rate of 120 Hz, an LCD must be able to transition at a speed of not more than 8.33 ms".

I just checked the boxes of my two new 19" and one 22" LCD monitors and they all say they are 5ms. So it might be good news.

I guess the next job is to find a working driver and test them out...

TDK

The Viking
17
Years of Service
User Offline
Joined: 21st Oct 2008
Location: Asgard
Posted: 4th May 2010 04:49
Here is one that I found to be quite wicked. I get about 200 fps on it. you can adjust the variables in game until it looks right. I would give credit to who ever made it, but i don't know who.

www.myspace.com/norseblod
TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th May 2010 09:44
Quote: "And BTW - it's not FPS I'm talking about it's the frequency."


I thought fps meant Frames Per Second, which is a frequency, isn't it?

Anyway, good luck with your shutter glasses

TheComet

Dia
21
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 4th May 2010 14:33
yeah fps is a kind of frequency

but I *think* the glasses that tdk is talking about basically blank one eye several times per second (60 hz for each eye is good, otherwise there is noticable flicker apparently). The display needs to switch between left and right eye display for every frame

its a little complex, but if you think of it as basically two virtual cameras positioned eye width apart, then every sync call you have to get the view from both cameras and then display them in time with the left and right eyepiece on the goggles going black

so basically the game/movie/program/whatever needs to update TWICE (once for each eye) per game frame. For a 60 fps games, you need to produce 60 left eye frames and 60 right eye frames, so the display frequency needs to be 120Hz for a 60fps game

This is not the Sig you are looking for....
TDK
Retired Moderator
23
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 4th May 2010 16:42
Quote: "I thought fps meant Frames Per Second, which is a frequency, isn't it?"


To be honest, it confuses the hell out of me. Think of this:

Say you have an LCD monitor which has a frequency of 60Hz right. In DB, you have a program which sets the Sync Rate to 0 and print the Screen FPS() in the corner.

Now some programs I have like that have displayed 900-1000 fps. But, the monitor is still only capable of 60Hz, so as I see it, 60Hz (frequency) can't be the same as 60fps (framerate)... can it?

But I find it best not to think about it or it makes your head hurt!

And as Dia says, with shutter glasses, the scene has to be rendered twice - once for each eye so this effectively reduces the monitor's frequency by half. With a 60Hz monitor, you are only getting a frequency of 30Hz per eye, resulting in lots of flicker.

That's why all modern shutter glasses drivers just won't work unless they detect a 120Hz monitor attached to the system. Besides that, nVidia seem to have locked all their stereo drivers down to operating with the one brand of glasses... which only they sell.

TDK

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 4th May 2010 19:31
Quote: "Now some programs I have like that have displayed 900-1000 fps. But, the monitor is still only capable of 60Hz, so as I see it, 60Hz (frequency) can't be the same as 60fps (framerate)... can it?"


The FPS defines how fast your main loop is running. The monitor will display a frame, and then send an interrupt to the graphics card for the next frame and so on. This means that the monitor will only pick to display the next frame when it is capable of receiving the next frame, hence your 900 fps game is only going to have every 15th frame displayed.

Quote: "With a 60Hz monitor, you are only getting a frequency of 30Hz per eye, resulting in lots of flicker."


You will be surprised that there will be no flicker. As I said before, our eye will start to detect a flicker at ~ 24 Hz, so 30 Hz will do it. I know this from my first attempt at a stereoscopic view : I alternately rendered one eye per loop, and I didn't notice any flickering.

Most examples for DBC ran at 30 fps too. 60 fps just gives a smoother feeling.

Besides, all TV shows run at <30 fps as well.

TheComet

Login to post a reply

Server time is: 2026-07-28 07:09:00
Your offset time is: 2026-07-28 07:09:00