Re: [osg-users] OSG in C# environment
Hi Saeed, Yes, it can be done quite easily. I've been using OSG in combination with C# / WinForms for years now. The way to go is to start with the example created by Hesicong (http://www.openscenegraph.org/projects/osg/wiki/Community/LanguageWrappers, see the attached osgCppCLIDemo.rar). In this example, you use a C++/CLI project to interface with OSG and a Form to provide the rendering area. Your C# projects can include this C++ project and the Form automagically. This works great for creating an editor / 3D modelling tool. If you have any specific questions, let me know. Kind regards, Ruben From: osg-users-boun...@lists.openscenegraph.org [osg-users-boun...@lists.openscenegraph.org] on behalf of Saeed Hadian Niasar [saeed.had...@gmail.com] Sent: Tuesday, June 14, 2011 11:47 PM To: osg-users@lists.openscenegraph.org Subject: [osg-users] OSG in C# environment Hi, Could anyone tell me if I can use OSG in C#? I know this is discussed before, but it is still unclear for me. If the answer is yes, could you please tell me how, or introduce online sources for it? Thank you! Cheers, Saeed -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40488#40488 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org This e-mail and its contents are subject to the DISCLAIMER at http://www.tno.nl/emaildisclaimer ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] AutoTransform "scale to screen" algorithm - reference?
It's the block of code that starts here: http://www.openscenegraph.org/projects/osg/browser/OpenSceneGraph/trunk/src/osg/AutoTransform.cpp#L232 -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40499#40499 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] AutoTransform "scale to screen" algorithm - reference?
As I look at it some more, the good news is that I think I understand the part I needed to know about. :) That said, I'm curious about the stuff going on when you have _autoScaleTransitionWidthRatio set to non-zero (default is 0.25), and then set _minimumScale or _maximumScale away from their default values. It looks like some kind of quadratic interpolation maybe? Thanks, Frank -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40498#40498 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] FBO Only render on certain angles
Hi Micael, I've been stuck with this issue for a while now and I really have no idea what is causing it. I have a really basic scene that render just fine using the basic OpenGL rendering pipeline but when I enable the osg::Camera::FRAME_BUFFER_OBJECT tag with any osgPPU shader this is the result I get. http://youtu.be/k0-IGAvNy_s I have tried to use osgViewer as the base of my application instead of SFML witch fixed the problem but it can't be a permanent solution for me. It appears that the function osgUtil::SceneView::draw() is called even when it's not rendering. Here are the parts of my code that could be causing the problem. I have no idea what SFML is, and if your app works with osgViewer but doesn't with some other viewer I don't know how useful my comments will be. I've had a problem very similar to this with osgPPU myself in the past, and it was caused by the camera's compute near far mode being set to auto compute. Basically the problem was that when the cull visitor traversed the processor, it would try to include it in the near-far computation, which would then compute wrong values and clip out osgPPU's final render quad. In osgPPU's examples, the camera's near-far computation is disabled, but I couldn't do this in our projects because we rely on this feature. The solution I found was to override osgPPU::Processor's traverse() method disabling near-far computation for its children. class OurProcessor : public osgPPU::Processor { public: OurProcessor() : osgPPU::Processor() {} virtual void traverse(osg::NodeVisitor& nv) { osg::CullSettings::ComputeNearFarMode oldComputeNearFarMode; osgUtil::CullVisitor* cv = dynamic_cast(&nv); if (cv) { oldComputeNearFarMode = cv->getComputeNearFarMode(); cv->setComputeNearFarMode( osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR); } osgPPU::Processor::traverse(nv); if (cv) { cv->setComputeNearFarMode(oldComputeNearFarMode); } } }; However, as I said I know nothing about SFML. If in osgViewer you forced the viewer camera's near-far computation off but not in SFML, then you might be seeing this kind of problem, but if not then I don't know what else could be going on... Hope this helps, J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] List of visible nodes
Thank you for your quick response. Your advice gave me a push in the right direction. My solution was to to register a cull callback for each node that I wanted to check for visibility. Elhanan. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40496#40496 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgOcean] osgOcean with Silverlining
I can't comment about Silverlining as I've not used it, but I suspect that if you wanted to use osgOcean's fullscreen effects such as glare, dof and god-rays etc. you will have some conflicts with osgPPU as those effects would not be managed by the osgPPU pipeline. Regards, Kim. On 3 June 2011 17:32, Micael Levesque wrote: > Would this work with osgPPU as well? > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=40057#40057 > > > > > > ___ > 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] [osgPlugins] upgrades to osgdb_bsp
Where could I find the source of this? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40056#40056 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgOcean] osgOcean with Silverlining
Would this work with osgPPU as well? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40057#40057 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] FBO Only render on certain angles
Hi, I've been stuck with this issue for a while now and I really have no idea what is causing it. I have a really basic scene that render just fine using the basic OpenGL rendering pipeline but when I enable the osg::Camera::FRAME_BUFFER_OBJECT tag with any osgPPU shader this is the result I get. http://youtu.be/k0-IGAvNy_s I have tried to use osgViewer as the base of my application instead of SFML witch fixed the problem but it can't be a permanent solution for me. It appears that the function osgUtil::SceneView::draw() is called even when it's not rendering. Here are the parts of my code that could be causing the problem. Camera setup Code: osg::Viewport* vp = internalCamera->getViewport(); vp->setViewport(0,0, Config::getInstance()->getRenderWidth(), Config::getInstance()->getRenderHeight()); osg::Texture* texture = PPUManager::getInstance()->createRenderTexture((int)vp->width(), (int)vp->height(), false); osg::Texture* depthTexture = PPUManager::getInstance()->createRenderTexture((int)vp->width(), (int)vp->height(), true); internalCamera->setClearColor(osg::Vec4(2.5f,2.5f,3.0f,1.0f)); internalCamera->setClearMask(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); internalCamera->setViewport(vp); internalCamera->setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR); internalCamera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); internalCamera->attach(osg::Camera::COLOR_BUFFER,texture); internalCamera->attach(osg::Camera::DEPTH_BUFFER,depthTexture); Camera update Code: internalCamera->setProjectionMatrixAsPerspective(45.0, internalCamera->getViewport()->aspectRatio(), 0.1, 1024.0); internalCamera->setViewMatrixAsLookAt(origin,lookAt,osg::Vec3d(0,1,0)); Game class Code: #include "Game.h" #include "PhysicsManager.h" #include "ObjectManager.h" #include "PPUManager.h" #include "FPSCamera.h" Game:: Game(GLApp* app): Screen(app), sceneView(new osgUtil::SceneView) { sceneView->setDefaults(); currentCamera = new FPSCamera(sceneView,osg::Vec3(0,0,-1)); } Game::~Game() { PhysicsManager::getInstance()->unload(); ObjectManager::getInstance()->cleanup(); } void Game::reload() { if(PhysicsManager::isLoaded()) PhysicsManager::getInstance()->unload(); PhysicsManager::getInstance()->load(); sceneView->setDefaults(); osg::ref_ptr root = new osg::Group; ObjectManager::getInstance()->cleanup(); ObjectManager::getInstance()->addScene(root.get(), "scene01.dat"); sceneView->setCamera(currentCamera->getInternalCamera()); currentCamera->setParentObject(ObjectManager::getInstance()->getObject(BOX_OBJECT, "test")); currentCamera->reload(); if(true) // Disable color clamping { osg::ClampColor* clamp = new osg::ClampColor(); clamp->setClampVertexColor(GL_FALSE); clamp->setClampFragmentColor(GL_FALSE); clamp->setClampReadColor(GL_FALSE); root->getOrCreateStateSet()->setAttribute(clamp, osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE | osg::StateAttribute::PROTECTED); } PPUManager::getInstance()->setupProcessor(root.get(), currentCamera->getInternalCamera()); sceneView->setSceneData(root.get()); } void Game::readEvent(sf::Event& mainEvent) { currentCamera->readEvent(mainEvent); } void Game::update() { ObjectManager::getInstance()->update(); currentCamera->updateMouse(); currentCamera->update(); sceneView->update(); sceneView->cull(); } void Game::render() { currentCamera->setupPerspective(); sceneView->draw(); } Thank you! Cheers, HiredK[/b][/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40058#40058 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPlugins] VFS (PhysFS) support for .ive plugin
Hi, I'm looking for a way to load both the Virtual Planet Builder main .ive file and the tiles .ive from a VFS (Virtual file system). I already have a VPB terrain running and a functional VFS system that works by adding ".physfs" at the end of a filepath like this osgDB::readNode(engine/file.ive.physfs"). I'm able to load the main .ive file from the VFS but unfortunately when the plugin load the tiles I can't find a way to add the ".physfs" extension since the call is on the plugin side. What would be the best way to do so? Cheers, Micael -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40383#40383 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Call for OSG contractors and consultants
Hey, What would a novice contractor expect to make on this kind of project? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40486#40486 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG in C# environment
Hi, Could anyone tell me if I can use OSG in C#? I know this is discussed before, but it is still unclear for me. If the answer is yes, could you please tell me how, or introduce online sources for it? Thank you! Cheers, Saeed -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40488#40488 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] AutoTransform "scale to screen" algorithm - reference?
"Reference" as in a research paper? As far as I know, AutoTransform's calculations are just linear algebra and a firm grasp of the OpenGL transformation pipeline. Both OpenGL Programming Guide (red book) and OpenGL Distilled (my book) describe the transform pipeline found in OpenGL <=3.0, and both books also list at least one linear algebra text for recommended reading. -Paul On 6/14/2011 1:55 PM, Frank Palazzolo wrote: Hi, Is there any reference for the calculations in AutoTransform::accept(), when getAutoScaleToScreen() is true? It seems to do the "right thing", but I really need to understand how it works for an application. Thank you! Cheers, Frank ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] AutoTransform "scale to screen" algorithm - reference?
Hi, Is there any reference for the calculations in AutoTransform::accept(), when getAutoScaleToScreen() is true? It seems to do the "right thing", but I really need to understand how it works for an application. Thank you! Cheers, Frank -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40483#40483 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OT: User GUI toolkit
My application uses FLTK 1.1, but I'm about to try 1.3 as it has some improvements I've been waiting for. Integration is pretty easy, especially on Linux. Windows and OSX have some additional rules (only draw FLTK windows in main thread; OSG can use other threads) but it's not too bad. Eric On Tue, Nov 23, 2010 at 11:52 AM, Jeremy Moles wrote: > On Mon, 2010-11-22 at 18:31 +0100, Anders Backman wrote: > > Old as,... I don't know. But this question pops up now and then. > > This will hopefully--eventually--be solved by osgWidget/osgWidget(2). > Unfortunately, right in the middle of my passionate development I had > some serious medical issues, and as I recover I spend the majority of my > free coding time doing various, small paid OSG projects. > > I haven't forgot about this huge gap in OSG, and I really want to tackle > it as soon as I can. In the meantime, you could adapt current osgWidget, > or perhaps someone else will have advice. > > At any rate, some of the components necessary to REALLY make an > incredible GUI toolkit (vector drawing and good text layout support, > osgCairo/osgPango) are really coming along. :) > > > Assume you need a OpenGL based SDK, lean (in terms of dependencies) > > gui, for In-graphics GUI, multiplatform. > > With basic support for sliders, buttons, text, windows. > > > > > > What do people use? > > Is it QT for everything (with their OpenGL based widgets), is it FLTK? > > wxWidgets? Seems that most of the small, OpenGL based stuff are mostly > > stalled in development. > > Some are integrating Java (JOGL)... > > > > > > Really curious to see what people use, perhaps there are some new > > interesting stuff out there? > > > > -- > > > > > > ___ > > 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 mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] Build OSG using DCMTK
Hi, yeah.. i found those... but there are a lot of missing files which i cannot seem to find... ... Thank you! Cheers, Isha -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40485#40485 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] Build OSG using DCMTK
On 6/14/2011 1:45 PM, Isha Kandaswamy wrote: > Does that even have a plugin to load *.vtk files? > I was checking online and it said there used to be a plugin to load vtk files > into osg but now it is not online anymore.. http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2008-November/018541.html -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] Build OSG using DCMTK
Hi, Does that even have a plugin to load *.vtk files? I was checking online and it said there used to be a plugin to load vtk files into osg but now it is not online anymore.. Thank you soo muich for your help, I really appreciate it. ... Thank you! Cheers, Isha -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40482#40482 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] Build OSG using DCMTK
Hi Isa, On Tue, Jun 14, 2011 at 7:34 PM, Isha Kandaswamy wrote: > Hi, > > I ran it according to what you suggested. This is how the checksum looks. I > think one of the things is that the texture is 512x512 and mas size is 256... > are there any other potential problems?? The limited max texture size will only be an issue if the source data is larger than 256x256. I presume it's the hardware/driver which is causing such a low max texture size. I'm afriad the hardware you have probably isn't a good base to work from for volume rendering. The Geforce 5600Ti I'm using has a max texture 3D size of 2048, which is the type of system one should be targetting for volume rendering, it's really too demanding for low end graphics. > isha@isha-laptop:~$ /usr/local/share/OpenSceneGraph/bin/osgvolume > bin/Skull-2mm/ -o test.osgb > Max texture size=256 > (-0.0625 -0.0625 -0.0625 -0.0625) (0.0248718 0.0248718 0.0248718 0.0248718) > bin/Skull-2mm/ > Min value -0.0625 -0.0625 -0.0625 -0.0625 > Max value 0.0248718 0.0248718 0.0248718 0.0248718 > Single image 1 volumes. > isha@isha-laptop:~$ md > md5sum mdatopbm mdeltree mdu > md5sum.textutils mdel mdir > isha@isha-laptop:~$ md5sum test.osgb > d6e166dd334428d8da6a90ffdbf3d04b test.osgb > isha@isha-laptop:~$ I've tried artificially limiting the texture size to 256 on my system by still get a get different check-sum. I can't say whether this is siginificant. There is chance that changes to svn/trunk OSG are having an effect. > Also i was wondering, how feasible is it to load vtk images into > openscenegraph?? The dicom plugin has an example of using ITK to read dicom images and then converting these to an osg::Image, so have a look at src/osgPlugins/dicom. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] Build OSG using DCMTK
Hi, I ran it according to what you suggested. This is how the checksum looks. I think one of the things is that the texture is 512x512 and mas size is 256... are there any other potential problems?? isha@isha-laptop:~$ /usr/local/share/OpenSceneGraph/bin/osgvolume bin/Skull-2mm/ -o test.osgb Max texture size=256 (-0.0625 -0.0625 -0.0625 -0.0625) (0.0248718 0.0248718 0.0248718 0.0248718) bin/Skull-2mm/ Min value -0.0625 -0.0625 -0.0625 -0.0625 Max value 0.0248718 0.0248718 0.0248718 0.0248718 Single image 1 volumes. isha@isha-laptop:~$ md md5summdatopbm mdeltree mdu md5sum.textutils mdel mdir isha@isha-laptop:~$ md5sum test.osgb d6e166dd334428d8da6a90ffdbf3d04b test.osgb isha@isha-laptop:~$ Also i was wondering, how feasible is it to load vtk images into openscenegraph?? Thank you soo much, I really really appreciate it. ... Thank you! Warm Regards, Cheers, Isha -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40480#40480 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] Build OSG using DCMTK
Hi Isha, Could you please do the test exactly as I have suggested, it's the only way that we can generate the same test.osgb that will make it possible to compare the output you and I get. Thanks, Robert. On Tue, Jun 14, 2011 at 6:36 PM, Isha Kandaswamy wrote: > Hi, > > The checksum I get when running md5sum is > > da590eaad20dc1f9c8b933d2ae309c08 bin/isha.osg > > > ... > > Thank you! > > Cheers, > Isha > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=40476#40476 > > > > > > ___ > 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] [osgPlugins] Build OSG using DCMTK
Hi, The checksum I get when running md5sum is da590eaad20dc1f9c8b933d2ae309c08 bin/isha.osg ... Thank you! Cheers, Isha -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40476#40476 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Absolute beginner questions
Hi Basil, I run a dual monitor setup. When I run an OSG application, it uses the whole display. When I switch to windowed mode, it still runs in two separate windows. Is there any way that I can get it to run in one window only or to get it to open in a window? When you use viewer.run() or viewer.realize() without having created windows yourself, it will automatically create windows over both screens. Before calling viewer.realize(), set up the view the way you want. You can use one of: viewer.setUpViewInWindow(...); or viewer.setUpViewOnSingleScreen(...); or viewer.setUpViewAcrossAllScreens(...); (the last one is what is used by default as you'll have guessed) Or you can do whatever custom setup you want by creating one/many GraphicsWindow(s) yourself, you can take inspiration from the code of the above methods in the OSG sources. If you want to use the stock osgviewer application, you can use the --screen and/or --window arguments (or the OSG_SCREEN and/or OSG_WINDOW environment variables) to get it to pop up on the screen which ever way you want. Run osgviewer --help-all for details. Hope this helps, -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Absolute beginner questions
I've gotten a little farther. Got around to checking out "OpenSceneGraph 3.0 Beginner's Guide" and if anyone else comes along on this forum in my position, do yourself a favor and purchase this book. Anyway, one question that I am having is this: I run a dual monitor setup. When I run an OSG application, it uses the whole display. When I switch to windowed mode, it still runs in two separate windows. Is there any way that I can get it to run in one window only or to get it to open in a window? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40474#40474 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] Difficulties to load images from memory
Thanks J.P., that was the working solution :) I found a comprehensive explanation on SO, if anybody is interested. http://stackoverflow.com/questions/2786816/how-to-create-c-istringstream-from-a-char-array-with-null0-characters Thanks! :) Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40473#40473 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgCompute] Computations outside computation node
Hi jcronje, the graphics context is initialized by OSG before the first rendering traversal. Context handling is not so easy with OSG. I usually set the following flag in order to not loose the context at the end of each frame: Code: _viewer->setReleaseContextAtEndOfFrameHint(false); Otherwise you need to call makeCurrent() to the context before the first call to osgCuda::Texture::map(). Please be aware that osgCompute only works with a single context and a single threaded application. Code: _viewer->setThreadingModel( osgViewer::ViewerBase::SingleThreaded ); There are several options I have in mind with a standard osgViewer::Viewer: OPTION A After osgViewer::ViewerBase::realize() simply call makeCurrent() to your osg::GraphicsContext. This can be done during the initialization of your viewer e.g. in your "main.cpp". Code: _viewer->realize(); ... _viewer->getContexts( contexts ); // There should be only a single context contexts.front()->makeCurrent(); ... _texmemory->map(); ( I would prefer this method ) OPTION B Wait for osgUtil::GLObjectsVisitor traversing the scene. The first time it does the context is initialized and set as the current context. OPTION C Add your own osg::Operation as osgViewer::ViewerBase::setRealizeOperation(). At the time, the context is realized, this operation is called. As the viewer calls releaseContext() afterwards, you have to call makeCurrent() once before your modules. Hopefully this answers your question. Cheers, Jens -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40471#40471 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG 2.8.5 public announcements
On 6/14/2011 8:49 AM, Paul Martz wrote: > FYI... > http://www.opengl.org/ > http://www.khronos.org/ Yay! Thank you! -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. "There is no Truth. There is only Perception. To Perceive is to Exist." - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] OSG 2.8.5 public announcements
FYI... http://www.opengl.org/ http://www.khronos.org/ -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] Difficulties to load images from memory
Hi, std::string has a constructor that you can pass a char* and size to. string ( const char * s, size_t n ); This ignores \0's. You can then << it into a stringstream or possibly even directly put it into stringstream.str() HTH jp On 14/06/11 16:35, Daniel Cámpora wrote: Hello community, Apparently, the problem is related to the formation of the strings I'm trying to pass to the istringstream. Since they contain the \0 character, they finish earlier than expected. Has anybody found any workaround for this? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40466#40466 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html. This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] Difficulties to load images from memory
Daniel, Use the ios::binary open mode for istringstream. HTH Chuck On Jun 14, 2011, at 7:35 AM, Daniel Cámpora wrote: > Hello community, > > Apparently, the problem is related to the formation of the strings I'm trying > to pass to the istringstream. Since they contain the \0 character, they > finish earlier than expected. > > Has anybody found any workaround for this? > > Thank you! > > Cheers, > Daniel > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=40466#40466 > > > > > > ___ > 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] [osgPlugins] Difficulties to load images from memory
Hello community, Apparently, the problem is related to the formation of the strings I'm trying to pass to the istringstream. Since they contain the \0 character, they finish earlier than expected. Has anybody found any workaround for this? Thank you! Cheers, Daniel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40466#40466 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PagedLOD displays incorrect child
Hi Vaclav, Your bug fix will break the way that PageLOD is supposed work, it is suppossed to fallback to the next level of detail which if you restrict to only rendering the children that match the range you will end up with holes in the your scenes. It sounds very much like you still have a problem with the setup of your PagedLOD ranges. Robert. On Tue, Jun 14, 2011 at 2:30 PM, Vaclav Bilek wrote: > Robert, > > I have solution which works for me. I was just curious what is wrong and > possibly wanted to help to find a bug. > I debugged that with very simple scene and messages in the code and I > did not find solution without modification of the PagedLOD class. > Anyway, as this works for me and nobody else observes similar problem we > can close this topic. > > Thank you for your help and your patience! > > Best regards > Vaclav > > On 06/14/2011 03:15 PM, Robert Osfield wrote: >> Hi Vaclav, >> >> If you've fixed the overlap then I have no idea what might cause the >> two subgrpah jitter. I don't recal others come across the same issue. >> The code is setup so it will choose one or the other so if you've got >> things set up correctly it should just work. >> >> I'm afraid this issue is one you'll need to investigate. >> >> Robert. >> >> On Tue, Jun 14, 2011 at 2:01 PM, Vaclav Bilek wrote: >>> Hi Robert >>> >>> my lowerlod has 5..10 and higherlod has 0..5. Here I don't see an overlap. >>> >>> Your are right in case of my extralod which was 0..11. I removed it but >>> and the problem persists. >>> >>> The only possible overlap may be in case o the value of 5, but based the >>> code the distance is evaluated as: >>> (min <= distance >> not overlapping. >>> >>> Vaclav >>> >>> >>> On 06/14/2011 02:33 PM, Robert Osfield wrote: Hi Vaclav, On Tue, Jun 14, 2011 at 1:12 PM, Vaclav Bilek wrote: > However when the lower child is present (visible), the higher child goes > for a moment into the scene and this makes jitter (two scenes at same > place overlapping) and may unnecessarily decrease performance. Is this > correct or I still do something wrong. I rearranged the scene to have > only lowerlod and higherlod and I still see short 'blink' of the > higherlod when it gets first time traversed. You shouldn't have two PageLOD children with overlapping ranges, try removing this overlap. Robert. ___ 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 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] PagedLOD displays incorrect child
Robert, I have solution which works for me. I was just curious what is wrong and possibly wanted to help to find a bug. I debugged that with very simple scene and messages in the code and I did not find solution without modification of the PagedLOD class. Anyway, as this works for me and nobody else observes similar problem we can close this topic. Thank you for your help and your patience! Best regards Vaclav On 06/14/2011 03:15 PM, Robert Osfield wrote: > Hi Vaclav, > > If you've fixed the overlap then I have no idea what might cause the > two subgrpah jitter. I don't recal others come across the same issue. > The code is setup so it will choose one or the other so if you've got > things set up correctly it should just work. > > I'm afraid this issue is one you'll need to investigate. > > Robert. > > On Tue, Jun 14, 2011 at 2:01 PM, Vaclav Bilek wrote: >> Hi Robert >> >> my lowerlod has 5..10 and higherlod has 0..5. Here I don't see an overlap. >> >> Your are right in case of my extralod which was 0..11. I removed it but >> and the problem persists. >> >> The only possible overlap may be in case o the value of 5, but based the >> code the distance is evaluated as: >> (min <= distance > not overlapping. >> >> Vaclav >> >> >> On 06/14/2011 02:33 PM, Robert Osfield wrote: >>> Hi Vaclav, >>> >>> On Tue, Jun 14, 2011 at 1:12 PM, Vaclav Bilek wrote: However when the lower child is present (visible), the higher child goes for a moment into the scene and this makes jitter (two scenes at same place overlapping) and may unnecessarily decrease performance. Is this correct or I still do something wrong. I rearranged the scene to have only lowerlod and higherlod and I still see short 'blink' of the higherlod when it gets first time traversed. >>> You shouldn't have two PageLOD children with overlapping ranges, try >>> removing this >>> overlap. >>> >>> Robert. >>> ___ >>> 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 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] PagedLOD displays incorrect child
Hi Vaclav, If you've fixed the overlap then I have no idea what might cause the two subgrpah jitter. I don't recal others come across the same issue. The code is setup so it will choose one or the other so if you've got things set up correctly it should just work. I'm afraid this issue is one you'll need to investigate. Robert. On Tue, Jun 14, 2011 at 2:01 PM, Vaclav Bilek wrote: > Hi Robert > > my lowerlod has 5..10 and higherlod has 0..5. Here I don't see an overlap. > > Your are right in case of my extralod which was 0..11. I removed it but > and the problem persists. > > The only possible overlap may be in case o the value of 5, but based the > code the distance is evaluated as: > (min <= distance not overlapping. > > Vaclav > > > On 06/14/2011 02:33 PM, Robert Osfield wrote: >> Hi Vaclav, >> >> On Tue, Jun 14, 2011 at 1:12 PM, Vaclav Bilek wrote: >>> However when the lower child is present (visible), the higher child goes >>> for a moment into the scene and this makes jitter (two scenes at same >>> place overlapping) and may unnecessarily decrease performance. Is this >>> correct or I still do something wrong. I rearranged the scene to have >>> only lowerlod and higherlod and I still see short 'blink' of the >>> higherlod when it gets first time traversed. >> You shouldn't have two PageLOD children with overlapping ranges, try >> removing this >> overlap. >> >> Robert. >> ___ >> 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 mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PagedLOD displays incorrect child
Hi Robert my lowerlod has 5..10 and higherlod has 0..5. Here I don't see an overlap. Your are right in case of my extralod which was 0..11. I removed it but and the problem persists. The only possible overlap may be in case o the value of 5, but based the code the distance is evaluated as: (min <= distance Hi Vaclav, > > On Tue, Jun 14, 2011 at 1:12 PM, Vaclav Bilek wrote: >> However when the lower child is present (visible), the higher child goes >> for a moment into the scene and this makes jitter (two scenes at same >> place overlapping) and may unnecessarily decrease performance. Is this >> correct or I still do something wrong. I rearranged the scene to have >> only lowerlod and higherlod and I still see short 'blink' of the >> higherlod when it gets first time traversed. > You shouldn't have two PageLOD children with overlapping ranges, try > removing this > overlap. > > Robert. > ___ > 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] [osgPlugins] Build OSG using DCMTK
Hi Isha, On Mon, Jun 13, 2011 at 11:03 PM, Isha Kandaswamy wrote: > So i tried it on a different machine, and it worked. But the skull does not > look as clean as yours. It looks more squished, like it is from both sides It's good to hear that you've seen an improvement which does at least suggest that your laptops driver/hardware are not up to doing volume rendering.However, I'm afraid I don't have any ideas what might be causing the differences between what you and I see, I guess this could be another hardware/driver issue. What OS/hardware/drivers does this other hardware have? Please do the md5sum test I suggested and provide details on what you find - this will help establish what parts may or may be the cause. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PagedLOD displays incorrect child
Hi Vaclav, On Tue, Jun 14, 2011 at 1:12 PM, Vaclav Bilek wrote: > However when the lower child is present (visible), the higher child goes > for a moment into the scene and this makes jitter (two scenes at same > place overlapping) and may unnecessarily decrease performance. Is this > correct or I still do something wrong. I rearranged the scene to have > only lowerlod and higherlod and I still see short 'blink' of the > higherlod when it gets first time traversed. You shouldn't have two PageLOD children with overlapping ranges, try removing this overlap. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Osg, Motif and multiple screens
Thanks! I will try this out. Cheers, Vincent -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40455#40455 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PagedLOD displays incorrect child
Hi Robert Thank you for answer and for confirmation how the PagedLOD works. I observed this behavior and I like the way the child is preserved until the next child gets loaded. However when the lower child is present (visible), the higher child goes for a moment into the scene and this makes jitter (two scenes at same place overlapping) and may unnecessarily decrease performance. Is this correct or I still do something wrong. I rearranged the scene to have only lowerlod and higherlod and I still see short 'blink' of the higherlod when it gets first time traversed. Vaclav On 06/14/2011 10:59 AM, Robert Osfield wrote: > HI Vaclav, > > PagedLOD is designed to be used with the first child being the lower > level of detail, the second the next up and so on. If during > traversal the LOD range requires a higher LOD child that isn't > available yet a request is made to the DatabasePager (Which runs with > it's own dedicted thread) to load this child and to ensure that there > is something to render in it's place while wait for the new child to > be load the next level of detail down is chosen i.e. the child > preceeding it in the list. On each frame that that requested LOD > child is still hasn't been loaded the next level of down will be > continue to be chosen and request for load is renewed. Once the > requested child has been loaded it will be merged during the update > traversal and finally this child will be chosen. > > Robert. > > On Tue, Jun 14, 2011 at 6:12 AM, Vaclav Bilek wrote: >> Dear Osgers, >> >> Based on my exploration I found interesting behavior of PagedLOD traversal. >> In some condition the PagedLOD displays incorrect child (child out of >> specified distance range). >> >> I am curious if I did something wrong, if it is intended design or if I >> found a bug. >> >> Please imagine following case: >> >> (PagedLOD) >> | >>+--+--+ >> | >> | | >> name : (lowerlod) (higherlod) (extralod) >> range : 5..10 0..5 >> 0..11 >> file : lowerlod.ivehigherlod.ive extralod.ive >> >> Also please consider that the camera is in distance of 7 from the PagedLOD >> center. >> >> Put this scene to the viewer and observe how the traversal behaves: >> >> Traversal 1: >> - When the PagedLOD went traversed the 'lowerlod' gets loaded in request to >> the database pager (lowerlod.ive). >> >> Traversal 2: >> - In this next traversal of the PagedLOD the 'lowerlod' is already in the >> scene and because it fits to the range (5 <= distance < 10), it gets >> traversed and displayed. >> - In next step the child 'higherlod' is determined to be loaded and the >> database pager is asked to load the file higherlod.ive >> >> Traversal 3: >> - The 'lowerlod' still fits into the range, so it is traversed and >> displayed. >> - The 'higherlod' is already loaded, however it does not fit to the range it >> is not traversed - but only for a moment. >> - Finally here the problem occurs. Although the 'higherlod' does not fit >> into the range (0 <= distance < 5) it is traversed and displayed because of >> this code (somewhere in PagedLOD.cpp: PagedLOD::traverse() ): >> >> //running conditions at traversal #3 >> // lastChildTraversed == 0 // <= this is recored when the 'lowerlod' is >> determined to be traversed&displayed >> // numChildren == 2 // this is size of the std::vector >> container _children when both 'lowerlod' and 'higherlod' >> ... >> // select the last valid child. if (numChildren>0 && >> ((int)numChildren-1)!=lastChildTraversed) { if (updateTimeStamp) { >> _perRangeDataList[numChildren-1]._timeStamp=timeStamp; >> _perRangeDataList[numChildren-1]._frameNumber=frameNumber; } >> _children[numChildren-1]->accept(nv); } ... >> >> What is interesting: >> From my user point of view the LOD should be displayed only if it fits into >> specified ranges. The PagedLOD is understood as LOD with on-demand loading >> capability. And here the PagedLOD does not hit my user expectations. Maybe I >> construct the scene wrong but even if I put the 'lowerlod' before or after >> the 'higherlod' or on the end after the 'extralod' the behavior stays the >> same. >> >> I did little change by adding new condition and now it works as I expected >> Modified code fragment (same place as above): >> ... >> // select the last valid child. if (numChildren>0 && >> ((int)numChildren-1)!=lastChildTraversed) { >> if (_rangeList[numChildren-1].first<=required_range && >> required_range<_rangeList[numChildren-1].second) // <= this is the >> additional condition >> { >> if (updateTimeStamp) { >> _perRangeDataList[numChildren-1]._timeStamp=timeStamp; >> _perRangeDataList[numChildren-1]._frameNumber=frameNumber; } >> _children[numChildren-1]->accept(nv); >> } >> } ... >> >>
[osg-users] multitexture in osg files
Hi, i made a simple model in blender for test purpose the model contain 2 uvmap in it to make a runway + decals over it the i export it to osg , please see the attached file however since every thing look right in blender especially when rendering i can't see the first texture unit in osgviewer another thing i tried the multicontroltexture osg example but i always have this warning talking about that file must have 2 texture units on it etc etc . i have already my terrain database made with vpb, how to add a second texture to it another question about that example : is it possible to draw the runway texture and decals directly on top of the vpb terrain node, with that no z-fighting right ? is that the purpose of the multicontroltexture example ? -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40454#40454 plane_base.osg Description: Binary data ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] PagedLOD displays incorrect child
HI Vaclav, PagedLOD is designed to be used with the first child being the lower level of detail, the second the next up and so on. If during traversal the LOD range requires a higher LOD child that isn't available yet a request is made to the DatabasePager (Which runs with it's own dedicted thread) to load this child and to ensure that there is something to render in it's place while wait for the new child to be load the next level of detail down is chosen i.e. the child preceeding it in the list. On each frame that that requested LOD child is still hasn't been loaded the next level of down will be continue to be chosen and request for load is renewed. Once the requested child has been loaded it will be merged during the update traversal and finally this child will be chosen. Robert. On Tue, Jun 14, 2011 at 6:12 AM, Vaclav Bilek wrote: > Dear Osgers, > > Based on my exploration I found interesting behavior of PagedLOD traversal. > In some condition the PagedLOD displays incorrect child (child out of > specified distance range). > > I am curious if I did something wrong, if it is intended design or if I > found a bug. > > Please imagine following case: > > (PagedLOD) > | > +--+--+ > | > | | > name : (lowerlod) (higherlod) (extralod) > range : 5..10 0..5 > 0..11 > file : lowerlod.ive higherlod.ive extralod.ive > > Also please consider that the camera is in distance of 7 from the PagedLOD > center. > > Put this scene to the viewer and observe how the traversal behaves: > > Traversal 1: > - When the PagedLOD went traversed the 'lowerlod' gets loaded in request to > the database pager (lowerlod.ive). > > Traversal 2: > - In this next traversal of the PagedLOD the 'lowerlod' is already in the > scene and because it fits to the range (5 <= distance < 10), it gets > traversed and displayed. > - In next step the child 'higherlod' is determined to be loaded and the > database pager is asked to load the file higherlod.ive > > Traversal 3: > - The 'lowerlod' still fits into the range, so it is traversed and > displayed. > - The 'higherlod' is already loaded, however it does not fit to the range it > is not traversed - but only for a moment. > - Finally here the problem occurs. Although the 'higherlod' does not fit > into the range (0 <= distance < 5) it is traversed and displayed because of > this code (somewhere in PagedLOD.cpp: PagedLOD::traverse() ): > > //running conditions at traversal #3 > // lastChildTraversed == 0 // <= this is recored when the 'lowerlod' is > determined to be traversed&displayed > // numChildren == 2 // this is size of the std::vector > container _children when both 'lowerlod' and 'higherlod' > ... > // select the last valid child. if (numChildren>0 && > ((int)numChildren-1)!=lastChildTraversed) { if (updateTimeStamp) { > _perRangeDataList[numChildren-1]._timeStamp=timeStamp; > _perRangeDataList[numChildren-1]._frameNumber=frameNumber; } > _children[numChildren-1]->accept(nv); } ... > > What is interesting: > From my user point of view the LOD should be displayed only if it fits into > specified ranges. The PagedLOD is understood as LOD with on-demand loading > capability. And here the PagedLOD does not hit my user expectations. Maybe I > construct the scene wrong but even if I put the 'lowerlod' before or after > the 'higherlod' or on the end after the 'extralod' the behavior stays the > same. > > I did little change by adding new condition and now it works as I expected > Modified code fragment (same place as above): > ... > // select the last valid child. if (numChildren>0 && > ((int)numChildren-1)!=lastChildTraversed) { > if (_rangeList[numChildren-1].first<=required_range && > required_range<_rangeList[numChildren-1].second) // <= this is the > additional condition > { > if (updateTimeStamp) { > _perRangeDataList[numChildren-1]._timeStamp=timeStamp; > _perRangeDataList[numChildren-1]._frameNumber=frameNumber; } > _children[numChildren-1]->accept(nv); > } > } ... > > Now the child gets traversed only if it fits into the specified range. > > Hope my english is enough to explain this. I welcome any comments and very > curios if anybody observed similar problem. > > Best regards > Vaclav > > > ___ > 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] Osg, Motif and multiple screens
Hi Vincent, GraphicsWindowEmbedded is not compatible with multi-context work is it does an non op for the makeCurrentImplementation() swapBuffersImplementation(). GraphicsWindowEmbedded is written to be very easy to use for single context single threaded applictions, for multi-context work you have to move on to using a full GraphicsWindow implementation. As I said in my previous email you should get osgViewer to create the GLX context for you. The way to do this is to pass in the Motif window widget as a parent via the osg::GraphicsContext::Traits::inheritedWindowData and use the osgViewer::GraphicsWindowX11::WindowData (see include/osgViewer/api/X11/GraphicsWindowX11) and let osgViewer::GraphicsWindowX11 create the GLX context for you. Another alternative route woudl be to create your own GraphicsWindowMotif subclass from osgViewer::GraphicsWindow that implements all the appropriate GraphicsContext::*Implementation() methods as per other subclasses. Several of the osgviewer* examples do this such as osgviewerWX, osgviewerFOX and osgviewerQt (see the osgQt library implementation). Robert. On Mon, Jun 13, 2011 at 5:00 PM, Vincent DEBOSSE wrote: > Thanks for the quick answer. > > I'm using OSG 2.8.3 with osgOcean. > > The 3D views are embedded in an existing MOTIF application which I cannot > modify. Instead, this application calls my library with the widget that I > need to draw on. > > I use XDisplay(Widget w) to get the screen for each widget (5 widgets per > screen). > > The integration is done with the GLw library. > > I have a class that defines the scene and contains an instance of > osgViewer::Viewer with its own Camera. > > The initialization is something like this (simplified) : > > Code: > > void initialize(Widget w) > { > // Create our scene > Scene s = new Scene; > > // Get the display associated with the widget > Display* dpy = XDisplay(w); > > osgViewer::Viewer viewer = scene->getViewer(); > osgViewer::GraphicsWindowEmbedded gfx = > viewer->setUpViewerAsEmbeddedInWindow(w.core.x, w.core.y, w.core.width, > w.core.height); > > // Build a XVisualInfo object from the traits and the display > XVisualInfo* info = createVisualInfo(dpy, > viewer->getCamera()->getGraphicsContext()->getTraits()); > XtSetArg(argsGL[0], (char*) GLwNvisualInfo, info); > > // Create the GLX Context for the active display > GLXContext glxContext = glXCreateContext(dpy, info, 0, GL_TRUE); > > viewer->realize(); > gfx->realize(); > > // One per widget > Widget drawArea = GLwCreateMDrawingArea(w, (char*) "View", argsGL, 1); > XtManageChild(drawArea); > } > > > > > The rendering is done in a scheduled method (every 40ms). It can be > simplified as the following: > > Code: > > void draw(Widget w) > { > // Wait for pending X operations before rendering > glXWaitX(); > > // Activate current context > GLwDrawingAreaMakeCurrent(w, glxContext); > > // Computes the new projection > [...] > > viewer->getCamera()->setProjectionMatrixAsPerspective(...); > gfx->resized(0, 0, w.core.width, w.core.height); > > // Render to buffer > viewer->frame(); > > GLwDrawingAreaSwapBuffers(w); > } > > > > > For each screen, there's 5 widgets, 5 drawArea of various sizes, but only one > scene, one glxContext. The method draw is called for each widget as long as > the widget is visible (at most, 4 are visible on a screen). > > There's no issue with only one screen, no flickering. But with a second > screen it's a mess. With only one glxContext, nothing shows up on the second > screen. When I add a second context and duplicate most of the objects, > flickering starts and I get a lot of "invalid operations" in the trace. > This is where I am stuck for now... > > Cheers, > Vincent > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=40417#40417 > > > > > > ___ > 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