Re: [osg-users] GraphicsContext on Multiple Graphics cards?
HI Akilan, On Wed, Mar 24, 2010 at 1:34 PM, Akilan Thangamani wrote: > Will this method of setting create individual context on each card if at all > I connected 4 monitors to my cards? I'm not 100% clear on what you mean in this sentence, but I can confirm that the ScreenIdentifier is what you need to set, with the screen number referring to graphics context/card. It is possible to configure OS's/drivers/hardware to have a single graphics context across two or more outputs from a single graphics card, or to have a single graphics context across each output - in which case the screen number you use will refer to unit you set up. The OSG doesn't have any control over this setup, you'll need to look at your driver control panels/configuration for this. If you just set up one display, one context per card then things a little more straight forward in screen number relationship to the the card. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GraphicsContext on Multiple Graphics cards?
Robert, I do follow the osgCamera example only. I set the screen identification as, osg::GraphicsContext::ScreenIdentifier si; ... int numScreens; int numCameras; numScreens=numCameras=4; translate=numCameras-1; for(unsigned int i=0; i traits = new osg::GraphicsContext::Traits; traits->screenNum = i / numScreens; traits->x = (i*width)/numCameras; traits->y = 0; traits->width = width/numCameras-1; traits->height = height; traits->windowDecoration = true; traits->doubleBuffer = true; //traits->sharedContext = 0; si.screenNum=i / numScreens ; traits->setScreenIdentifier(si.displayName()); osg::ref_ptr gc = osg::GraphicsContext::createGraphicsContext(traits.get()); osg::ref_ptr camera = new osg::Camera; camera->setGraphicsContext(gc.get()); camera->setViewport(new osg::Viewport(0,0, width/numCameras, height)); GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT; camera->setDrawBuffer(buffer); camera->setReadBuffer(buffer); viewer.addSlave(camera.get(), osg::Matrix::scale(aspectRatioScale, 1.0, 1.0)*osg::Matrix::translate(translate_x, 0.0, 0.0), osg::Matrix() ); } Will this method of setting create individual context on each card if at all I connected 4 monitors to my cards? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=26070#26070 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GraphicsContext on Multiple Graphics cards?
HI Akilan, The OSG by default will open up windows right across all the attached screens with the assumption that are all working side be side like a powerwall. However, it won't necessarily know the screen layout so you well may need to adjust the set up the slave Camera view and projection matrix offsets to get the exactly the results you are looking, and set the screen number assigned to each graphics card. The osgcamera example illustrate hows to set up the Camera's and associated GraphicsContexts for the viewer by using a combination of GraphicsContext::Traits to supply details of the actual display you want to take, and the Camera for assigning the GraphicsContext created and setting up the view and projection matrix details. Robert. On Wed, Mar 24, 2010 at 11:13 AM, Akilan Thangamani wrote: > Hi, > > > 4 graphics cards have been installed in my system thru PCI extension board. > In my application I want to associate individual camera with each context > created on each card. I wud like to know how to create context for specific > graphics card/display. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=26060#26060 > > > > > > ___ > 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
[osg-users] GraphicsContext on Multiple Graphics cards?
Hi, 4 graphics cards have been installed in my system thru PCI extension board. In my application I want to associate individual camera with each context created on each card. I wud like to know how to create context for specific graphics card/display. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=26060#26060 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GraphicsContext resizedCallback/resizedImplementation bug
Hi, I suspected that as well ... but I browsed the source code for 2.8.2 and it looked like it would exhibit the same problem. It might be a couple months before I am able to upgrade to 2.8.2. Thank you! Cheers, Steven -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17058#17058 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GraphicsContext resizedCallback/resizedImplementation bug
Hi Steven, I think that this issue might have been resolved in 2.8.2. I would strongly recommend upgrading to 2.8.2. The API changes should be pretty isolated w.r.t 2.2 so porting should be quite straight forward and you'll get lots and lots of bug fixes as well as general improvements. And.. you'll be far easier to support as trying to remember little details of old code is beyond my meager brain is capable of. Robert. On Thu, Sep 3, 2009 at 7:56 PM, Steven Powers wrote: > Hi, > OSG 2.2 > The original issue: > I have a graphics context with multiple cameras. Some of which are rendering > to an attached image. When I resize the graphics context ALL of the camera's > viewports are resized. I did not want this to happen so I defined my own > ResizedCallback which will only resize Cameras that I tell it to. > > Issue with ResizedCallback: > I can resize the camera's I want to and leave the others the way they are > just fine. But since I defined my own ResizedCallback GraphicsContext no > longer updates the following values as it would normally do in > GraphicsContext::resizedImplementation(). > > > Code: > > _traits->x = x; > _traits->y = y; > _traits->width = width; > _traits->height = height; > > > > > Now when I query these values from GraphicsContext they no longer equate to > the values I set by resizing the context. > > This is because GraphicsContext::resizedImplementation() is not called when a > ResizedCallback is set. It is impossible to set the traits values in the > ResizedCallback since the values are private. > > To repair this I would change: > > > Code: > > void resized(int x, int y, int width, int height) > { > if (_resizedCallback.valid()) > _resizedCallback->resizedImplementation(this, x, y, width, height); > else resizedImplementation(x, y, width, height); > } > > > > > > to > > > Code: > > void resized(int x, int y, int width, int height) > { > if (_resizedCallback.valid()) > _resizedCallback->resizedImplementation(this, x, y, width, height); > else resizedImplementation(x, y, width, height); > _traits->x = x; > _traits->y = y; > _traits->width = width; > _traits->height = height; > > > } > > > > > > Or something similar. > > > Thank you! > > Cheers, > Steven[/code] > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=17030#17030 > > > > > > ___ > 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
[osg-users] GraphicsContext resizedCallback/resizedImplementation bug
Hi, OSG 2.2 The original issue: I have a graphics context with multiple cameras. Some of which are rendering to an attached image. When I resize the graphics context ALL of the camera's viewports are resized. I did not want this to happen so I defined my own ResizedCallback which will only resize Cameras that I tell it to. Issue with ResizedCallback: I can resize the camera's I want to and leave the others the way they are just fine. But since I defined my own ResizedCallback GraphicsContext no longer updates the following values as it would normally do in GraphicsContext::resizedImplementation(). Code: _traits->x = x; _traits->y = y; _traits->width = width; _traits->height = height; Now when I query these values from GraphicsContext they no longer equate to the values I set by resizing the context. This is because GraphicsContext::resizedImplementation() is not called when a ResizedCallback is set. It is impossible to set the traits values in the ResizedCallback since the values are private. To repair this I would change: Code: void resized(int x, int y, int width, int height) { if (_resizedCallback.valid()) _resizedCallback->resizedImplementation(this, x, y, width, height); else resizedImplementation(x, y, width, height); } to Code: void resized(int x, int y, int width, int height) { if (_resizedCallback.valid()) _resizedCallback->resizedImplementation(this, x, y, width, height); else resizedImplementation(x, y, width, height); _traits->x = x; _traits->y = y; _traits->width = width; _traits->height = height; } Or something similar. Thank you! Cheers, Steven[/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=17030#17030 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GraphicsContext::getWindowingSystemInterface() problem...on Windows Mobile 6
Hi Younggon, I haven't heard of the OSG being compiled under Windows Mobile before so you may well be the first to tread this route. It may well be that osgViewer::GraphicsWindowWin32 will need to be modified or perhaps even replaced by another window integration solution that is appropriate to Windows Mobile, I don't have any knowledge of Windows Mobile so can't personally provide guidance. One thing you could try is to try out the osgviewerSDL or osgviewerGLUT examples as these use the GraphicsWindowEmbedded functionality of osgViewer to mimic having a full graphics context implementation, it's a bit limiting compared to the native graphics window support available in osgViewer, but may be enough to prove the concept of an OSG Windows Mobile port. Good luck with the port :) Robert. On Wed, Jul 1, 2009 at 2:39 PM, Younggon Kim wrote: > Hi, > > I'm porting OSG v2.8.0 to Windows Mobile 6. > I have completed to build OSG libraries but not working.. > The problem is that Viewer dosen't get a graphic context. > > This is the error message: > "Viewer::realize() - failed to set up any windows" > > static ref_ptr > &windowingSystemInterfaceRef() > { > static ref_ptr > s_WindowingSystemInterface; > return s_WindowingSystemInterface; > } > > I think this function should return not null but returns null. > I don't know why this function returns null. > > Any advice for how to fix this? > > Thank you! > > Cheers, > Younggon > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=14767#14767 > > > > > > ___ > 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
[osg-users] GraphicsContext::getWindowingSystemInterface() problem...on Windows Mobile 6
Hi, I'm porting OSG v2.8.0 to Windows Mobile 6. I have completed to build OSG libraries but not working.. The problem is that Viewer dosen't get a graphic context. This is the error message: "Viewer::realize() - failed to set up any windows" static ref_ptr &windowingSystemInterfaceRef() { static ref_ptr s_WindowingSystemInterface; return s_WindowingSystemInterface; } I think this function should return not null but returns null. I don't know why this function returns null. Any advice for how to fix this? Thank you! Cheers, Younggon -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=14767#14767 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GraphicsContext problem
Hi Yun, Have a look through the osg-users archives, there has been plenty discussed about OpenGL/OSG integration. It's a bit tricky due to state management, so if you can I'd recommend just using OSG all the way as it'll lead to better performance and an easier life alround. Robert. 2009/3/20 Lingyun Yu > nobody had the same thing? > > > On Fri, Mar 20, 2009 at 12:20 PM, Lingyun Yu wrote: > >> Hi guys, >> >> I want to use OpenGL to render the interface, but use OSG to render in a >> region. And in this region I use OSG manipulator, but in the rest of the >> interface I use others. I don't know if it is possible, if it is, how to do? >> >> Thanks in advance. >> -- >> Cheers, >> Yun >> > > > > -- > Cheers, > Yun > > ___ > 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
Re: [osg-users] GraphicsContext problem
nobody had the same thing? On Fri, Mar 20, 2009 at 12:20 PM, Lingyun Yu wrote: > Hi guys, > > I want to use OpenGL to render the interface, but use OSG to render in a > region. And in this region I use OSG manipulator, but in the rest of the > interface I use others. I don't know if it is possible, if it is, how to do? > > Thanks in advance. > -- > Cheers, > Yun > -- Cheers, Yun ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] GraphicsContext problem
Hi guys, I want to use OpenGL to render the interface, but use OSG to render in a region. And in this region I use OSG manipulator, but in the rest of the interface I use others. I don't know if it is possible, if it is, how to do? Thanks in advance. -- Cheers, Yun ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GraphicsContext
Hi Robert, Just arrived at work and talked with the development team. We are using Delta3D 2.1.0 which uses osg2.6.0 and as you describe the error/bug has been fixed after that. Delta3D has a newer version 2.1.1 which uses osg2.6.1, but as Delta3D has a release candidate 2.2.0 on the way we will upgrade to that when it's ready. thanks, Peter On Mon, Nov 10, 2008 at 5:32 PM, Robert Osfield <[EMAIL PROTECTED]>wrote: > Hi Peter, > > I've just checked the GraphicsContext.cpp in svn and the code looks > correct: > > struct CameraRenderOrderSortOp > { >inline bool operator() (const Camera* lhs,const Camera* rhs) const >{ >if (lhs->getRenderOrder()getRenderOrder()) return true; >if (rhs->getRenderOrder()getRenderOrder()) return false; >return lhs->getRenderOrderNum()getRenderOrderNum(); >} > }; > > Which version of the OSG are you using? The submission that fixed this > was: > > r8872 | robert | 2008-09-17 19:42:52 +0100 (Wed, 17 Sep 2008) | 18 lines > > >From Bill Prendergast, "Found a typo in CameraRenderOrderSortOp in > osg/GraphicsContext.cpp > (V2.6.0 and prior) as noted below: > > struct CameraRenderOrderSortOp > { > inline bool operator() (const Camera* lhs,const Camera* rhs) const > { > if (lhs->getRenderOrder()getRenderOrder()) return true; > if (rhs->getRenderOrder()getRenderOrder()) return false; > --->return lhs->getRenderOrderNum()getRenderOrderNum(); > ^^^ ^^^ > } > }; > > Robert. > > > On Mon, Nov 10, 2008 at 2:16 PM, Peter Wraae Marino <[EMAIL PROTECTED]> > wrote: > > Hi users, > > > > In our attempt to make a composite view using slave camera.. we have > > had some succes but also failure. > > > > Biggest problem is getting the render order of the cameras to work. > > We tried adding them in the correct order, but we needed to use > > the removeSlave (which seems to be broken) > > > > Now we tried to use the GraphicsContext render order, but had a problem > > that they did not sort correctly. > > > > looking into the code: > > > > struct CameraRenderOrderSortOp > > { > > inline bool operator() (const Camera* lhs,const Camera* rhs) const > > { > > if (lhs->getRenderOrder()getRenderOrder()) return true; > > if (rhs->getRenderOrder()getRenderOrder()) return false; > > return lhs->getRenderOrderNum()getRenderOrderNum(); > > } > > }; > > > > if you notice the last line, it is using "lhs" for both > getRenderOrderNum() > > which will result in a constant return false value. I believe this is a > bug, > > correct me if I'm wrong. > > > > -- > > Regards, > > Peter Wraae Marino > > > > www.osghelp.com - OpenSceneGraph support site > > > > ___ > > 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 > -- Regards, Peter Wraae Marino www.osghelp.com - OpenSceneGraph support site ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GraphicsContext
Hi Peter, I've just checked the GraphicsContext.cpp in svn and the code looks correct: struct CameraRenderOrderSortOp { inline bool operator() (const Camera* lhs,const Camera* rhs) const { if (lhs->getRenderOrder()getRenderOrder()) return true; if (rhs->getRenderOrder()getRenderOrder()) return false; return lhs->getRenderOrderNum()getRenderOrderNum(); } }; Which version of the OSG are you using? The submission that fixed this was: r8872 | robert | 2008-09-17 19:42:52 +0100 (Wed, 17 Sep 2008) | 18 lines >From Bill Prendergast, "Found a typo in CameraRenderOrderSortOp in osg/GraphicsContext.cpp (V2.6.0 and prior) as noted below: struct CameraRenderOrderSortOp { inline bool operator() (const Camera* lhs,const Camera* rhs) const { if (lhs->getRenderOrder()getRenderOrder()) return true; if (rhs->getRenderOrder()getRenderOrder()) return false; --->return lhs->getRenderOrderNum()getRenderOrderNum(); ^^^ ^^^ } }; Robert. On Mon, Nov 10, 2008 at 2:16 PM, Peter Wraae Marino <[EMAIL PROTECTED]> wrote: > Hi users, > > In our attempt to make a composite view using slave camera.. we have > had some succes but also failure. > > Biggest problem is getting the render order of the cameras to work. > We tried adding them in the correct order, but we needed to use > the removeSlave (which seems to be broken) > > Now we tried to use the GraphicsContext render order, but had a problem > that they did not sort correctly. > > looking into the code: > > struct CameraRenderOrderSortOp > { > inline bool operator() (const Camera* lhs,const Camera* rhs) const > { > if (lhs->getRenderOrder()getRenderOrder()) return true; > if (rhs->getRenderOrder()getRenderOrder()) return false; > return lhs->getRenderOrderNum()getRenderOrderNum(); > } > }; > > if you notice the last line, it is using "lhs" for both getRenderOrderNum() > which will result in a constant return false value. I believe this is a bug, > correct me if I'm wrong. > > -- > Regards, > Peter Wraae Marino > > www.osghelp.com - OpenSceneGraph support site > > ___ > 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
[osg-users] GraphicsContext
Hi users, In our attempt to make a composite view using slave camera.. we have had some succes but also failure. Biggest problem is getting the render order of the cameras to work. We tried adding them in the correct order, but we needed to use the removeSlave (which seems to be broken) Now we tried to use the GraphicsContext render order, but had a problem that they did not sort correctly. looking into the code: struct CameraRenderOrderSortOp { inline bool operator() (const Camera* lhs,const Camera* rhs) const { if (lhs->getRenderOrder()getRenderOrder()) return true; if (rhs->getRenderOrder()getRenderOrder()) return false; return lhs->getRenderOrderNum()getRenderOrderNum(); } }; if you notice the last line, it is using "lhs" for both getRenderOrderNum() which will result in a constant return false value. I believe this is a bug, correct me if I'm wrong. -- Regards, Peter Wraae Marino www.osghelp.com - OpenSceneGraph support site ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] GraphicsContext cannot open display.
Hi Steven, Does osgviewer work fine? Is it only your own attempts to manually create a graphics context that is failing? It could be simply that your Traits aren't set up correctly. You could copy and paste the settings into an email. Robert. On Dec 18, 2007 9:01 PM, Steven Powers <[EMAIL PROTECTED]> wrote: > > > > > I'm running OSG 2.2 ssh'd into a remote linux system. > > > > When I run a program using viewer it opens windows fine. > > > > ie osgViewer(); viewer->realize(); works just fine. > > > > > > When I use a graphics context I get the message: > > > > 'Error: Unable to open display ":0.0"' > > > > and > > > > osg::GraphicsContext::createGraphicsContext(traits.get()); > > > > returns NULL. > > > > I have the DISPLAY variable set and I'm using X11 forwarding actively for > other tasks. > > > > > > Why does this work when I use viewer to build a window and not work when I > try to manually create a graphicsContext??? > > > > Thanks, > > > > Steven Powers > > > > > > > ___ > 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
[osg-users] GraphicsContext cannot open display.
I'm running OSG 2.2 ssh'd into a remote linux system. When I run a program using viewer it opens windows fine. ie osgViewer(); viewer->realize(); works just fine. When I use a graphics context I get the message: 'Error: Unable to open display ":0.0"' and osg::GraphicsContext::createGraphicsContext(traits.get()); returns NULL. I have the DISPLAY variable set and I'm using X11 forwarding actively for other tasks. Why does this work when I use viewer to build a window and not work when I try to manually create a graphicsContext??? Thanks, Steven Powers ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org