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.
Post Reply
ludm
Gnoblar
Posts: 18
Joined: Thu Jul 10, 2008 9:37 am

Re: Stereo vision manager [now as a plugin]

Post by ludm »

I have put SM_ANAGLYPH, it builds but It crash when I run

When I run with F5 I have the error :
Exception non gérée à 0x10b36ae6 dans Demo_Fresnel_stereo_stereo_d.exe : 0xC0000005: Violation d'accès lors de la lecture de l'emplacement 0x00000008.

I have tried to run the application with the exe, it crashes also
Here is the log file :

Code: Select all

14:44:20: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/GenerateVS: CG ERROR : The compile returned an error.
(0) : error C6015: Output 'POSITION' not completely written
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
14:44:20: High-level program Ogre/ParticleGS/GenerateVS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/GenerateVS: CG ERROR : The compile returned an error.
(0) : error C6015: Output 'POSITION' not completely written
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
14:44:20: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayVS: CG ERROR : The compile returned an error.
(249) : warning C7050: "output.color" might be used before being initialized
(0) : error C6015: Output 'POSITION' not completely written
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
14:44:20: High-level program Ogre/ParticleGS/DisplayVS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayVS: CG ERROR : The compile returned an error.
(249) : warning C7050: "output.color" might be used before being initialized
(0) : error C6015: Output 'POSITION' not completely written
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
14:44:20: OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayPS: CG ERROR : The compile returned an error.
(323) : fatal error C9999: unexpected cast operation
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
14:44:20: High-level program Ogre/ParticleGS/DisplayPS encountered an error during loading and is thus not supported.
OGRE EXCEPTION(7:InternalErrorException): Unable to compile Cg program Ogre/ParticleGS/DisplayPS: CG ERROR : The compile returned an error.
(323) : fatal error C9999: unexpected cast operation
 in CgProgram::loadFromSource at f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp (line 66)
14:44:20: OGRE EXCEPTION(6:FileNotFoundException): 'stereo.cfg' file not found! in ConfigFile::load at f:\codingextra\ogre\shoggoth_vc9\ogre\ogremain\src\ogreconfigfile.cpp (line 84)
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

only the last line concerns the stereo manager. The manager throws an exception because the file stereo.cfg is not found.
However this should not crash the program because there is a try/catch block
on which line does this crashes ? can you give me the callstack ?
ludm
Gnoblar
Posts: 18
Joined: Thu Jul 10, 2008 9:37 am

Re: Stereo vision manager [now as a plugin]

Post by ludm »

Something is strange, it's written error in file : f:\codingextra\ogre\shoggoth_vc9\ogre\plugins\cgprogrammanager\src\ogrecgprogrammanagerdll.cpp
But I don't any f: device.

Sorry, where can I found the callstack file ?

I have tried to run without the .cfg reading, it crashes also.
I have tried to run with SM_NONE, it runs, but it's not very useful :-)

I have tried to run with SM_DUALOUTPUT, it runs, but I have to try the solution you've written :
Note :
Ogre does not support natively the output in fullscreen on two screens. If you want to use the
dual output mode with two fullscreen displays, you may want to apply this patch to OGRE :
http://sourceforge.net/tracker/index.ph ... tid=302997
However, this manager is completely indepedent from this patch, the dual output mode only needs two viewports,
for example two non-fullscreen windows or a windows with two viewports inside.
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

If you use the SDK version of Ogre, this is normal, this is the path on the machine that compiled ogre (maybe sinbad's machine)
I think it will be easier to help you by Private Message, in french
marc_
Halfling
Posts: 48
Joined: Wed May 21, 2008 7:03 pm
Location: México, CVA

Re: Stereo vision manager [now as a plugin]

Post by marc_ »

hOW DO I COMPILE AND USE THE STEREOmANAGER AS A PLUGIN?. ANY EXAMPLE?
THNKS IN ADVANCE
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

to use as a plugin : compile, add it to plugins.cfg, enable the stereo in the config dialog box
it is as simple a this :)
It will create a stereo.cfg file, just edit it if you want to adjust the parameters

you don't have more control on the plugin. if you want more control, use the manager without the plugin
RByers
Gnoblar
Posts: 6
Joined: Sat Nov 22, 2008 11:07 pm

Re: Stereo vision manager [now as a plugin]

Post by RByers »

I'm currently having issues with the Stereo Manager. When the syststem attempts to initialize the compositor, the system fails, due to a null pointer being returned. I believe this is due to an inability to find the Stereoscopy.compositor file used in the demo, but i am unsure how to rectify the problem. Please advise.
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

have you added the files stereoscopy.material, .compositor and .cg in a resource directory ?
marc_
Halfling
Posts: 48
Joined: Wed May 21, 2008 7:03 pm
Location: México, CVA

Re: Stereo vision manager [now as a plugin]

Post by marc_ »

RByers,if you haven't done it yet try adding the Stereoscopy.material,Stereoscopy.compositor,Stereoscopy.cg to their respective folders in materials,programs, and scripts, if you are using the default resource.cfg, it not, well just add the path to where those directories are, to your resources.cfg, if the porblem persists, checkout the ogre.log, maybe you need also other compositors as well, like the stdQuad_vp.program, or any other, they are found in the media folder inside the OgreSDK directory; and thanks thieum for the answer on how to use it as a plugin :)
RByers
Gnoblar
Posts: 6
Joined: Sat Nov 22, 2008 11:07 pm

Re: Stereo vision manager [now as a plugin]

Post by RByers »

Putting the files into the materials folder worked. I was confused because I was originally able to get the stereoscopy demo working without moving the files (I simply downloaded and compiled), so I assumed I had configured something incorrectly.
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

All the stereoscopy demo needed some files to be put in the resources if you were using the anaglyph mode
anyway, I wrote a readme that will make clear what you should do to run the demo
http://www.axyz-images.com/support/OGRE/stereoscopy.zip

I also corrected a few things (see first post for details)
scyehluke
Gnoblar
Posts: 2
Joined: Sat Jan 31, 2009 9:51 am

Re: Stereo vision manager [now as a plugin]

Post by scyehluke »

Hi,

Could you kindly let me know if "Stereo vision manager" supports
1) shutter glass (ex. Samsung DLP HDTV with shutter glass required)?
2) polarized glass (ex. iZ3D 3D Display with polarized glass required)?

Thanks

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

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

the plugin doesn't support shutter glasses but it will support the polarized screen since it has a dual input interface
NewWorld
Gnoblar
Posts: 7
Joined: Mon Sep 08, 2008 10:46 am
Location: Switzerland
x 1

Re: Stereo vision manager [now as a plugin]

Post by NewWorld »

Can't work for me. I use Ogre 1.6.1 .This Ogre log.

Code: Select all

07:54:28: OGRE EXCEPTION(2:InvalidParametersException): Non-existent local texture name in CompositorInstance::getTargetForTex at ..\src\OgreCompositorInstance.cpp (line 625)
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

This is strange. Have you copied all the stereoscopy resources somewhere in your Media directory ?
Last edited by Thieum on Tue Feb 10, 2009 5:22 pm, edited 1 time in total.
NewWorld
Gnoblar
Posts: 7
Joined: Mon Sep 08, 2008 10:46 am
Location: Switzerland
x 1

Re: Stereo vision manager [now as a plugin]

Post by NewWorld »

Thieum wrote:This is strange. Have you copied the stereoscopy resources somewhere in your Media directory ?

But I only tried it with ogre 1.6.0. I will try it with the version 1.6.1
Yes, I do. I copied Stereoscopy.cg, Stereoscopy.compositor, Stereoscopy.material to resource and loaded it.
Sorry if I forget.
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

I tried it just now and it works perfectly.
Which stereo mode are you using ? are you using the plugin or directly the manager ?
does this version works better : http://www.axyz-images.com/support/OGRE ... ch_nir.zip ?
NewWorld
Gnoblar
Posts: 7
Joined: Mon Sep 08, 2008 10:46 am
Location: Switzerland
x 1

Re: Stereo vision manager [now as a plugin]

Post by NewWorld »

Thieum wrote:I tried it just now and it works perfectly.
Which stereo mode are you using ? are you using the plugin or directly the manager ?
does this version works better : http://www.axyz-images.com/support/OGRE ... ch_nir.zip ?
Sorry for waste time. I use both. It will error.I stupid. Thank you.
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

Huzzah!
New version.

Thanks to Nir Hasson's patch, you can now use the dual output mode with the plugin :
Image
Ogre 1.6.1 is patched but the demo is unmodified
The fps is half the fps when stereoscopy is disabled.


you can get the archive at the same place as usual : http://www.axyz-images.com/support/OGRE/stereoscopy.zip
yijiang
Gnoblar
Posts: 2
Joined: Tue Feb 10, 2009 2:57 pm

Re: Stereo vision manager [now as a plugin]

Post by yijiang »

about hmd
hi thieum,
now i'm doubting if the stereo manager can work correctly with HMD.
In my opinion the manager is designed according to the Off-axis stereo rendering,as the following picture:
off-axis
off-axis
off-axis-dia.jpg (3.76 KiB) Viewed 5793 times
for HMD, however, we should use parallel axes stereo rendering , as the following picture:
parallel
parallel
parallel-dia.jpg (3.82 KiB) Viewed 5792 times
Just as you wrote before, in the anaglpy mode, what is displayed on the screen is exactly what you would see through the screen if it was just _a_ "window" to th virtual world
while for HMD, it should be as if you see through a _pair_ of small windows to the virtual world.

in the anaglphy case, the left view can see more right scene than the right view.
in the hmd case, it's opposite.

i'm not sure if there is any equal relationship between the off-axis stereo rendering and parallel stereo rendering.
thieum, if they are different, there need be some modification in the stereo manager for HMD case.
would you please give me any advices?
thank you in advance.
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

I can split the DUAL_OUTPUT mode in two modes : parallel and off-axis
I think parallel stereo is equivalent to off axis stereo with an infinite focal length. You can try to set the focal length to a big value while I am adding a mode
User avatar
Thieum
Gnome
Posts: 342
Joined: Wed Apr 26, 2006 5:13 pm
Location: Bordeaux, France
x 2
Contact:

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

yijiang> I updated the archive
I added two methods : setFocalLengthInfinite and getFocalLengthInfinite and the config file supports the syntax "Focal length = inf"
it will use parallel frustums
(if you set use setFocalLengthInfinite, getFocalLength will return #INF)

I also added a yellow/blue anaglyph mode
yijiang
Gnoblar
Posts: 2
Joined: Tue Feb 10, 2009 2:57 pm

Re: Stereo vision manager [now as a plugin]

Post by yijiang »

thank you so much! :D
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: Stereo vision manager [now as a plugin]

Post by al2950 »

Hi

Quick question:

Could you or are you planning on adding any supprt for sequential left /right frames for use with devices like 'Vuzix iwear VR290'!? :D

If you did then this plugin would support all the main forms or stereo i can think of!

cheers

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

Re: Stereo vision manager [now as a plugin]

Post by Thieum »

I can add support on demand for any device that doesn't need a specific driver (including the nvidia stereo driver) to work if I have enough specifications.
There is this restriction because the stereo manager is very high level and knows nothing about the display device or even directx/opengl.

The problem with sequential left / right stereo is that this technique often uses a synchronization signal embedded into the VGA signal to tell the device if this frame is for the left or for the right eye. And there is no way the stereo manager can produce such signal. You should use instead the nvidia stereo driver if your system supports it.

I am afraid I cannot help you :(
Post Reply