Re: [osg-users] [vpb] Link error
Hi, Thanks Sebastian . This solved the problem :-) Finally I have my VPB binary on windows ... now start working :-) Thank you! Cheers, Tonino -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52916#52916 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSG Render Thread in Qt: Access to scene data from main app thread
Hi Robert, So if I have a class where I describe the scene content and where I do changes in real time int update function like this: Code: DemoOSGScene.h /*! Cidetec data osg scene class */ class DemoOSGScene: public OSGScene { public: //! An DemoOSGScene constructor. /*! A more elaborate description of the constructor. */ DemoOSGScene(); //! An DemoOSGScene destructor. /*! A more elaborate description of the destructor. */ ~DemoOSGScene(void); /** \fn osgGenerals::OSGGroup* getSceneGroup() Return the scene group \return osgGenerals::OSGGroup */ osg::Group* getSceneGroup() { return _rootGroup; }; /** \fn void update() Update scene necesary values \return */ void update(); void initialize(); protected: float getDistanceBetweenObjs(osg::Vec3 obj1, osg::Vec3 obj2); osg::MatrixTransform* _mainObject; std::vectorSceneObject_sceneObjectsContainer; osg::Vec3 _mainObjectV; //main object velocity vector int _dificulLevel; float _nextObject; osg::Node* _manzana; }; and the cpp Code: DemoOSGScene::DemoOSGScene() { _type = DEMO; _rootGroup = new osg::Group(); _rootGroup-setDataVariance( osg::Object::DYNAMIC ); //define scene camera positions LookAtCamera camera0 = {osg::Vec3f(0.0, 0.0,0.0), osg::Vec3f(0.0,100.0,100.0), osg::Vec3f(0.0,0.0,1.0)}; addCameraPos(camera0); //lights _rootGroup-addChild(osgGenerals::createLight(osg::Vec3(50.0,200.0,200.0), osg::Vec4(0.9,0.9,0.9,1.0))); //load scene models ... _dificulLevel = 1; _simulTime = 0.0; } DemoOSGScene::~DemoOSGScene(void) { } void DemoOSGScene::initialize() { _nextObject = 3.0; _mainObjectV.set(0.0,0.0,0.0); _sessionScore = 0.0; //clean object container for(int i=0;i_sceneObjectsContainer.size();i++) { _rootGroup-removeChild(_sceneObjectsContainer[i].node); _sceneObjectsContainer.erase(_sceneObjectsContainer.begin()+i); i--; } _mainObject-setMatrix(osg::Matrix::translate(osg::Vec3(mainObjectInitPos[0],mainObjectInitPos[1],mainObjectInitPos[2]))); } void DemoOSGScene::update() { float delta = _simulTime - preSimulTime; //update objects position { ... } //verify scene object collisions { ... } //create or delete objects { ... } preSimulTime = _simulTime; } So in update function I need access to _rootGroup, _sceneObjectsContainer... I have found this solution: Code: class UpdateRootCallback : public osg::Drawable::UpdateCallback { public: virtual void update( osg::NodeVisitor* nv, osg::Drawable* drawable ) { ... } }; _rootGroup-setDataVariance( osg::Object::DYNAMIC ); _rootGroup-setUpdateCallback( new UpdateRootCallback ); But I need to pass my objects pointers from DemoOSGScene... and I don't know how to put thread access control for the objects... Is this the best solution? Thank you! Cheers, Aitor -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52917#52917 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] delete scene osg
Hi, I want to delete a complete scene. I use root-removeChildren(0,root-getNumChildren()); Does it destroys the objects in the scene? Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52918#52918 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] delete scene osg
Hi Lucie Hi, I want to delete a complete scene. I use root-removeChildren(0,root-getNumChildren()); Does it destroys the objects in the scene? Yes and no. First of all it does exactly what the name says. It removes the children from the group. If you don't reference the nodes below that scene anymore(via osg::ref_ptr), they get destroyed (i.e. if their reference count is zero) A simpler approach is to do: root = new osg::Group(), which will also detach all children and is less pain ;-) As you are speaking of the scene, you probably should consider simply setting the viewers scenedata to an empty group: viewer.setSceneData(new osg::Group()); cheers Sebastian Thank you! Cheers, lucie -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52918#52918 ___ 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] Custom NodeVistor injected in the DatabasePager
Hi Community, I am working with txp database and using shaders per nodes in the scene so I come with a need to inject a NodeVisitor when a portion of a database is paged in. Any hints for this? Robert? Thanks a bunch, Cheers, -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [vpb] osgdem crash un win32
Hi, At the end I has able to compile: 1) downloaded latest source code of OSG ( OpenSceneGraph-3.0.1 ) 2) binary 3th parth from http://www.openscenegraph.org/projects/osg/wiki/Downloads/Dependencies ( 3rdParty_VC10_x86_x64.zip ) 3) VPB ( VirtualPlanetBuilder-0.9.12 ) The problem now id that osgdem crash. To be syre the problem is not in my data I used the blu barble data and the command in the book ( OpenSceneGraph 3 Cookbook ) Commad I used is : Code: vpbmaster -t TrueMarble.4km.10800x5400.tif --geocentric -o output/out.os gb Output is Code: C:\Tempvpbmaster -t TrueMarble.4km.10800x5400.tif --geocentric -o output/out.os gb --geocentric -t TrueMarble.4km.10800x5400.tif ADD: TrueMarble.4km.10800x5400.tif -o output/out.osgb Adding terrainTile DataSet::generateTasks_new local_extents = xMin() -180.00 180.00 yMin() -90.00 90.00 AR=2.00 C1=2 R1=1 Computed maximum source level = 6 Selected single split at 3 local_extents = xMin() -180.00 180.00 yMin() -90.00 90.00 AR=2.00 C1=2 R1=1 Task directory already created Log directory already created totalNumOfTasksSansRoot = 8 getTaskName(2,0,0) no nest, 3 0 getTaskName(2,0,1) no nest, 3 0 getTaskName(2,1,0) no nest, 3 0 getTaskName(2,1,1) no nest, 3 0 getTaskName(2,2,0) no nest, 3 0 getTaskName(2,2,1) no nest, 3 0 getTaskName(2,3,0) no nest, 3 0 getTaskName(2,3,1) no nest, 3 0 Generated tasks file = build_master.tasks Revsion source = output\out.osgb.0.source Setting up MachinePool to use all 4 cores on this machine. Begining run scheduling task : tasks/build_root_L0_X0_Y0.task scheduling task : tasks/build_subtile_L2_X0_Y0.task scheduling task : tasks/build_subtile_L2_X0_Y1.task machine= running task=tasks/build_root_L0_X0_Y0.task scheduling task : tasks/build_subtile_L2_X1_Y0.task machine= running task=tasks/build_subtile_L2_X0_Y0.task scheduling task : tasks/build_subtile_L2_X1_Y1.task machine= running task=tasks/build_subtile_L2_X0_Y1.task scheduling task : tasks/build_subtile_L2_X2_Y0.task machine= running task=tasks/build_subtile_L2_X1_Y0.task scheduling task : tasks/build_subtile_L2_X2_Y1.task scheduling task : tasks/build_subtile_L2_X3_Y0.task♪◙scheduling task : tasks/bui ld_subtile_L2_X3_Y1.task Now checking for plug-in osgPlugins-3.0.1/osgdb_nvtt.dll Now checking for plug-in osgPlugins-3.0.1/osgdb_nvtt.dll osg::Registry::addImageProcessor(ImageProcessor) Loaded plug-in osgPlugins-3.0.1/osgdb_nvtt.dll and located ImageProcessor osg::Registry::addImageProcessor(ImageProcessor) Loaded plug-in osgPlugins-3.0.1/osgdb_nvtt.dll and located ImageProcessor Now checking for plug-in osgPlugins-3.0.1/osgdb_nvtt.dll Now checking for plug-in osgPlugins-3.0.1/osgdb_nvtt.dll osg::Registry::addImageProcessor(ImageProcessor) osg::Registry::addImageProcessor(ImageProcessor) Loaded plug-in osgPlugins-3.0.1/osgdb_nvtt.dll and located ImageProcessor Loaded plug-in osgPlugins-3.0.1/osgdb_nvtt.dll and located ImageProcessor machine= completed task=tasks/build_root_L0_X0_Y0.task in 13.7 seconds Number of tasks completed 1, running 3, pending 6. Estimated time to completion 27 seconds, 33.5 percent done. Warning: Task tasks/build_root_L0_X0_Y0.task has failed, blacklisting machine a nd resubmitting task. machine= completed task=tasks/build_subtile_L2_X0_Y1.task in 14.7 seconds Number of tasks completed 2, running 2, pending 7. Estimated time to completion 29 seconds, 33.5 percent done. Warning: Task tasks/build_subtile_L2_X0_Y1.task has failed, blacklisting machine and resubmitting task. machine= completed task=tasks/build_subtile_L2_X0_Y0.task in 15.5 seconds Number of tasks completed 3, running 1, pending 8. Estimated time to completion 30 seconds, 34.0 percent done. Warning: Task tasks/build_subtile_L2_X0_Y0.task has failed, blacklisting machine and resubmitting task. machine= completed task=tasks/build_subtile_L2_X1_Y0.task in 16.2 seconds Number of tasks completed 4, running 0, pending 9. Estimated time to completion 45 seconds, 26.6 percent done. Warning: Task tasks/build_subtile_L2_X1_Y0.task has failed, blacklisting machine and resubmitting task. End of TaskSet: tasksPending=9 taskCompleted=0 taskRunning=0 tasksFailed=0 End of run: tasksPending=9 taskCompleted=0 taskRunning=0 tasksFailed=0 MachinePool::reportTimingStats() Machine : Task::type='' minTime=13.696950 maxTime=16.204090 averageT ime=15.032418 totalComputeTime=60.129671 numTasks=4 Finished run, but did not complete 9 tasks. Total elapsed time = 16.879258 Run Complete. Recieved signal 15, doing TERMINATE_RUNNING_TASKS_THEN_EXIT. MachinePool::signal(15) Machine::signal(15) Machine::cancelThreads() hostname=, threads=4 Cancel thread Cancel thread Cancel thread Cancel thread Completed Machine::cancelThreads() hostname=, threads=4 No output is created and 4 windows with a osgdem crash. Thank you! Cheers, Tonino -- Read this topic online here:
Re: [osg-users] Custom NodeVistor injected in the DatabasePager
Hi Nick, On 1 March 2013 10:36, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: I am working with txp database and using shaders per nodes in the scene so I come with a need to inject a NodeVisitor when a portion of a database is paged in. Any hints for this? Robert? The easist way to manage doing special operations on the loading scene graph is to use an osgDB::Registry::ReadFileCallback that allows to you to interecept the read call do the read operation then post process the loaded scene graph before you pass it back. This works for all read operations including the database pager. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Custom NodeVistor injected in the DatabasePager
Thanks Robert. That is exactly what I was looking Nick On Fri, Mar 1, 2013 at 12:04 PM, Robert Osfield robert.osfi...@gmail.comwrote: Hi Nick, On 1 March 2013 10:36, Trajce Nikolov NICK trajce.nikolov.n...@gmail.com wrote: I am working with txp database and using shaders per nodes in the scene so I come with a need to inject a NodeVisitor when a portion of a database is paged in. Any hints for this? Robert? The easist way to manage doing special operations on the loading scene graph is to use an osgDB::Registry::ReadFileCallback that allows to you to interecept the read call do the read operation then post process the loaded scene graph before you pass it back. This works for all read operations including the database pager. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- trajce nikolov nick ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] attribute from osg to vertex
Hi, i'm finding a lot of difficult to solve this issue: pass uniform and attribute parameters from osg application to shader. In particular, referred to attribute (or in) parameter in vertex program : Code: #version 150 attribute vec3 Vertex; attribute vec2 Uv; uniform mat4 osg_ProjectionMatrix; uniform mat4 ViewMatrix; uniform mat4 osg_ViewMatrixInverse; uniform vec3 ModelScale; How can i pass these data from my osg application? Currently, in my osg applycation i use : Code: mProgram-addBindAttribLocation(Vertex,0); mProgram-addBindAttribLocation(Uv,8); Is it correct? I looked at an example on OpenSceneGraph 3 cookbook chapter 6, Using the bump tecnique where to pass these attributes : Code: attribute vec3 tangent; attribute vec3 binormal; The authors (Rui Wang, Xuelei Qian) use a ComputeTangentVisitor nodevisitor class to compute tangent and binormal for each vertex: Code: class ComputeTangentVisitor : public osg::NodeVisitor { public: void apply( osg::Node node ) { traverse(node); } void apply( osg::Geode node ) { for ( unsigned int i=0; inode.getNumDrawables(); ++i ) { osg::Geometry* geom = dynamic_castosg::Geometry*( node.getDrawable(i) ); if ( geom ) generateTangentArray( geom ); //setGeometryVertexArray(geom); } traverse( node ); } void generateTangentArray( osg::Geometry* geom ) { osg::ref_ptrosgUtil::TangentSpaceGenerator tsg = new osgUtil::TangentSpaceGenerator; tsg-generate( geom ); geom-setVertexAttribArray( 6, tsg-getTangentArray() ); geom-setVertexAttribBinding( 6, osg::Geometry::BIND_PER_VERTEX ); geom-setVertexAttribArray( 7, tsg-getBinormalArray() ); geom-setVertexAttribBinding( 7, osg::Geometry::BIND_PER_VERTEX ); } }; and bind them with the following code : Code: ComputeTangentVisitor ctv; ctv.setTraversalMode( osg::NodeVisitor::TRAVERSE_ALL_CHILDREN ); mModel-accept( ctv ); mProgram-addBindAttribLocation(tangent,6); mProgram-addBindAttribLocation(binormal,7); But, in my case vertex are already exist. So i suppose to use only : mProgram-addBindAttribLocation(Vertex,0); And what about the Uv parameter? The texture i have to pass to fragment, is a RTT Camera image, on which i would like to apply some effects. How can i pass these texture coordinates to shader? About the uniform parameters, is there a way to pass the ViewMatrix? I used myCamera-getViewMatrix() in my osgapplication, and i set uniform to this value inside a callback: Code: osg::ref_ptrosg::Uniform viewUniformParam = new osg::Uniform(ViewMatrix, osg::Matrixf()); viewUniformParam-setUpdateCallback( new ViewMatrixCallback(mApplicationCamera.get()) ); with : Code: class ViewMatrixCallback : public osg::Uniform::Callback { public: ViewMatrixCallback(osg::Camera* appcamera): osg::Uniform::Callback() { mApplicationCamera=appcamera; }; virtual void operator()( osg::Uniform* uniform, osg::NodeVisitor* nv ) { osg::Matrix vmFromCamera=mApplicationCamera-getViewMatrix(); uniform-set( vmFromCamera ); } protected: osg::ref_ptrosg::Camera mApplicationCamera; }; But i get no results. Could you give me some suggestions? Thank you! Cheers, Andrea -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52925#52925 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Quad buffered on Windows?
Hi Chris, In the Manage 3D settings section of the nVidia control panel, there should be an option labeled Stereo - Enable. It defaults to OFF. Have the customer make sure that setting is set to ON. Cheers, Farshid On Fri, Mar 1, 2013 at 9:44 AM, Chris Hanson xe...@alphapixel.com wrote: I've been working with a client that wants to show off some spiffy OSG stuff on a real 3D display at a convention. Not owning a real 3D display, I've tested with a pair of red/blue glasses and the environment vars to enable ANAGLYPHIC mode and it works great. So far, they have been unable to get into 3D mode using the OSG_STEREO=ON OSG_STEREO_MODE=QUAD_BUFFER environment variable. System specs are: Windows 7 64-bit, Intel Xeon CPU 2.00GHz 2 processors, 12 GB of RAM) Quadro FX 3700 total memory 4095, driver version 310.90 3D Stereo Enabled: On-board DIN connector Dell Alienware2310 Monitor, 120 Hz Anyone have any tricks for making this work? Doesn't seem like it should be too hard. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android @alphapixel https://twitter.com/alphapixel facebook.com/alphapixel (775) 623-PIXL [7495] ___ 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] Quad buffered on Windows?
I suggested this and they confirm it is on. There doesn't seem to be a lot of troubleshooting opportunities. I'm going to get a heavy debug dump from OSG notify and see if I see OSG complaining about anything not being available. On Fri, Mar 1, 2013 at 11:15 AM, Farshid Lashkari fla...@gmail.com wrote: Hi Chris, In the Manage 3D settings section of the nVidia control panel, there should be an option labeled Stereo - Enable. It defaults to OFF. Have the customer make sure that setting is set to ON. Cheers, Farshid On Fri, Mar 1, 2013 at 9:44 AM, Chris Hanson xe...@alphapixel.com wrote: I've been working with a client that wants to show off some spiffy OSG stuff on a real 3D display at a convention. Not owning a real 3D display, I've tested with a pair of red/blue glasses and the environment vars to enable ANAGLYPHIC mode and it works great. So far, they have been unable to get into 3D mode using the OSG_STEREO=ON OSG_STEREO_MODE=QUAD_BUFFER environment variable. System specs are: Windows 7 64-bit, Intel Xeon CPU 2.00GHz 2 processors, 12 GB of RAM) Quadro FX 3700 total memory 4095, driver version 310.90 3D Stereo Enabled: On-board DIN connector Dell Alienware2310 Monitor, 120 Hz Anyone have any tricks for making this work? Doesn't seem like it should be too hard. -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android @alphapixel https://twitter.com/alphapixel facebook.com/alphapixel (775) 623-PIXL [7495] ___ 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 -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android @alphapixel https://twitter.com/alphapixel facebook.com/alphapixel (775) 623-PIXL [7495] ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org