Stereo vision manager [now as a plugin]

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
murderv
Greenskin
Posts: 105
Joined: Tue Jun 26, 2007 12:20 pm

Re: Stereo vision manager [now as a plugin]

Post by murderv »

Hi Thieum,

We have achieved recently this 3d LCD tv http://www.pixelution.co.uk/products/co ... nitor.html and i plan to give it a try. I was wondering, how can i get Stereo Plugin to be used for such a monitor ?

It does not support dual output mode, so i think it must be a mix of the two images, kinda like Anaglyph, no ?

Would love to know your ideas on this subject..

Thanks in advance,
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

From the technical specs of the monitor :
Compatible with Line-by-Line and Side-by-Side 3D signal inputs
I think it will work with the modes INTERLACED_HORIZONTAL ("Line-by-Line") or DUALOUTPUT ("Side-by-Side") if you create two viewports side by side on the same render window
murderv
Greenskin
Posts: 105
Joined: Tue Jun 26, 2007 12:20 pm

Re: Stereo vision manager [now as a plugin]

Post by murderv »

Thanks thieum,
I will have to give that a test. Not sure if there are advantages of one over the other, but i think the simpler one to test would be INTERLACED mode..
the other seems to need more work done.

Thanks
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

3D input

HDMI x3
1080 24p, 50p, 60p, 50i*, 60i*
*50i and 60i only for side-by-side
The line by line mode should be better if you can use 60p instead of 60i
stevygee
Gnoblar
Posts: 9
Joined: Thu Nov 05, 2009 11:17 pm

Re: Stereo vision manager [now as a plugin]

Post by stevygee »

I'm interested in getting this to work for 1.7, but when I try to compile the plugin I get:

Code: Select all

1>.\StereoPlugin.cpp(62) : error C2100: illegal indirection
1>.\StereoPlugin.cpp(62) : error C2440: 'initializing' : cannot convert from 'const Ogre::RenderSystemList' to 'Ogre::RenderSystemList &'
1>        Conversion loses qualifiers
The error occurs at:

Code: Select all

	RenderSystemList& renderSystemList = *Root::getSingleton().getAvailableRenderers();
	for (size_t i = 0 ; i < renderSystemList.size() ; i++)
	{
		RenderSystem * renderSystem = renderSystemList[i];
		ConfigOptionMap& configOptionMap = renderSystem->getConfigOptions();
		configOptionMap[mOptEnableStereo.name] = mOptEnableStereo;
	}
Found this on the forums: http://ogre3d.org/forums/viewtopic.php? ... 15&start=0
User avatar
calsmurf2904
Orc
Posts: 401
Joined: Tue Sep 16, 2008 9:39 pm
Location: Netherlands

Re: Stereo vision manager [now as a plugin]

Post by calsmurf2904 »

I think this will do it:

Code: Select all

const RenderSystemList& renderSystemList = Root::getSingleton().getAvailableRenderers();
for (size_t i = 0 ; i < renderSystemList.size() ; i++)
{
   RenderSystem * renderSystem = renderSystemList[i];
   ConfigOptionMap& configOptionMap = renderSystem->getConfigOptions();
   configOptionMap[mOptEnableStereo.name] = mOptEnableStereo;
}
Visit my blog at http://calsmurf2904.wordpress.com !
Got a Google Wave account? Add me as contact! (projectxgame <at> gmail <dot> com)
Image
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

Yes, this works

If you want, I added property sheets to the project to make it easier to support both ogre 1.6 and 1.7
you just have to select the right vsprop in the property manager, set the user macro OGRE_SRC to you ogre directory and everything should compile smoothly
Ah, and uncomment the right const RenderSystemList& renderSystemList = (*)Root::getSingleton().getAvailableRenderers(); line

And I dropped vs2005 project files. The .cpp and .h files will of course always work
stevygee
Gnoblar
Posts: 9
Joined: Thu Nov 05, 2009 11:17 pm

Re: Stereo vision manager [now as a plugin]

Post by stevygee »

I'm now using the StereoManager with 1.7 and I get the stereoscopic effect. In our project we are using deferred shading, is this supported by the StereoManager or are there still known issues? I noticed that spotlights and SSAO wont be rendered at all if the StereoManager is active.

Another thing, I compared the StereoManager with Nvidias 3D Vision in our project. SM gives a much nicer effect, but it also exaggerates red spots in one of my textures, while 3D Vision doesn't do this (and it looks much nicer). Is this on purpose or maybe a bug as a result of working with deferred shading?
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

the stereo manager currently doesn't support well compositors added to the viewport and other post processing effects. There is a conflict between the listeners used by the compositor and the listener used to shift the eyes

Do you use the stereo manager and nvidia 3d vision in anaglyph mode ? the anaglyph mode of the stereo manager is very simple, the one in 3d vision is much better
stevygee
Gnoblar
Posts: 9
Joined: Thu Nov 05, 2009 11:17 pm

Re: Stereo vision manager [now as a plugin]

Post by stevygee »

Sorry, forgot to mention that: Yes, we want to use anaglyph mode. I'm going to do some more tests with 3D Vision...
Netich
Halfling
Posts: 40
Joined: Tue Oct 06, 2009 8:52 am

Re: Stereo vision manager [now as a plugin]

Post by Netich »

Hi, im using StereoManager in my aplication, which uses two webcams as inputs.
Im trying to put each frame in the left/right render, but i cant find the right way. What i would need is to change the texture of my 2D background before StereoManager merges the two sides. Is this possible with current implementation?

Another doubt i have is that i have to use a custom projection matrix (off-axis) for my viewport, as i have to match the webcams fustrum i get by calibration. Do you think i will have problems with this? I still can't test it becouse of problem above.

If there are limitations in stereoManager for what i want to do, ill be glad to try to find a solution, and post it here (or send them to thieum)
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

Yes, you can display one webcam texture for each eye.

you can create two separate objects and each one will use a material that reference the texture of the according webcam
then you have to use the visibility flags of the renderables with MovableObject::setVisibilityFlags and the visibility mask of the stereo manager with StereoManager::setVisibilityMask
for example :

Code: Select all

		const uint32 LEFT_FLAGS = 0x1;
		const uint32 RIGHT_FLAGS = 0x2;
		const uint32 LEFT_MASK = ~LEFT_FLAGS;
		const uint32 RIGHT_MASK = ~RIGHT_FLAGS;

		Entity *ent = mSceneMgr->createEntity("left", "cube.mesh");
		ent->setMaterialName("Examples/OgreLogo");
		ent->setVisibilityFlags(LEFT_FLAGS);
		sceneNode->attachObject(ent);

		ent = mSceneMgr->createEntity("right", "cube.mesh");
		ent->setMaterialName("Examples/BeachStones");
		ent->setVisibilityFlags(RIGHT_FLAGS);
		sceneNode->attachObject(ent);

		mStereoManager.setVisibilityMask(RIGHT_MASK, LEFT_MASK);
But I appears that my current implementation of setVisibilityMask is not good enough, I will also post an updated version

The stereo manager currently does not support custom projection matrices, but maybe this can be added.
You still want to be able to change the eye separation, but the frustum offset and the focal length should be driven by your custom matrix, is it right ?

can you try this version : http://www.axyz-images.com/support/OGRE ... Matrix.zip ? I added a method called setCustomProjectonMatrices
Netich
Halfling
Posts: 40
Joined: Tue Oct 06, 2009 8:52 am

Re: Stereo vision manager [now as a plugin]

Post by Netich »

Wow, custom stereo manager! That's what i call customer service... :D

I didnt know about Ogre's masks, and they work like a charm for this. I still have some work to do with the video input, then ill test if it works with Custom Fustrum Viewports. Ill post the results here.

Thank you!
murderv
Greenskin
Posts: 105
Joined: Tue Jun 26, 2007 12:20 pm

Re: Stereo vision manager [now as a plugin]

Post by murderv »

hi,
i'm not sure if this is the place to be, but i will ask anyway..

i'm having trouble changing stereo cameras between different scenes.

i create a common camera in a scene and attach it to a node. when the player ends that scene i want to place the camera into the next scene.

steps:

1. detach camera from previous scene node
2. create node in the next scene and attach the stereo camera to it.

the thing is that it doesn't seem to update.. everything seems to be ok, except that i still see the previous scene being rendered?

any ideas on how to do this?

thanks in advance,
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

First, is it working without the stereo manager ?
And do you use one scene manager or do you create one scene manager per scene ?

When I detach and reattach a camera from a scene node, the view is updated correctly
murderv
Greenskin
Posts: 105
Joined: Tue Jun 26, 2007 12:20 pm

Re: Stereo vision manager [now as a plugin]

Post by murderv »

Hi Thieum, thanks for the reply.

OK, first of all, everything works without the StereoManager. Also, each scene has a unique SceneManager.

For DUALOUTPUT everything was working aswell, what i do is, everytime i need to change to a new scene i destroy my StereoManager and then allocate a new one with a camera/viewport that belongs to the next scene.

Now, what i am trying to do now is do the same, but only with one one Window (INTERLACED MODE, ANAGLYPH). It does not work.

Actually, the first scene works OK, the anaglyph mode is fine, but, when i change the scene it fails. No stereo mode. It just renders as usual (mono).

I've tried to create a camera and attach that camera into different scenes, but it just did not work, because it it attached to a specific SceneManager and i can't find a way to pass cameras between SceneManagers.

I also tried my old method of re-starting the StereoManager everytime i change a Scene & Camera, but that just did not work. First scene works just fine then the first change i made i lose the stereo effect.

what am i doing wrong ?
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

something seems to be wrong with the compositor when you initialize the stereo manager with the second scene manager, but I don't understand what

if you go two times in the same scene (ie, you attach and detach the camera in the same scene manager and you destroy and recreate the stereo manager), does it work ?
murderv
Greenskin
Posts: 105
Joined: Tue Jun 26, 2007 12:20 pm

Re: Stereo vision manager [now as a plugin]

Post by murderv »

Wait... hmm seems like i was doing something stupid before, and it just manifested itself now.

I was destroying the StereoManager object after changing my camera pointer, which crashes on the leftViewport pointer inside the class.

now i allocate StereoManager before entering a new scene and i destroy it just after finishing that scene..

It seems to be working now.. my mistake!

once again thanks, i think i got it..
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

You don't have to destroy the stereo manager. Just calling shutdown() and init() is sufficient
murderv
Greenskin
Posts: 105
Joined: Tue Jun 26, 2007 12:20 pm

Re: Stereo vision manager [now as a plugin]

Post by murderv »

yes that is right. i ended up destroying the pointer, so i could make sure it was done. but now that it works i'll clear that up.
thanks
User avatar
xabila
Goblin
Posts: 225
Joined: Mon Jun 05, 2006 9:40 am
Location: rennes [FR]

Re: Stereo vision manager [now as a plugin]

Post by xabila »

Hi,
I would like to try your stereo plugin.
So i was wondering wich latest version of ogre 1.6 are you supporting?
And is it working with nvidia Nvision for quadro?

Thanks
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

Hi!
It supports ogre 1.6.9 and ogre 1.7
It does not support any specific hardware feature : it doesn't support opengl quad buffer mode because ogre doesn't, and you don't have to use the stereo plugin to enable the nvidia 3dvision stereo in an ogre app (just run it in fullscreen and press ctrl+t)
It supports the stereo modes that don't need any specific feature from the driver or the graphic card
User avatar
xabila
Goblin
Posts: 225
Joined: Mon Jun 05, 2006 9:40 am
Location: rennes [FR]

Re: Stereo vision manager [now as a plugin]

Post by xabila »

Yes but my application is using GTK and GTK don't work with directX right now so i 'm looking for a Quad Buffer stereo version...
Thanks
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

If you use shutter glasses or any other stereo display that need page-flipping stereo, the stereo manage cannot help you
If not, maybe you don't have to use quadbuffer stereo
User avatar
Florin
Kobold
Posts: 33
Joined: Thu Mar 19, 2009 3:15 am

Re: Stereo vision manager [now as a plugin]

Post by Florin »

Hi Thieum,

I receive this assertion when I run the SampleBrowser:

Code: Select all

Asertion failed!

Program: ...
File: ..\Stereomanager.cpp
Line: 58

Expression: mCamera
The scenario that reproduces this assertion is:

"Enable stereo rendering=Yes" in the "ogre.cfg"
Start SampleBrowser application and start a sample

On the other hand I receive a "Don't Send" error when I do the following:

"Enable stereo rendering=Yes" in the "ogre.cfg"
Start SampleBrowser and in Configure panel I change the Enable Stereo Rendering option to false.

Is this happening to you too or it's just a problem of mine ?

Thanks!