Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
On Fri, Jul 5, 2013 at 11:01 AM, Björn Blissing wrote: > Great! > > I have merged your changes. On windows the CMake module path started > searching from the wrong path, so I changed it so that it always starts > searching from the current CMakeLists.txt file directory. > > I also made the style of the CMake files consistent with what OpenSceneGraph > uses. Found and removed some unused CMake code parts as well. > OK, nice. I will check it out later tonight. Jan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
Jan Ciger wrote: > > Just a quick report - I have managed to compile your code and it does > indeed work with the Oculus SDK on Linux. I have send you a pull > request with a modification already. > Great! I have merged your changes. On windows the CMake module path started searching from the wrong path, so I changed it so that it always starts searching from the current CMakeLists.txt file directory. I also made the style of the CMake files consistent with what OpenSceneGraph uses. Found and removed some unused CMake code parts as well. Best regards Björn -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=55148#55148 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 07/04/2013 03:50 PM, Björn Blissing wrote: > I have successfully compiled the source on Linux. Although I only > have terminal access to the linux machine for the moment, so I have > not been able to verify that the program actually works. > > Regarding the question about why I used CompositeViewer. Well the > simple answer was because I started working from a old > render-to-texture code snippet I had laying around on my > harddrive. > > But as Jan says, normally the composite viewer should be used when > you have independent views. So the standard viewer should be more > appropriate. If I get some time I maybe change to a master-slave > camera solution. But my first priority was to get a working example > up and running. > > Best regards > > Björn Just a quick report - I have managed to compile your code and it does indeed work with the Oculus SDK on Linux. I have send you a pull request with a modification already. It is a pity that they didn't include source code for the calibration app - it doesn't run on my Linux due to newer version of udev :( And I do wonder why they didn't use something like CMake to manage the build instead of having 3 (!!) different downloads for Mac, Windows and Linux, all with the same source inside, differing only in the way the build is done and the bundled binaries ... Regards, Jan -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iD8DBQFR1fC+n11XseNj94gRArFOAJ4jHKHTF2vhTgcHTEIJN/Mr7yFKFwCgpDQ0 B7x6nhxRzMbpJSmQAGNdL2A= =s7Kk -END PGP SIGNATURE- ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
Hi, On Thu, Jul 4, 2013 at 3:50 PM, Björn Blissing wrote: > I have successfully compiled the source on Linux. Although I only have > terminal access to the linux machine for the moment, so I have not been able > to verify that the program actually works. I will check that later tonight when I am back home. > But as Jan says, normally the composite viewer should be used when you have > independent views. So the standard viewer should be more appropriate. If I > get some time I maybe change to a master-slave camera solution. But my first > priority was to get a working example up and running. I would be very much interested if you could try the master/slave version. I have all kinds of issues with the slave cameras and I am not sure whether that is a PEBKAC or something more sinister going on. Jan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
I have successfully compiled the source on Linux. Although I only have terminal access to the linux machine for the moment, so I have not been able to verify that the program actually works. Regarding the question about why I used CompositeViewer. Well the simple answer was because I started working from a old render-to-texture code snippet I had laying around on my harddrive. But as Jan says, normally the composite viewer should be used when you have independent views. So the standard viewer should be more appropriate. If I get some time I maybe change to a master-slave camera solution. But my first priority was to get a working example up and running. Best regards Björn -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=55140#55140 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
On Thu, Jul 4, 2013 at 10:32 AM, Björn Blissing wrote: > > My code is available at the following GitHub repo: > https://github.com/bjornblissing/osgoculusviewer > > The latest edition is tested against the SDK 0.2.3 version, which was > released just hours ago. > > Support is added for basic orientation tracking and correction for chromatic > aberration. I have only tested the code on Windows 7 with Visual Studio 2010. > But the latest SDK release has Linux support and I will try to test it when I > get some spare time. > > Best regards > Björn I will test that tonight, the Linux support came right in time :) Jan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
Jan Ciger wrote: > > Sure thing. > > BTW, it would be best to start e.g. a Github repo for this. I am sure > there will be contributors. > Jan > My code is available at the following GitHub repo: https://github.com/bjornblissing/osgoculusviewer The latest edition is tested against the SDK 0.2.3 version, which was released just hours ago. Support is added for basic orientation tracking and correction for chromatic aberration. I have only tested the code on Windows 7 with Visual Studio 2010. But the latest SDK release has Linux support and I will try to test it when I get some spare time. Best regards Björn -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=55132#55132 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hello Björn, On 07/03/2013 05:54 PM, Björn Blissing wrote: > NP! > > I have also made progress with the sensor integration and have > successfully added correction for chromatic aberration in my > shader. I can upload it tomorrow if anyone is interested. > > Best regards Björn I have tested your code and it does work! You have done a good job there. I had to disable all the OVR-related functionality, because the SDK isn't available for Linux yet, but for test it is good enough. However, I am wondering about two things. - - Why a composite viewer? I was trying to do it using a normal viewer, having two RTT cameras and then two ortho cameras rendering into the two halves of the viewport. I thought that composite viewer is more for the case when you have several *independent* views (like the 3-4 views in Blender/3DS Max), not a single one rendered in a specific way (side-by-side stereo). - - The second thing is related - I have noticed that you are manually copying the view matrix to both RTT cameras, despite both views having the camera manipulator assigned. It would be more logical to make the RTT camera slave of the master camera of each view, then the view matrix would auto-update from the camera manipulator and the copying in the main loop wouldn't be needed. I have tried that, but I have a problem with the projection matrix of the slaves being messed up, despite setting the master's projection matrix to identity. Could you test this? I am really wondering whether it is me doing something dumb or whether my OSG is buggy :( Regards, Jan -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iD8DBQFR1K4Wn11XseNj94gRAj48AKCxOfsicFlMnDFV2zkm8qTstVl08ACeI0+Z joL6ujLTGyVPVEVl7PMiv1I= =uLhB -END PGP SIGNATURE- ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
On Wed, Jul 3, 2013 at 5:54 PM, Björn Blissing wrote: > I have also made progress with the sensor integration and have successfully > added correction for chromatic aberration in my shader. I can upload it tomorrow if anyone is interested. Sure thing. BTW, it would be best to start e.g. a Github repo for this. I am sure there will be contributors. Also, it does help to abstract the SDK code a bit away, because the SDK doesn't work in Linux at the moment and there are also some license issues that could be issues in some use cases (e.g. combination with GPL code). I have been testing the OpenHMD library - the tracking code kinda works (there is no magnetometer support), but the display parameters returned are bogus. I have also my own library in progress for this Jan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
Jan Ciger wrote: > > Ah, cool! Thanks for that, I will have a look at it. > > Regards, > > Jan > NP! I have also made progress with the sensor integration and have successfully added correction for chromatic aberration in my shader. I can upload it tomorrow if anyone is interested. Best regards Björn -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=55119#55119 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
On Wed, Jul 3, 2013 at 4:20 PM, Björn Blissing wrote: > Hi, > > I have made a example called OsgOculusViewer that I succesfully tested with > my Rift Unit. I had to modify the shader in the SDK docs a bit and I also > made a class responsible for talking to the Oculus device. This class also > works if no Oculus Device is connected, then it just return the same values > as if the development kit was connected. I hope I haven't made any obvious > mistakes, but as always; no guarantees... ;) > > I have submitted the full source code to the thread mentioned earlier in the > thread, ie: > > > Code: > https://developer.oculusvr.com/forums/viewtopic.php?f=39&t=1885#p28546 Ah, cool! Thanks for that, I will have a look at it. Regards, Jan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
Hi, I have made a example called OsgOculusViewer that I succesfully tested with my Rift Unit. I had to modify the shader in the SDK docs a bit and I also made a class responsible for talking to the Oculus device. This class also works if no Oculus Device is connected, then it just return the same values as if the development kit was connected. I hope I haven't made any obvious mistakes, but as always; no guarantees... ;) I have submitted the full source code to the thread mentioned earlier in the thread, ie: Code: https://developer.oculusvr.com/forums/viewtopic.php?f=39&t=1885#p28546 Best regards Björn [/url] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=55116#55116 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
Hi Luc, On Wed, Jul 3, 2013 at 12:59 PM, Luc Frauciel wrote: > Hi jan, > > > >That would be good, I am working on the Rift too, but I am a bit > hampered by weird issues with slave cameras (how to set a projection > matrix on a slave camera correctly?? Mine gets always overridden to > some nonsense). > > When working on slave projection matrix for the Rift, I've done a stupid > mistake leading to some nonsense and took time to understand the issue. > osg has mechanisms to combine projection matrices (it's the case for child > cameras, I assume it is the same for slave cameras), and only expect > 'offset' matrices as child/slave. > So the 'master' projection matrix, which is initialized to some default > frustrum is applied before the others. > With a full projection matrix defined as child/slave, you'll and up with > garbage. > Yes, I have noticed this. I have set the master camera projection to identity and used a full matrix on the slave camera. However, the matrix still gets clobbered after first frame by something. It is not the camera manipulator messing with it - it happens even when no camera manipulators are installed. The resulting matrix has only some scaling and translation set (for whatever reason) and is not a valid projection matrix. Also, the matrix values are changing when I move the camera using the camera manipulator - which is most odd, because that has no reason to touch projection matrices, or?? > By initializing the master matrix to identity, it solved my problem. You > could also only define these slave matrices as an offset from the first one. > Don't know if that's your case, but if that could help... > That is what I did. viewer.getCamera()->setProjectionMatrix(osg::Matrix::identity()) and then set the matrices in full on the slave cameras that are attached to this view. However, it still gets clobbered :( I could, of course, set the slave cameras to use RF_ABSOLUTE, but that loses the advantage of having them as slaves and being able to move cameras using a single view matrix. BTW, this issue doesn't happen if I insert the cameras into the scene directly, not as slaves, so it has to be some mess with the slave update callback doing something strange to the matrices. > > Be also aware that stereo parameters in OSG can put a real mess into your > matrices. I tend to think it's preferable to set them "by hand" when > dealing with asymetric matrices. > For the time being I am not concerned about this. I am trying to get the thing display something semi-correct using symmetrical projections and only horizontal offset in the view matrices first, once that works I will move on to get the proper frusta setup. I am not using the OSG built-in side-by-side stereo code, I am setting up everything by hand. Regards, Jan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
Hello, On Wed, Jul 3, 2013 at 11:03 AM, Torben Dannhauer wrote: > Hi, > > I implemented a distortion frame for for OSG for A 6 channel helicopter > simulator last year. > I was absent for several month due to my PhD thesis but it is finished today, > so I'll plan to dive into it again in the next days/weeks > > My further plans are to clean up the code, introduce it into OSG and refactor > all distortion examples to use the new framework. > > This could also be used for the Oculus Rift.. > > Cheers, > Torben > That would be good, I am working on the Rift too, but I am a bit hampered by weird issues with slave cameras (how to set a projection matrix on a slave camera correctly?? Mine gets always overridden to some nonsense). The code on the Oculus website is only a non-working concept that wasn't tested on a real Rift, according to the author. I have looked at the code, but there are plenty of mistakes in that and many factors are not taken into account - e.g. the lens offset relative to the centre of the projection (thus the distortion needs to be adapted for each lens). Regards, Jan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
Hi, I implemented a distortion frame for for OSG for A 6 channel helicopter simulator last year. I was absent for several month due to my PhD thesis but it is finished today, so I'll plan to dive into it again in the next days/weeks My further plans are to clean up the code, introduce it into OSG and refactor all distortion examples to use the new framework. This could also be used for the Oculus Rift.. Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=55108#55108 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
Hi, Jeff (jbail) pm'd me as his post is not approved yet. He has posted some code on the Oculus developer forum: https://developer.oculusvr.com/forums/viewtopic.php?f=39&t=1885&sid=4a751a276c8632e6671109c636244188 I did not tested it myself, but it looks great! Until his reply gets approved, he asked me to post this link here on his behalf. Hopefully this can get everyone started and we take osg/oculus to the next level Thank you! Cheers, Roy -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=54987#54987 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
Hi, Did someone achieved this yet? My oculus arrived yesterday and I'll be working on my application next month. I'm not sure whether I'll use osg or something else, but if someone already got this to work... Maybe you could share the code as well, or give some pointers when I'll start working with the rift. Thank you! Cheers, Roy -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=54639#54639 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
I just got my Rift dev kit today and plan to look at this a bit as well. I'm a little slammed on time for the next week, so I don't have any estimates but I'll post when I have something to show. If anyone else has already made progress, please share ;) Cheers, Trystan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=54267#54267 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
My point is that there is no need to wait for the thing to arrive to actually implement something. The barrel distortion parameters can also be adjusted when the hardware finally arrives ;) Christian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set
Hi Christian, I still haven't managed to get my hands on an Oculus Rift, but as soon as KickStarter rewards get delivered, I will work on this point. There is already some kind of specific distortions implemented in OSG for dome projection (osgdistortion example). >From what I've heard, the distorsion shader for the Rift is quite easy to implement. Luc - VRGeek and Rift fan De : Christian Buchner A : OpenSceneGraph Users Date: 20/03/2013 19:32 Objet : [osg-users] adding barrel distortion for stereoscopic rendering in Oculus Rift head set Envoyé par : osg-users-boun...@lists.openscenegraph.org Hi, has anyone here started to add some Oculus Rift support as an additional stereoscopic mode of OSG? It would require some barrel predistortion (with the exact parameters yet to be announced) and requires rendering at 60 FPS with vsync, side by side. 1280×800 resolution. It's probably a good idea to render each eye to an FBO and perform the barrel distortion in a pixel shader. Maybe the rendering to FBO needs to be done at a slightly higher resolution because the barrel distortion leads to a higher effective resolution at the center of the image. And you certainly don't want to see any aliasing there. Christian ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org