[osg-users] [vpb] Correct way to get texture data from USGS or any other source?
Hello! I try to build map using vpb in ECEF. According to manuals i've read it needs to start: vpbmaster --geocentric -t texture_file -o output_file So, clearly i need georeferenced texture file. On that page: http://www.osgvisual.org/projects/osgvisual/wiki/OsgTerrainData there is a bunch of links to get data. Since --geocentric option allows not to use elevation data, then only textures are needed. And here is a problem: i can't get georeferenced textures from USGS. All files i choose from different sets there are without georeferenced information. gdalinfo output: c:\Terrain\1_42822\FL\2007\200701_bay_county_fl_1ft_sp_clr\vol001gdalinfo 42822.tif Driver: GTiff/GeoTIFF Files: 42822.tif 42822.tfw Size is 5000, 5000 Coordinate System is: LOCAL_CS[unnamed, UNIT[US survey foot,0.3048006096012192, AUTHORITY[EPSG,9003]]] Origin = (1655000.3300010,574999.511) Pixel Size = (1.000,-1.000) Metadata: AREA_OR_POINT=Area TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch) TIFFTAG_XRESOLUTION=1 TIFFTAG_YRESOLUTION=1 Image Structure Metadata: INTERLEAVE=PIXEL Corner Coordinates: Upper Left ( 1655000.330, 574999.510) Lower Left ( 1655000.330, 56.510) Upper Right ( 166.330, 574999.510) Lower Right ( 166.330, 56.510) Center ( 1657500.330, 572499.510) Band 1 Block=5000x1 Type=Byte, ColorInterp=Red Overviews: 1024x1024 Band 2 Block=5000x1 Type=Byte, ColorInterp=Green Overviews: 1024x1024 Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue Overviews: 1024x1024 gdalwarp output: c:\Terrain\1_42822\FL\2007\200701_bay_county_fl_1ft_sp_clr\vol001gdalwarp -t_srs +proj=longlat +ellps=WGS84 42822.tif 42822_conv.tif ERROR 1: No PROJ.4 translation for source SRS, coordinate transformation initialization has failed. Creating output file that is 5000P x 5000L. Processing input file 42822.tif. 0...10...20...30...40...50...60...70...80...90...100 - done. gdalwarp converted file output: c:\Terrain\1_42822\FL\2007\200701_bay_county_fl_1ft_sp_clr\vol001gdalinfo 42822_conv.tif Driver: GTiff/GeoTIFF Files: 42822_conv.tif Size is 5000, 5000 Coordinate System is: GEOGCS[WGS 84, DATUM[unknown, SPHEROID[WGS84,6378137,298.257223563]], PRIMEM[Greenwich,0], UNIT[degree,0.0174532925199433]] Origin = (1655000.3300010,574999.511) Pixel Size = (1.000,-1.000) Metadata: AREA_OR_POINT=Area TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch) TIFFTAG_XRESOLUTION=1 TIFFTAG_YRESOLUTION=1 Image Structure Metadata: INTERLEAVE=PIXEL Corner Coordinates: Upper Left ( 1655000.330, 574999.510) (Invalid angle,Invalid angle) Lower Left ( 1655000.330, 56.510) (Invalid angle,Invalid angle) Upper Right ( 166.330, 574999.510) (Invalid angle,Invalid angle) Lower Right ( 166.330, 56.510) (Invalid angle,Invalid angle) Center ( 1657500.330, 572499.510) (Invalid angle,Invalid angle) Band 1 Block=5000x1 Type=Byte, ColorInterp=Red Band 2 Block=5000x1 Type=Byte, ColorInterp=Green Band 3 Block=5000x1 Type=Byte, ColorInterp=Blue Reprojection doesn't work and it seems very reasonably, because gdal doesn't know the source projection. vpbmaster output: c:\Terrainvpbmaster --geocentric -t c:/terrain/42822_conv.tif -o c:/terrain/out.osgb --geocentric -t c:/terrain/42822_conv.tif ADD: c:/terrain/42822_conv.tif -o c:/terrain/out.osgb Adding terrainTile Error: vpbmaster can not run without all source data being in the correct destination coordinates system, please reproject them. Recieved signal 15, doing TERMINATE_RUNNING_TASKS_THEN_EXIT. Setting up MachinePool to use all 8 cores on this machine. MachinePool::signal(15) Machine::signal(15) Machine::cancelThreads() hostname=, threads=8 Cancel thread Cancel thread Cancel thread Cancel thread Cancel thread Cancel thread Cancel thread Cancel thread Completed Machine::cancelThreads() hostname=, threads=8 BlueMarble data works, but since the best accuracy is about 250 meters, i can't create a proper detailed terrain. What am i doing wrong? Thanks a lot and best regards! Elias -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63998#63998 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] how to insert a QWidgetImage in a osgWidget::Window?
Hi all, I would like to show a Qt widget in a 3D viewer. I would like to drag it around, scale it and interact with it. I looked at the osgQtWidgets example but didn't find exactly what I need. Since I already implemented objects that are osgWidget::Window, I thought to add the geometry got from osg::createTexturedQuadGeometry() to the osgWidget::Window geode. So I created a Texture2D object and set to the osgWidget::Window with setTextureAttributeAndModes(0, texture). I also set an InteractiveImageHandler as cull callback. The problem is that I can't see the image. For testing I set an image loaded from file to the texture object and it works fine. So what is missing in my code to see the Qt widget image? Code: osg::ref_ptrosgWidget::Window window = new osgWidget::Canvas; float x = 0.0; float y = 0.0; float width = widget-size().width(); float height = widget-size().height(); osg::ref_ptrosg::Texture2D texture = new osg::Texture2D; osg::ref_ptrosg::Geometry quad; //std::string imageFile = C:/Users/User/Desktop/test.jpg; //osg::ref_ptrosg::Image image = osgDB::readImageFile(imageFile); //texture-setImage(image.get()); osg::ref_ptrosgQt::QWidgetImage widgetImage = new osgQt::QWidgetImage(widget); texture-setImage(widgetImage.get()); quad = osg::createTexturedQuadGeometry(osg::Vec3(x, y,0.0f),//center osg::Vec3(width,0.0f,0.0f),//width osg::Vec3(0.0f,height,0.0) );//height osg::StateSet* stateset = quad-getOrCreateStateSet(); stateset-setTextureAttributeAndModes(0, texture.get()); stateset-setRenderBinDetails(1, DepthSortedBin, osg::StateSet::OVERRIDE_RENDERBIN_DETAILS); osgViewer::InteractiveImageHandler* handler = new osgViewer::InteractiveImageHandler(widgetImage.get()); quad-setCullCallback(handler); window-getGeode()-addDrawable(quad); Regards, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63994#63994 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgvolume: Swap technique in a VolumeScene fails
Thanks for your answer I have already change my original post with an attached example but this update doesnt appear in the mailing list So i repost it for the mailing list robertosfield wrote: Hi Julien, I have done a quick code review of MultipassTechnique and the computeRenderingMode() could easily be changed to check for whether the _volumeTile is set to avoid this specific crash, but I suspect the root cause of the problem is elsewhere - a technique should have a valid _volumeTile when it's in usage. As soon as you assign a technique to a VolumeTile the VolumeTile::setVolumeTechnique() method sets the technique's _volumeTile pointer to itself. I therefore suspect somehow you've created a technique but not assigned one to a tile, but also somehow got it to be actively used. You might be doing things correctly and there is a bug that is lurking, or it could be something odd that you are doing. Could you create/modify and example to illustrate this crash? Robert. On 9 June 2015 at 07:36, Julien Valentin wrote: Hi, First, excuse the lack of details of the further, i haven't been able to debug enough to understand where the bug is... So, I tried a simple scenario with the osgvolume::MultipassTechnique: I initialize the volume rendering with MultipassTechnique (as in the example) And at runtime I change it to a new osgvolume::MultipassTechnique It yields a weird crash in MultipassTechnique::computeRenderingMode() with _volumetile==NULL ...?! So far I've debugged a lot but haven't been able to locate where that happen Any info would been welcome Thank you in advance Have a good day! Cheers, Julien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63992#63992 ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63996#63996 /* OpenSceneGraph example, osgvolume. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the Software), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include osg/Node #include osg/Geometry #include osg/Notify #include osg/Texture3D #include osg/Texture1D #include osg/ImageSequence #include osg/TexGen #include osg/Geode #include osg/Billboard #include osg/PositionAttitudeTransform #include osg/ClipNode #include osg/AlphaFunc #include osg/TexGenNode #include osg/TexEnv #include osg/TexEnvCombine #include osg/Material #include osg/PrimitiveSet #include osg/Endian #include osg/BlendFunc #include osg/BlendEquation #include osg/TransferFunction #include osg/MatrixTransform #include osgDB/Registry #include osgDB/ReadFile #include osgDB/WriteFile #include osgDB/FileUtils #include osgDB/FileNameUtils #include osgGA/EventVisitor #include osgGA/TrackballManipulator #include osgGA/FlightManipulator #include osgGA/KeySwitchMatrixManipulator #include osgGA/StateSetManipulator #include osgUtil/CullVisitor #include osgViewer/Viewer #include osgViewer/ViewerEventHandlers #include osgManipulator/TabBoxDragger #include osgManipulator/TabPlaneTrackballDragger #include osgManipulator/TrackballDragger #include osg/io_utils #include algorithm #include iostream #include osg/ImageUtils #include osgVolume/Volume #include osgVolume/VolumeTile #include osgVolume/RayTracedTechnique #include osgVolume/FixedFunctionTechnique #include osgVolume/MultipassTechnique #include osgVolume/VolumeScene #include osgViewer/CompositeViewer #include osgViewer/ViewerEventHandlers #include osgGA/MultiTouchTrackballManipulator #include osgQt/GraphicsWindowQt #include QTimer #include QApplication #include QGridLayout #include iostream class SwitchVolumeTechniqueHandler : public osgGA::GUIEventHandler { public: osgVolume::VolumeTile* _tile;
Re: [osg-users] osgvolume: Swap technique in a VolumeScene fails
Hi Julien, I have done a quick code review of MultipassTechnique and the computeRenderingMode() could easily be changed to check for whether the _volumeTile is set to avoid this specific crash, but I suspect the root cause of the problem is elsewhere - a technique should have a valid _volumeTile when it's in usage. As soon as you assign a technique to a VolumeTile the VolumeTile::setVolumeTechnique() method sets the technique's _volumeTile pointer to itself. I therefore suspect somehow you've created a technique but not assigned one to a tile, but also somehow got it to be actively used. You might be doing things correctly and there is a bug that is lurking, or it could be something odd that you are doing. Could you create/modify and example to illustrate this crash? Robert. On 9 June 2015 at 07:36, Julien Valentin julienvalenti...@gmail.com wrote: Hi, First, excuse the lack of details of the further, i haven't been able to debug enough to understand where the bug is... So, I tried a simple scenario with the osgvolume::MultipassTechnique: I initialize the volume rendering with MultipassTechnique (as in the example) And at runtime I change it to a new osgvolume::MultipassTechnique It yields a weird crash in MultipassTechnique::computeRenderingMode() with _volumetile==NULL ...?! So far I've debugged a lot but haven't been able to locate where that happen Any info would been welcome Thank you in advance Have a good day! Cheers, Julien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63992#63992 ___ 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] osgvolume: Swap technique in a VolumeScene fails
Thanks for your answer I have already change my original post with an attached example but this update doesnt appear in the mailing list So i repost it for the mailing list robertosfield wrote: Hi Julien, I have done a quick code review of MultipassTechnique and the computeRenderingMode() could easily be changed to check for whether the _volumeTile is set to avoid this specific crash, but I suspect the root cause of the problem is elsewhere - a technique should have a valid _volumeTile when it's in usage. As soon as you assign a technique to a VolumeTile the VolumeTile::setVolumeTechnique() method sets the technique's _volumeTile pointer to itself. I therefore suspect somehow you've created a technique but not assigned one to a tile, but also somehow got it to be actively used. You might be doing things correctly and there is a bug that is lurking, or it could be something odd that you are doing. Could you create/modify and example to illustrate this crash? Robert. On 9 June 2015 at 07:36, Julien Valentin wrote: Hi, First, excuse the lack of details of the further, i haven't been able to debug enough to understand where the bug is... So, I tried a simple scenario with the osgvolume::MultipassTechnique: I initialize the volume rendering with MultipassTechnique (as in the example) And at runtime I change it to a new osgvolume::MultipassTechnique It yields a weird crash in MultipassTechnique::computeRenderingMode() with _volumetile==NULL ...?! So far I've debugged a lot but haven't been able to locate where that happen Any info would been welcome Thank you in advance Have a good day! Cheers, Julien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63992#63992 ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63997#63997 /* OpenSceneGraph example, osgvolume. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the Software), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include osg/Node #include osg/Geometry #include osg/Notify #include osg/Texture3D #include osg/Texture1D #include osg/ImageSequence #include osg/TexGen #include osg/Geode #include osg/Billboard #include osg/PositionAttitudeTransform #include osg/ClipNode #include osg/AlphaFunc #include osg/TexGenNode #include osg/TexEnv #include osg/TexEnvCombine #include osg/Material #include osg/PrimitiveSet #include osg/Endian #include osg/BlendFunc #include osg/BlendEquation #include osg/TransferFunction #include osg/MatrixTransform #include osgDB/Registry #include osgDB/ReadFile #include osgDB/WriteFile #include osgDB/FileUtils #include osgDB/FileNameUtils #include osgGA/EventVisitor #include osgGA/TrackballManipulator #include osgGA/FlightManipulator #include osgGA/KeySwitchMatrixManipulator #include osgGA/StateSetManipulator #include osgUtil/CullVisitor #include osgViewer/Viewer #include osgViewer/ViewerEventHandlers #include osgManipulator/TabBoxDragger #include osgManipulator/TabPlaneTrackballDragger #include osgManipulator/TrackballDragger #include osg/io_utils #include algorithm #include iostream #include osg/ImageUtils #include osgVolume/Volume #include osgVolume/VolumeTile #include osgVolume/RayTracedTechnique #include osgVolume/FixedFunctionTechnique #include osgVolume/MultipassTechnique #include osgVolume/VolumeScene #include osgViewer/CompositeViewer #include osgViewer/ViewerEventHandlers #include osgGA/MultiTouchTrackballManipulator #include osgQt/GraphicsWindowQt #include QTimer #include QApplication #include QGridLayout #include iostream class SwitchVolumeTechniqueHandler : public osgGA::GUIEventHandler { public: osgVolume::VolumeTile* _tile;
Re: [osg-users] [vpb] Correct way to get texture data from USGS or any other source?
Am 09.06.2015 um 11:35 schrieb Elias Tarasov: Hello! I try to build map using vpb in ECEF. According to manuals i've read it needs to start: vpbmaster --geocentric -t texture_file -o output_file So, clearly i need georeferenced texture file. On that page: http://www.osgvisual.org/projects/osgvisual/wiki/OsgTerrainData there is a bunch of links to get data. Since --geocentric option allows not to use elevation data, then only textures are needed. Who told you this? Of course you can use elevation data in geocentric mode ... Simply use -t for imagery and -d for digitial elevation data And here is a problem: i can't get georeferenced textures from USGS. They are referenced, but in a non-supported coordinate frame. I never had problems of this kind yet. But there are definitively geo-referenced data-sets on USGS, as I'm using them myself. Use LandSAT imagery, which is WGS84 projected, so there should no problems here. If you need some sample data I can share a small set on googledrive etc. All files i choose from different sets there are without georeferenced information. gdalinfo output: ... Yes it seems there is no valid projection. But still the data is referenced. What am i doing wrong? Without having your data, this is hard to tell Thanks a lot and best regards! Elias -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63998#63998 ___ 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] Crash in Camera::setRenderer()
Hello everyone. In my application I create several views and several cameras. Upon user interaction each camera can be added or removed from a view using View::addSlave() and View::removeSlave(). My code ensures that each camera is only assigned to only one view at a time. A camera can't be assigned to another view before being removed from the view it currently is. When I do that I often get a crash in the Camera::setRenderer() method that is called by addSlave(). The crash happen into GraphicsOperation destructor. When a camera is added to a view with addSlave() a new renderer is created for it. If the camera already has a renderer that renderer is automatically deleted by the reference counting pointer. That's when the crash happen. It looks like the renderer (or maybe one of its members) is deleted twice. I'm not using multithreading. I don't change camera assignation during rendering with callbacks. Camera assignation is all done outside of the CompositeViewer::frame() method. Do you have any idea what might be causing this crash ? Regards, Nicolas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64003#64003 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Ready to tag OpenSceneGraph-3.3.8 dev release, please test
Hi Jannik, Release build, Ubuntu 14.04 64 bit, g++ 4.8.2 In 3.2, the Update phase for this change takes 0.15ms. In svn/trunk, it's 1 ms. That's a factor 6 performance regression for the base cost of node callbacks. I have introduced Object::asNode(), asNodeVisitor(), asStateAttribute() and asUniform() to Object base class, and usage of this in Callback.cpp to replace dynamic_cast usage. With a tweaked version of your modified example and 100,000 callbacks I'm getting slightly over 3x speed up, based on frame rate. One thing to be wary of with these tests is what happens with the CPU frequency as powersaving can play havoc with accurate timing. What was the rationale for unifying all callbacks under a common base class? It enables scripting integration, where the script can provide a callback from the script itself without need for hardwiring to different types of callbacks. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Correct way to get texture data from USGS or any other source?
Hello! I totally agree with Sebastian. These data is surely geo-referenced, as I myself often used in the past data from USGS. Locking at the metadata you provided I would say that you are in an EPSG:2238 Lambert Conformal Conic projection, which is the main projection system for north Florida. You may try to specify to GDAL the source projection using this EPSG code. Regards, Christian Le 09/06/2015 12:59, Sebastian Messerschmidt a écrit : Am 09.06.2015 um 11:35 schrieb Elias Tarasov: Hello! I try to build map using vpb in ECEF. According to manuals i've read it needs to start: vpbmaster --geocentric -t texture_file -o output_file So, clearly i need georeferenced texture file. On that page: http://www.osgvisual.org/projects/osgvisual/wiki/OsgTerrainData there is a bunch of links to get data. Since --geocentric option allows not to use elevation data, then only textures are needed. Who told you this? Of course you can use elevation data in geocentric mode ... Simply use -t for imagery and -d for digitial elevation data And here is a problem: i can't get georeferenced textures from USGS. They are referenced, but in a non-supported coordinate frame. I never had problems of this kind yet. But there are definitively geo-referenced data-sets on USGS, as I'm using them myself. Use LandSAT imagery, which is WGS84 projected, so there should no problems here. If you need some sample data I can share a small set on googledrive etc. All files i choose from different sets there are without georeferenced information. gdalinfo output: ... Yes it seems there is no valid projection. But still the data is referenced. What am i doing wrong? Without having your data, this is hard to tell Thanks a lot and best regards! Elias -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63998#63998 ___ 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 -- SCHULTE Christian Ingénieur Recherche Responsable du Laboratoire de Simulation ONERA - DCSD/PSEV Département Commande des Systèmes et Dynamique du Vol ONERA - Centre de Salon de Provence BA 701 13661 SALON AIR Cedex - France Tel :04.90.17.01.45 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Ready to tag OpenSceneGraph-3.3.8 dev release, please test
Hi Robert and Rafa, I just see this change was introduced by Christian Kehl ( http://comments.gmane.org/gmane.comp.graphics.openscenegraph.cvs/12859) but probably he had a little mess in his computer when doing this change (As he also stated later ). It is possible it might be not necessary. Maybe Christian can comment something. Cheers. 2015-06-09 7:01 GMT+02:00 Rafa Gaitan rafa.gai...@gmail.com: Hi Robert, I did a couple of builds one for MacOSX 10.10 and for android gles1. For macosx everything worked so far but for android I'm getting this error using the toolchain: osg-trunk/include/osg/GLDefines:35:21: error: conflicting declaration 'typedef GLfloat GLdouble' I suspect this is the same problem others has spotted. I think you suggested to do a better identification in cmake, or maybe just check if the symbol already exists in that header. I'll try to provide a fix later today. Regards, Rafa. El lun., 8 jun. 2015 a las 20:01, Robert Osfield ( robert.osfi...@gmail.com) escribió: Hi Jannik, A quick reply as I am replying on my phone. My intention was to introduce the same technique as osg::Node::asTransform() to avoid the dynamic cast, but only do this if there was a noticeable performance regression. The 20% regression you've seen could qualify. Is this with a release build? As general note, I suspect you are over using callbacks. Robert On 8 Jun 2015 17:16, Jannik Heller scr...@baseoftrash.de wrote: Hi Robert, I tried my application using the latest trunk and didn't notice any functional regressions. However, I did notice a performance decrease in the Update phase of about 20%, compared to OSG 3.2.0. This had me a bit concerned, so I digged through the changes and found commit https://github.com/openscenegraph/osg/commit/e967420323bb6e500425144cb305cf8060c1c515 . Since that commit, we now get *four* dynamic_cast's per frame and NodeCallback, which I suspect is causing the slowdown. Two dynamic_cast's are in NodeCallback::run, then another two in NodeCallback::traverse. Changing to the non-deprecated Callback instead of NodeCallback gives a slight improvement with now just two dynamic_cast's in Callback::traverse, but still isn't optimal. Ideally, the application should be able to decide on the level of safety vs. level of performance it needs. If a Callback is only intended to be used on Nodes, there is little point in dynamic_casting to Node every frame. I think I can workaround the casts by using a custom class derived from osg::Callback as the base class for all my node callbacks. Still, it's quite a peculiar situation that does affect all users of the OSG. I guess my question comes down to, are there any plans on optimizing the Callback code before a final 3.4 release? If you aren't convinced, I can throw together a repro case and some profiling data, but I think the impact of 4 dynamic_cast's per frame and NodeCallback should be obvious. Cheers, Jannik -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63985#63985 ___ 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 -- Jordi Torres ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgvolume: Swap technique in a VolumeScene fails
Hi, First, excuse the lack of details of the further, i haven't been able to debug enough to understand where the bug is... So, I tried a simple scenario with the osgvolume::MultipassTechnique: I initialize the volume rendering with MultipassTechnique (as in the example) And at runtime I change it to a new osgvolume::MultipassTechnique It yields a weird crash in MultipassTechnique::computeRenderingMode() with _volumetile==NULL ...?! So far I've debugged a lot but haven't been able to locate where that happen Any info would been welcome Thank you in advance Have a good day! Cheers, Julien -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63992#63992 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Crash in Camera::setRenderer()
Hi Nicolas, On 9 June 2015 at 14:04, Nicolas Baillard nicolas.baill...@gmail.com wrote: I keep my cameras and views using ref_prt. They are all created when the application starts and never deleted. That probably rules out dangling pointers then. Which leaves me with no particular idea what might be wrong. As a long shot you could look at the OSG version you are using. I don't know what version you are using by OSG svn/trunk and OSG-3.3.x dev series have a range of fixes that might address problems. I'm working on a minimal piece of code to reproduce the crash. Thanks, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Ready to tag OpenSceneGraph-3.3.8 dev release, please test
Hi Robert, I've just did an svn update and the error in android is still there. If we remove the line 35 ( typedef GLfloat GLdouble; ) of GLDefines file then builds ok. And it does not affect to macosx build, and probably won't affect to other desktop environments. I think this commit ( http://trac.openscenegraph.org/projects/osg/changeset?new=14862%40OpenSceneGraph%2Ftrunk%2Finclude%2Fosg%2FGLDefinesold=14747%40OpenSceneGraph%2Ftrunk%2Finclude%2Fosg%2FGLDefines) was not correctly tested at that moment and probably should be reverted. Regards and thank you for your efforts! Rafa. El mar., 9 jun. 2015 a las 20:17, Robert Osfield (robert.osfi...@gmail.com) escribió: Hi All, I have checked a couple of bug and build fixes today, could you please do an svn update and test again ;-) 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] Ready to tag OpenSceneGraph-3.3.8 dev release, please test
Hi All, I have checked a couple of bug and build fixes today, could you please do an svn update and test again ;-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Correct way to get texture data from USGS or any other source?
Hello! Thanks for quick reply, it helped to solve a problem. SMesserschmidt wrote: Am 09.06.2015 um 11:35 schrieb Elias Tarasov: Hello! I try to build map using vpb in ECEF. According to manuals i've read it needs to start: vpbmaster --geocentric -t texture_file -o output_file So, clearly i need georeferenced texture file. On that page: http://www.osgvisual.org/projects/osgvisual/wiki/OsgTerrainData there is a bunch of links to get data. Since --geocentric option allows not to use elevation data, then only textures are needed. Who told you this? Of course you can use elevation data in geocentric mode ... Simply use -t for imagery and -d for digitial elevation data The book is called OpenSceneGraph 3 Cookbook Authors: Rui Wang Xuelei Qian Citation: To build databases in geographic coordinate, we can simply use the --geocentric option while executing vbpmaster. The complete command is: # vpbmaster -t data/TrueMarble.4km.10800x5400.tif --geocentric -o output/out.osgb Don't doubt the arguments we used this time. Yes, there is no -d option and thus no elevation map specified. As we have already indicated to use the geocentric system to build from the source, VPB will automatically use flat sea-level elevation data and construct the earth geometry according to the given GeoTiff imagery. And here is a problem: i can't get georeferenced textures from USGS. They are referenced, but in a non-supported coordinate frame. I never had problems of this kind yet. But there are definitively geo-referenced data-sets on USGS, as I'm using them myself. Yes, they are. Just in a different projection, it seems. Use LandSAT imagery, which is WGS84 projected, so there should no problems here. Actually, problems are exist. This is the LandSat image from USGS c:\Terrain\EPP191R025_7F19990915gdalinfo test_texture.tif Driver: GTiff/GeoTIFF Files: test_texture.tif Size is 17884, 16140 Coordinate System is: PROJCS[WGS 84 / UTM zone 33N, GEOGCS[WGS 84, DATUM[WGS_1984, SPHEROID[WGS 84,6378137,298.257223563, AUTHORITY[EPSG,7030]], AUTHORITY[EPSG,6326]], PRIMEM[Greenwich,0], UNIT[degree,0.0174532925199433], AUTHORITY[EPSG,4326]], PROJECTION[Transverse_Mercator], PARAMETER[latitude_of_origin,0], PARAMETER[central_meridian,15], PARAMETER[scale_factor,0.9996], PARAMETER[false_easting,50], PARAMETER[false_northing,0], UNIT[metre,1, AUTHORITY[EPSG,9001]], AUTHORITY[EPSG,32633]] Origin = (391518.750,5685165.750) Pixel Size = (14.250,-14.250) Metadata: AREA_OR_POINT=Point TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch) TIFFTAG_XRESOLUTION=72 TIFFTAG_YRESOLUTION=72 Image Structure Metadata: INTERLEAVE=PIXEL Corner Coordinates: Upper Left ( 391518.750, 5685165.750) ( 13d26'37.19E, 51d18'26.83N) Lower Left ( 391518.750, 5455170.750) ( 13d30'34.78E, 49d14'22.90N) Upper Right ( 646365.750, 5685165.750) ( 17d 5'58.23E, 51d17'56.30N) Lower Right ( 646365.750, 5455170.750) ( 17d 0'37.84E, 49d13'54.52N) Center ( 518942.250, 5570168.250) ( 15d15'57.15E, 50d17' 0.02N) Band 1 Block=17884x1 Type=Byte, ColorInterp=Red Band 2 Block=17884x1 Type=Byte, ColorInterp=Green Band 3 Block=17884x1 Type=Byte, ColorInterp=Blue Now datum is WGS84, but vpbmaster shows again Error: vpbmaster can not run without all source data being in the correct destination coordinates system, please reproject them. Maybe because PROJCS[WGS 84 / UTM zone 33N, not just WGS84? If you need some sample data I can share a small set on googledrive etc. That's very kind, Sebastian, but the problem seems to have been solved already. To use data with vpb i need to reproject them. gdalwarp -s_srs EPSG:2238 -t_srs EPSG:4326 src.tif dst.tif Now produced *.osgb image looks correctly into OSG viewer. However, it also looks quite plain. So elevation data is needed? Thanks a lot! Elias -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=63998#63998 ___ Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64019#64019 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Possible improvement for CullThreadPerCameraDrawThreadPerContext threading model
I have two comments: - the default path on my 64bit system is C:\Program Files (x86)\ .. It should be the place where 64bit programs are obviously installed, C:\Program Files\ - the license (OSG one) is sort of really bad formated On Tue, Jun 9, 2015 at 10:08 PM, Jannik Heller scr...@baseoftrash.de wrote: Hi again, I just noticed that what I need to achieve is actually quite simple: the dynamicObjectRenderingCompletedCallback needs to be called from the culling thread, rather than the drawing thread. This would ensure the next frame can commence when the culling phase has ended, rather than commencing when the last camera starts drawing. Then I read the OSG code again, and noticed that precisely the same idea *is* already in the OSG, but it's commented out. See: https://github.com/openscenegraph/osg/blob/master/src/osgViewer/Renderer.cpp#L641 I don't know why it's commented out, the svn history doesn't give any indication. I will try enabling that code and if it works, post to osg-submissions. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64015#64015 ___ 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
Re: [osg-users] Possible improvement for CullThreadPerCameraDrawThreadPerContext threading model
Hi again, I just noticed that what I need to achieve is actually quite simple: the dynamicObjectRenderingCompletedCallback needs to be called from the culling thread, rather than the drawing thread. This would ensure the next frame can commence when the culling phase has ended, rather than commencing when the last camera starts drawing. Then I read the OSG code again, and noticed that precisely the same idea *is* already in the OSG, but it's commented out. See: https://github.com/openscenegraph/osg/blob/master/src/osgViewer/Renderer.cpp#L641 I don't know why it's commented out, the svn history doesn't give any indication. I will try enabling that code and if it works, post to osg-submissions. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64015#64015 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [vpb] Correct way to get texture data from USGS or any other source?
Hello! Christian Schulte wrote: Hello! I totally agree with Sebastian. These data is surely geo-referenced, as I myself often used in the past data from USGS. Locking at the metadata you provided I would say that you are in an EPSG:2238 Lambert Conformal Conic projection, which is the main projection system for north Florida. You may try to specify to GDAL the source projection using this EPSG code. Regards, Christian Yes, it worked! However, i dont understand how did you figure out that projection is 2238. No such a number is presented into metadata. For a test, i also used EPGS:3857 and it seems to work similar. Thanks a lot! Elias. Post generated by Mail2Forum -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64020#64020 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] how to insert a QWidgetImage in a osgWidget::Window?
Hello, I don't understand what you're doing but if you want to display both Qt widgets and osg 3D in the same window, I think you should take a look at osgviewerQt example. Hope it help..:/ gambr wrote: Hi all, I would like to show a Qt widget in a 3D viewer. I would like to drag it around, scale it and interact with it. I looked at the osgQtWidgets example but didn't find exactly what I need. Since I already implemented objects that are osgWidget::Window, I thought to add the geometry got from osg::createTexturedQuadGeometry() to the osgWidget::Window geode. So I created a Texture2D object and set to the osgWidget::Window with setTextureAttributeAndModes(0, texture). I also set an InteractiveImageHandler as cull callback. The problem is that I can't see the image. For testing I set an image loaded from file to the texture object and it works fine. So what is missing in my code to see the Qt widget image? Code: osg::ref_ptrosgWidget::Window window = new osgWidget::Canvas; float x = 0.0; float y = 0.0; float width = widget-size().width(); float height = widget-size().height(); osg::ref_ptrosg::Texture2D texture = new osg::Texture2D; osg::ref_ptrosg::Geometry quad; //std::string imageFile = C:/Users/User/Desktop/test.jpg; //osg::ref_ptrosg::Image image = osgDB::readImageFile(imageFile); //texture-setImage(image.get()); osg::ref_ptrosgQt::QWidgetImage widgetImage = new osgQt::QWidgetImage(widget); texture-setImage(widgetImage.get()); quad = osg::createTexturedQuadGeometry(osg::Vec3(x, y,0.0f),//center osg::Vec3(width,0.0f,0.0f),//width osg::Vec3(0.0f,height,0.0) );//height osg::StateSet* stateset = quad-getOrCreateStateSet(); stateset-setTextureAttributeAndModes(0, texture.get()); stateset-setRenderBinDetails(1, DepthSortedBin, osg::StateSet::OVERRIDE_RENDERBIN_DETAILS); osgViewer::InteractiveImageHandler* handler = new osgViewer::InteractiveImageHandler(widgetImage.get()); quad-setCullCallback(handler); window-getGeode()-addDrawable(quad); Regards, Gianni -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64006#64006 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Crash in Camera::setRenderer()
Thank you Robert. I keep my cameras and views using ref_prt. They are all created when the application starts and never deleted. I'm working on a minimal piece of code to reproduce the crash. Nicolas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64008#64008 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Crash in Camera::setRenderer()
Hi Nicolas, Are you using C pointers or ref_ptr when keeping reference around the to the slave Camera? If you use a C* pointer then there is good chance that the reference count on the Camera is going to zero when it's removed from the View and getting deleted, then you add that dangling pointer back to the View and bang your get a crash there after. That's my best guess given I don't have any code in front of me. Robert. On 9 June 2015 at 13:00, Nicolas Baillard nicolas.baill...@gmail.com wrote: Hello everyone. In my application I create several views and several cameras. Upon user interaction each camera can be added or removed from a view using View::addSlave() and View::removeSlave(). My code ensures that each camera is only assigned to only one view at a time. A camera can't be assigned to another view before being removed from the view it currently is. When I do that I often get a crash in the Camera::setRenderer() method that is called by addSlave(). The crash happen into GraphicsOperation destructor. When a camera is added to a view with addSlave() a new renderer is created for it. If the camera already has a renderer that renderer is automatically deleted by the reference counting pointer. That's when the crash happen. It looks like the renderer (or maybe one of its members) is deleted twice. I'm not using multithreading. I don't change camera assignation during rendering with callbacks. Camera assignation is all done outside of the CompositeViewer::frame() method. Do you have any idea what might be causing this crash ? Regards, Nicolas -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=64003#64003 ___ 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] Ready to tag OpenSceneGraph-3.3.8 dev release, please test
Hi Rafa, On 9 June 2015 at 06:01, Rafa Gaitan rafa.gai...@gmail.com wrote: osg-trunk/include/osg/GLDefines:35:21: error: conflicting declaration 'typedef GLfloat GLdouble' I suspect this is the same problem others has spotted. I think you suggested to do a better identification in cmake, or maybe just check if the symbol already exists in that header. I'll try to provide a fix later today. To keep things simple I will try out using a namespace osg around the typedef's in GLDfines. I have just checked this into svn/trunk. Could you try it out and see if that removes the conflict? Thanks, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org