3D in red/blue filter glasses

Blitz3D Forums/Blitz3D Programming/3D in red/blue filter glasses

Neochrome(Posted 2007) [#1]
I've seen this before, but i habven't actually had the time to work out my own version of this!
how would i go around this?


jfk EO-11110(Posted 2007) [#2]
use two cameras, one at every eyes position . Then render both (one by one). copy both renders to textures that are applied to quads that are aligned pixelperfect in front of the camera. One is fully opaque, the second is half transparent. Use entitycolor to get a greenish and a reddish quad. Then do a final render that contians only the two quads ( eg far off the scene). that's about it. Note some glasses use red/green, some red/blue and some red/green+blue. With entitycolor you can adust this easily.
It may also be nice to add a feature that allows to adjust the distance between the eyes.

EDIT: since speed is always an issue, I'd suggest to optimize the concept this way:
copy the first render to a texture, as described before. Then do the second render with a greenish empty quad in front of the camera, that will color the scene green. Included in this second render is also the first renders semitransparent, reddish quad.

This way you'll save the time it takes to copy one render to a texturebuffer.


H&K(Posted 2007) [#3]
if you have a high enough sync (ie 120 for example or maybe less), you could just use one camera per frame. And just swap them everyframe, then do the filter thing


_33(Posted 2007) [#4]
Question regarding your answer H&K: Isn't Blitz3D's refresh 60hz only? Or could it be that my graphics driver selects 60hz in 3D mode by itself? I haven't been able to have a Blitz3D app run in anything other than 60hz.

Testing refresh rate: http://www.blitzbasic.com/codearcs/codearcs.php?code=2042


Neochrome(Posted 2007) [#5]
hmm, gonna have to look into re-writing my game engine redering! lol... side project i guess

i've seen a demo of this before, but cant remember where or how it owuldbe found
(sorry for slow response... late here in ole england)


H&K(Posted 2007) [#6]
@_33

Humm, Honestly, I dont know ;)

I use Bmax and a variaty of different engines, and was just anwsering on a theoretical level. If you say its 60 Limeted, Ill belive you.
(Ps, Im reading the B3D posts cos Im getting to grips with the sdk)


jfk EO-11110(Posted 2007) [#7]
Hertz depends on the cards settings (rate: 60Hz/normal/optimal) etc., as well as if you're using Flip 1 or Vwait:Flip 0.

What I wonder is: do the 2 cameras have to point to the same location, somewhere 10 yards in front of the player, or will they look straight forward in parallel lines? Or doesn't it matter at all?


jfk EO-11110(Posted 2007) [#8]
And Neochrome, BTW, no offence, those who can read are superior :P check this out:
http://www.blitzbasic.com/codearcs/codearcs.php?code=2008
probaby there are more samples.


Neochrome(Posted 2007) [#9]
Lol.. this is kinda what i was looking for... cheers :)


H&K(Posted 2007) [#10]
I would guess Parallel to each other.


b32(Posted 2007) [#11]
Some videodrivers support anaglypic glasses, for instance for nvidia, you can download stereoscopic drivers that should be able to do this.


Bankie(Posted 2007) [#12]
Unfortunately the nVidia 8 series is not yet supported by the stereoscopic drivers, but older cards should be fine. I recently bought 3D glasses from eDimensional, which work by alternating the image on the screen for left and right eyes, while simultaneously blacking out the relevant side of the glasses. They are interesting, but a pain to set up and a bit of a strain on the eyes. Oh, and they stopped working after a day. Other than that, they're great, though.


El Neil(Posted 2007) [#13]
neochrome, let me know how you get on - i came onto the forum today to find out about the exact same thing as you did!

i have recently built a full-stereoscopic engine, as i am lucky enough to be at a uni with a VR lab and all the associated gubbins which uses polarised light for an extremely deep 3d effect without the need for any expensive glasses. its crazy! however, this cannot be achieved on a "normal" pc without the eye-straining glasses so i am looking into the red/green method instead.

neil


JoeGr(Posted 2007) [#14]
Having played around with various stereo methods in the past (including both anaglyph and LCD shutter glasses) I would suggest that polarized light is definitely the way to go. 'All you need' is an extra monitor and a sheet of half-silvered glass and you can build yourself something like this:

http://www.aldous.net/photo/project08.htm

And here's a slightly more elegant commercial version:

http://www.planar.com/products/flatpanel_monitors/stereoscopic/index.html

EDIT: I just remembered where I originally found the links above. Here:

http://forums.nvidia.com/index.php?s=d2f721a5312adf0fba8fc49b73c919a1&showtopic=32547&st=0


b32(Posted 2007) [#15]
Those links are very helpfull to me, too. Thanks a lot.


Madcap13(Posted 2007) [#16]
I actually did this ages ago. Except I was way cheap.
Instead of going through the trouble of blending the
red and green/blue/whatever together, I did this.

I made an image the same size as the current screensize and it was dithered black and that bright pink
color,<255,0,255>.
Firstly I made the black transparent and I pasted it over
one of the colored cameras. Red, I think.
Then I grabimaged that screen and made the <255,0,255> transparent.
Then I pasted it over the green/blue camera shot.

Then voila! Cheap ass 3d goggle imagery. I remember it being pretty darn fast too.


Jonathan Nguyen(Posted 2007) [#17]
This probably won't help but might be something fun.

I wrote this for Mechanized Warfare, it's a simple function that takes a 3D (red-cyan) screenshot using brute force. Just call the function in your loop after RenderWorld with the key scancode you want for your equivalent PrintScreen and plug in the appropriate values (depends on your world scale).




El Neil(Posted 2007) [#18]
Madcap, I toyed with the idea of masking occasional pixels for each eye when i was doing the polarised light engine, but how did you set up your cameras for the the red/green version? did you have them rendering side by side, or overlaid? did you have to put red/green filters on the camera "lenses"? if so, how?


thanks,

Neil


Madcap13(Posted 2007) [#19]
well, I... <thinks back>
I had two cameras. I think they were children of a pivot,
which I would rotate, etc.
For the red/greeness, I had a box which fit around
both cameras. It was full-bright, etc.
If I wanted a red camera shot, I'd turn the box red
then render.
If I wanted a green camera shot, I'd turn the box green
then render.
I changed the boxes entityorder, so that it would always
be rendered in front of everything else.
I changed the entityblend for it so it would blend subtractively.

pretty simple really. :)


El Neil(Posted 2007) [#20]
brilliant, thank you

i tried it with 2 sprites, red and green, turning them on/off to get the different colors. however, the dithered image was appearing through the sprites, cos i didnt use entityorder.

will try this now. thanks again

neil


Chroma(Posted 2007) [#21]
Hey Johnathan you forgot to include the BitToComponent and ComponentToBit functions. :(