red-green stereoviewing

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
c.h.r.i.s
Posts: 41
Joined: Mon Jan 22, 2007 8:38 pm

red-green stereoviewing

Post by c.h.r.i.s »

Hi! Last night i had an idea. How can i made the whole scene black and green like black and white? And how can i transparently lay the same scene over the existing scene moved a few pixels up and left and displayed in black-red. Than you could use a green-red eyeglasses like in 3d-cinemas.
This is one kind of stereo viewing.

I hope you can understand this idea because my english knowledges are not so good.

1. change color of whole scene to green
2. copy the whole scene , move it a few pixels , change color to red and make it transparent
3. than draw anything

Any ideas?
bobo87
Posts: 6
Joined: Mon Jul 04, 2005 3:52 pm
Location: Presov, Slovakia

Post by bobo87 »

Stereo viewing is not only about overlaying two shifted color scenes. You must render two scenes from two points(eyes-one point for one scene), use color mask (for example red and blue) and mix them at the same position.

I'm not sure, I'm right, but I think yes. :twisted:

sorry my bad english :)
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

You must move the camera and render again, not the scene in 2D pixels. This is because you are supposed to be simulating 2 eyes. (Further objects are further seperated on the 2D plane, closer objects are close together, try it in real life :P ) So basically, you have to render a scene, tint it, and then render another scene, tint that, and blend them together. Maybe possible with shaders? (Come on sio2, I know you want to :D )

Anyway, this was discussed a while ago and I think an important feature was missing. But that I managed to enable it using the driver config of my NVidia card so no need to actually code your own stereo driver...(Not sure about ATI tho i could not find anything that worked for my 9200...)
sio2
Competition winner
Posts: 1003
Joined: Thu Sep 21, 2006 5:33 pm
Location: UK

Post by sio2 »

BlindSide wrote:So basically, you have to render a scene, tint it, and then render another scene, tint that, and blend them together. Maybe possible with shaders? (Come on sio2, I know you want to :D )
Very, very easy to do with shaders: render the left eye-point to one rendertarget - pixel shader stores only red; render the right eye-point to another rendertarget - pixel shader stores only blue; use a pixel shader to combine the two into the frame buffer; put on your red/blue or red/green anaglyph glasses. 8)

If I can dig out a pair of anaglyph glasses I can code this up. :mrgreen:
c.h.r.i.s
Posts: 41
Joined: Mon Jan 22, 2007 8:38 pm

Post by c.h.r.i.s »

hi! I know that it have to work because i did an experiment about this. I used a photo program to make a picture red and green then i printed it on two transparent foils and put them together. It works and it is like 3d. I think i dont need 2 different viewpoints. I think it is only an optical deception.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

The effect that you get with a single image with a shifted viewpoint is not as good as what you get with two different viewpoints. Without two different viewpoints, you won't have any parallax effect. Objects that are further away from the camera will appear to be shifted by the same distance as objects that are near the camera.

You can easily see the effect with a simple experiment. Hold your finger up at arms length. Close your right eye and open your left eye. Now close the left and open the right. Notice that your finger doesn't appear to move much. Now put your finger close to your eyes, just past the end of your nose and repeat the eye blinking steps. Notice that your finger 'moves' quite a distance. You can't properly simulate that by shifting a 2d image, unless image only shows objects in the same depth range.

Travis
Robert Y.
Posts: 212
Joined: Sun Jan 28, 2007 11:23 pm

Post by Robert Y. »

As Vitek explains, shifting the same image and giving them different colours will result in a 3D picture. HOWEVER, it will be like a floating photograph: if you move a photograph nearer to your eyes, it doesn't suddenly have depth info in it. You simply see the complete photograph nearer.

Believe me, as I'm publishing several software utilities with stereoscopic options, you HAVE to use TWO different viewpoints to achieve a depth perception. Hey, and if you don't believe what the others also tell you, just spend a few days coding what you want and then read this forum again :twisted:
Quadorrli
Posts: 6
Joined: Tue Jul 29, 2008 3:31 pm
Location: Winti

Post by Quadorrli »

does anyone have a snipplet of how to make anaglyph work?
much appreciated.
Post Reply