Re: [osg-users] osgconv
Hi Ekaterina, how is your OSG_NOTIFY_LEVEL set? Notify levels FATAL and WARN suppress even the help output, witch might explain the lack of response you see. try (for windows) set OSG_NOTIFY_LEVEL=NOTICE osgconv -h or for unix bash shell this should be export OSG_NOTIFY_LEVEL=NOTICE for csh shell family setenv OSG_NOTIFY_LEVEL NOTICE Regards, Laurens. On 2/24/2014 2:51 PM, Ekaterina wrote: Hi osgusers! i am trying to convert files using osgconv, but it seems that osgconv doesn´t wotk properly. When I open cmd window, type oscconv --help, according to documentation, I should see explonation about osgconv. But I get nothing...press enter and then nothing happens. Does anybody have an idea what it can be? Thank you! Cheers, Ekaterina -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=58279#58279 ___ 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] Problem with animation in .osgb files
Hi Maxim I tried your code, and it plays an animation from an .osgb file for me. Regards, Laurens. On 9/30/2013 2:18 AM, Maxim Voloshin wrote: Hi, everyone I am new in OSG and have a problem. I wrote the code that plays animation in .fbx models, but I can't play animation in .osgb(.osgt, .ive) models. Please see the attached file and help me. P.S. Sorry for the clumsy English( Thank you! Cheers, Maxim Voloshin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=56536#56536 ___ 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] Problem showing a dashed line in the scene.
Hi Adri, I think you want osg::StateAttribute::ON | osg::StateAttribute::OVERRIDE in your call to setAttributeAndModes, using only OVERRIDE means OVERRIDE | OFF. Hope that helps, I would expect your code to show the solid line. Regards, Laurens. On 10/30/2013 5:17 PM, Adri CS wrote: Hi! I'm trying to add a dashed line between two points (for now, they're hardcoded. They exist in the point cloud that is already in the scene). With this code I expected two blue points of size 10 in the same place of those in the point cloud and a dashed line between them, yet nothing is shown. Do you know what the problem may be? Here's the last piece of code I tried: osg::ref_ptrosg::Vec3Arraydash_points=newosg::Vec3Array; osg::ref_ptrosg::Vec4Array dash_color = new osg::Vec4Array; osg::ref_ptrosg::Geometry dash_geometry( new osg::Geometry); dash_color-push_back(osg::Vec4f(0.0,0.0,1.0,1.0)); const osg::Vec3f P1(525501.015,4668653.861,457.197); const osg::Vec3f P2(525510.287,4668630.738,457.034); dash_points-push_back(P1); dash_points-push_back(P2); qDebug()DASH; qDebug()\tP1:P1[0]P1[1]P1[2]; qDebug()\tDASH_POINTS[0]:(*dash_points)[0][0](*dash_points)[0][1] (*dash_points)[0][2]; qDebug()\tP2:P2[0]P2[1]P2[2]; qDebug()\tDASH_POINTS[1]:(*dash_points)[1][0](*dash_points)[1][1] (*dash_points)[1][2]; dash_geometry-setVertexArray(dash_points.get()); dash_geometry-setColorBinding(osg::Geometry::BIND_OVERALL); // The1,0xf0f0parameters were taken from one of the examples... osg::ref_ptrosg::LineStipple linestipple( new osg::LineStipple(1,0xf0f0) ); dash_geometry-getOrCreateStateSet()-setAttributeAndModes(linestipple.get(), osg::StateAttribute::OVERRIDE ); dash_geometry-addPrimitiveSet( new osg::DrawArrays(GL_LINES,0,dash_points-size()) ); dash_geometry-getOrCreateStateSet()-setAttributeAndModes( new osg::Point(10.0f) ); dash_geometry-addPrimitiveSet(new osg::DrawArrays(GL_POINTS, 0, dash_points-size())); dash_geometry-setColorArray(dash_color.get()); shape-addDrawable( dash_geometry ); shape-addDrawable(text); Thanks and best regards! PS: I can show a complete line between the points. I thought that the code would be similar, just adding the LineStipple part. ___ 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] using stereo with osgview had a problem
Hi cloudending, Quad buffered stereo requires a nvidia quadro or ati firepro videocard, with OpenGL stereo enabled in the driver. If you have a capable videocard you will need to enable this option in the driver. Regards, Laurens. On 8/23/2013 4:45 PM, Liao Jinyi wrote: Hi, I an new to OSG。And I am tring to use the below command line Code: osgviewer -stereo QUAD_BUFFER cow.osg but it has errors such as GraphicsWindow32::setPixelFormat() -- No matching pixel found based on traits specified. I dont know how to fix it. please help me! Thank you! Cheers, cloudending -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=55977#55977 ___ 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] Create Texture coodinates for modified geometry
Hi Daniel, the following piece of code calculates the textureCoordinates for a (user picked)point in 3d space, so this might be useful for what you are trying to do. Laurens. if (transparentImage) { const osg::Geometry* geometry = hit.drawable-asGeometry(); if (geometry) { const osg::Vec3Array* vertices = dynamic_castconst osg::Vec3Array*(geometry-getVertexArray()); const osg::Vec2Array* texCoords = dynamic_castconst osg::Vec2Array*(geometry-getTexCoordArray(multiTexIndex)); if (vertices texCoords) { const osg::Vec3* firstVertex = (vertices-front()); const osg::Vec2* firstTc = (texCoords-front()); const osgUtil::LineSegmentIntersector::Intersection::IndexList vIndexList = hit.indexList; if (vIndexList.size()) {//not present on indexed vertices const osg::Vec3 hp = hit.getLocalIntersectPoint(); const osg::Vec3* v0 = firstVertex + vIndexList[0]; const osg::Vec3* v1 = firstVertex + vIndexList[1]; const osg::Vec3* v2 = firstVertex + vIndexList[2]; osg::Vec3 hitL = hp - *v0; osg::Vec3 aL = *v1 - *v0; osg::Vec3 bL = *v2 - *v0; float dot00 = aL * aL; float dot01 = aL * bL; float dot02 = aL * hitL; float dot11 = bL * bL; float dot12 = bL * hitL; float invDenom = 1 / (dot00 * dot11 - dot01 * dot01); float weightA = (dot11 * dot02 - dot01 * dot12) * invDenom; float weightB = (dot00 * dot12 - dot01 * dot02) * invDenom; const osg::Vec2* tc0 = firstTc + vIndexList[0]; const osg::Vec2* tc1 = firstTc + vIndexList[1]; const osg::Vec2* tc2 = firstTc + vIndexList[2]; osg::Vec2 tc(*tc0); tc += (*tc1 - *tc0) * weightA; tc += (*tc2 - *tc0) * weightB; // look at the border clamp mode switch(transparentTexture-getWrap(osg::Texture::WRAP_S)){ case(osg::Texture::CLAMP): if(tc[0] 0.0) tc[0] = 0.0; if(tc[0] 1.0) tc[0] = 1.0; break; case(osg::Texture::CLAMP_TO_EDGE): { double minS = 0.5/(double)transparentImage-s(); if(tc[0] minS) tc[0] = minS; if(tc[0] 1.0 - minS) tc[0] = 1.0 - minS; } break; case(osg::Texture::CLAMP_TO_BORDER): { double minS = 0.5/(double)transparentImage-s(); if(tc[0] minS || tc[0] 1.0 - minS){ float imgAlpha = transparentTexture-getBorderColor().a(); if (imgAlpha aMinVal) { transparentHit = true; return true; } } } break; case(osg::Texture::REPEAT): tc[0] = tc[0] - floorf(tc[0]); if(tc[0] 0.0) tc[0] = 1.0 - tc[0]; break; case(osg::Texture::MIRROR): if(osg::absolute((int)tc[0])%(int)2 == 0){ tc[0] = tc[0] - floorf(tc[0]); if(tc[0] 0.0) tc[0] = 1.0 - tc[0]; } else { tc[0] = tc[0] - floorf(tc[0]); if(tc[0] 0.0) tc[0] = tc[0]; else tc[0] = 1.0 - tc[0]; } break; } switch(transparentTexture-getWrap(osg::Texture::WRAP_T)){ case(osg::Texture::CLAMP): if(tc[1] 0.0) tc[1] = 0.0; if(tc[1] 1.0) tc[1] = 1.0; break;
Re: [osg-users] [osgPlugins] FBX animations corrupted when using osg 3.2.0 with newer fbx plugin
Hi Björn, simple things first, did you try with SET OSG_OPTIMIZER=OFF Regards, Laurens. On 8/15/2013 10:14 AM, Björn Blissing wrote: To clarify the problem further. Loading and playing single FBX files seems to work fine. My problems begins when I try to copy animations from several FBX files into one model. I am merging animations from several diffrent files (mainly because Autodesk 3D Studio cannot export FBX files with multiple animations). I start by loading the first model, locating the AnimationManager, then opening the rest of the models. For each model I am locating their AnimationManager and getting the animation stored inside it, then coping and registering the animation into the first file's AnimationManager. A similar example can be found in this thread: http://forum.openscenegraph.org/viewtopic.php?t=12022 This strategy worked well with OSG 3.0.1, but for some reason (I haven't figured out why yet) it refuses to work with the new version. The connection between the bones and the animations seems to get a complete mismatch, which results in warped and twisted geometry. The bone responsible for the characters arm gets connected to the geometry of a foot and some of my animated characters literally ends up with their head up their own arse. The hip bones connected to the neck bone, The back bones connected to the foot bone ;) Björn -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=55852#55852 ___ 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] Question regarding collada
Hi Chris, Torben, I have set up a svn repostory with the stuff I use to build with vs2012 x64 http://vcs.service.rug.nl/svn/osg-dep/ (currently ~1MB) It could still use polishing, but I will not find the time to do so soon, but suggestions are welcome. I think next on my list are: -x86 build with V110_xp toolkit -debug version suitable for distribution - no symbols, just compiled with /MDd Just hoping this is useful in it's current state. regarding collada, I tried DOM 2.4.0 and needed a lot of changes to the osg plugin, DOM2.3.1 compiles just fine and passed a few short tests. With DOM 2.4.0 I had collada 1.5.0 compiled, then the osg plugin ONLY reads and writes 1.5.0 files. Disabling 1.5.0 in the collada build made it read and write 1.4.1 files again. with dom 2.3.1 I just disabled 1.5.0 and that seemed to work just fine. Regards, Laurens. quick (and possibly incomplete) dependencies: -need to have 7za, wget and sed in PATH -need perl in c:\Perl64\bin -need NASM in C:\Program Files (x86)\nasm -need VC2012 in C:\Program Files (x86)\Microsoft Visual Studio 11.0\ sources.bat will download sources (111 MB) and expand /patch (631 MB / 773 MB on disk) make.bat builds both debug and release (2.75 GB / 2.79 GB on disk) (in about 20 min on my machine: i7-3770 @3.4GHz 4 core/8threats) repo currently consists of: boost_1_53_0 bzip2-1.0.6 curl-7.29.0 expat-2.1.0 fftss-3.0-20071031 freetype-2.4.11 gdal-1.9.2 gettext-0.18.2 giflib-5.0.4 glut-3.7.6 jpegsrc.v9 libiconv-1.14 libpng-1.5.14 libxml2-2.9.0 nvidia-texture-tools-2.0.8-1 openssl-1.0.1e pcre-8.32 proj-4.8.0 tiff-4.0.3 zlib-1.2.8 On 7/17/2013 6:24 PM, Chris Hanson wrote: Good luck with that. We have been unsuccessful at doing it so far and sort of side-tracked it. You and I should collaborate on the build process. My build system has been sidelined while we struggled to virtualize all of the build slaves onto one box, since it's silly to have them all as discrete computers when they never run simultaneously anyway. We are getting close to having them all spinning full power now though. On Wed, Jul 17, 2013 at 2:58 AM, Torben Dannhauer tor...@dannhauer.info mailto:tor...@dannhauer.info wrote: Hi, For the full package of my VS2012 precompiled 3rdParty package, I want to integrate collada. Unfortunately I'm not aware of the current Colada status of OSG. Can I use collada 2.4.0? Which DOM should I use? 1.4 ? 1.5? Thank you for your help! Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=55234#55234 ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto: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 http://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] Display Order with OpenGL ES 2.0 on Android
Hi Bruno, you probably want the behind quad to have a different depth (second value in the osg::Vec3), so it will appear to be behind the other quad. The order in the graph or the order of adding to the graph has no impact on the result at all. Regards, Laurens. On 6/26/2013 11:41 AM, Bruno Ronzani wrote: Hi, I'm facing a little problem with OSG on Android : I use an ortho2D camera to display simple quads, but they are displayed in the wrong order. Simple example : I try to display a green square in front of a green square, so I add the red square first in my graph, and then my green square. On my PC, with OSG built with openGl es 2 compatibility it works, but on my android phone, the red square is displayed in front of the green square. Any idea ? Here is a sample code. static const char vertSource[] = attribute vec4 osg_Vertex; \n attribute vec4 osg_Color; \n attribute vec4 osg_MultiTexCoord0; \n uniform mat4 osg_ModelViewProjectionMatrix; \n varying vec4 v_col; \n \n void main(void) \n { \n gl_Position = osg_ModelViewProjectionMatrix * osg_Vertex; \n v_col = osg_Color; \n } \n \n; static const char fragSource[] = precision mediump float; \n varying vec4 v_col; \n void main(void) \n { \n gl_FragColor = v_col; \n gl_FragColor.a = 0.5; \n } \n \n; osg::Geode* createQuad(const osg::Vec2 size, const osg::Vec4 color) { osg::Geode *geode = new osg::Geode(); osg::Geometry *geometry = new osg::Geometry(); osg::Vec3Array* vertices = new osg::Vec3Array; vertices-push_back(osg::Vec3(0, 0, 0)); vertices-push_back(osg::Vec3(0, 0, size.y())); vertices-push_back(osg::Vec3(size.x(), 0, size.y())); vertices-push_back(osg::Vec3(size.x(), 0, 0)); geometry-setVertexArray(vertices); osg::Vec4Array* colors = new osg::Vec4Array; colors-push_back(color); geometry-setColorArray(colors); geometry-setColorBinding(osg::Geometry::BIND_OVERALL); geometry-addPrimitiveSet(new osg::DrawArrays(osg::PrimitiveSet::QUADS,0,vertices-size())); osg::Program* program = new osg::Program(); osg::Shader* frag = new osg::Shader(osg::Shader::FRAGMENT, fragSource); osg::Shader* vert = new osg::Shader(osg::Shader::VERTEX, vertSource); program-addShader(vert); program-addShader(frag); geode-getOrCreateStateSet()-setAttribute(program); geode-addDrawable(geometry); return geode; } int main() { osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer(); viewer-setThreadingModel(osgViewer::ViewerBase::SingleThreaded); viewer-setCameraManipulator(new osgGA::TrackballManipulator()); #ifdef ANDROID viewer-setUpViewerAsEmbeddedInWindow(0,0, 800, 600); viewer-realize(); #else viewer-setUpViewInWindow(40,40,800, 600); #endif viewer-getCamera()-getOrCreateStateSet()-setMode(GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::OVERRIDE | osg::StateAttribute::PROTECTED);
Re: [osg-users] Please test svn/trunk in prep for 3.1.8 dev release
Hi Robert, we noticed over here that something goes wrong if the viewer is started with OSG_STEREO=ON, both with anaglyph stereo on windows and with Quad buffered stereo on linux. We don't have a fix yet, and probably won't get around to digging out the actual problem this week, so for now only a bug report. steering with the mouse is impossible, which I traced back to osgGA::GUIEventAdapter::getXnormalized() (and Y) returning values way larger than 1. (about 1024 or so) we suspect this is caused in some way by assignStereoOrKeystoneToCamera not calling assignKeystoneDistortionCamera at all if redering is stereo and no keystone file is set. Regards, Laurens. On 6/20/2013 12:55 PM, Robert Osfield wrote: Hi All, I'm now ready to make the 3.1.8 dev release, but will wait a couple more hours for build and runtime testing feedback, so please test and report success/failure. Cheers, 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] Pre-built dependencies for Visual Studio 2012
Hi Jan, I have a reasonable package compiled with visual studio express 2012, currently I have 64 bit versions only, a x86 version for winXP is still on my todo list. also still todo is to clean up my the modifications to the sources. the include and relase lib files take 21.7 MB in .7z format, the debug lib files 34.5 MB. The url's below are time limited, I am still looking for a more permanent way to distribute files. Regards, Laurens. |download url :http://bars.rug.nl/download/11d4c8670473bb45| avalable until: 2013-06-28 debug libs: url:http://bars.rug.nl/download/27d449612e669533 filename : vc11_debug.7z size: 34.5MB avalable until: 2013-06-28 00_bzip2 01_zlib 02_openssl 03_expat 04_png 05_jpeg 06_freetype 07_curl 08_pcre 09_glut 10_tiff 11_gif 12_gettext 12_iconv 13_gdal 14_libxml2 15_boost 16_collada_dom 17_proj 18_FFTSS 19_nvidia-texture-tools On 6/13/2013 8:53 PM, Jan Ciger wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/13/2013 08:19 PM, Chris Hanson wrote: We're working on this ourselves, but we were hampered because our Windows build system was an old Vista box and VS2012 doesn't work on Vista, so we had to roll a new build system... I have managed to build the basic stuff like libpng, zlib, libjpeg and freetype, but it would help to have some of the other libs too. Jan -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iD8DBQFRuhUxn11XseNj94gRAiqbAKC3I2PWXdDBhbM8x9mRfp1FwgAdzwCg3z4f 8grzZl9ysH/bjF/Ct8LdqrY= =FJTK -END PGP SIGNATURE- ___ 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] Warning messages VS2012...
On 5/31/2013 10:40 AM, Sebastian Messerschmidt wrote: Hi Robert, Hi Pjotr, On 31 May 2013 08:09, Pjotr Svetachov pjotrsvetac...@gmail.com wrote: This is actually an issue with the visual studio 2012 library, see here for an explanation: http://connect.microsoft.com/VisualStudio/feedback/details/733720/ Thanks for the link, explains the tangled mess of hacks that got MS into a situation where valid code produces irrelevant warnings... umm sounds like they've been making some great engineering decisions! So.. for us we either stop inheriting from fstream etc. or we disable the warning locally using a #pragma. We already have a series of #pragma for windows in include/osg/Export. We could easily add 4250 to the list of disabled warnings. I'd rather keep disabling warnings to the minimum, perhaps a local #pragma that is just set for the include/osgDB/fstream header. Can we push/pop #pragma's under Windows? Robert. Yes you can. But this might not help in all cases. At least we can try: #ifdef _MSC_VER #pragma warning( push) #pragma warning( disable : 4250) #pragma warning( pop ) #endif Also please note, that there are non-suppressible warnings in VS. cheers Sebastian Hi all, I gave that a try, but that did not remove all of the C4250 warnings, although I think the number of warnings was reduced. so I submitted a modified CMakelist.txt disabling the warning on the top level. Regards, Laurens. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] problem with include/osgViewer/config for windows users (svn commit 13403)
Hi Robert, with svn commit a problem for windows users emerged, the file include/osgViewer/Config prohibits the creation of the directory include/osgViewer/config/ on non case sensitive filesystems. (Turtoise)svn update fails with a permissions error. I would suggest renaming the directory (to winconfig or screenconfig perhaps?). Regards, Laurens Voerman. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with include/osgViewer/config for windows users (svn commit 13403)
Hi Robert, no strong opinions on my side, I did not even fully read the new config options and classes yet. Also I don't know how TurtoiseSvn or other windows svn clients handle the update command, so I cannot predict if adding these changes will allow other windows users to pass the update from below 13403 to the commited version with no conflicting file/directory mix. Regards, Laurens On 5/16/2013 10:47 AM, Robert Osfield wrote: Hi Laurens, On 16 May 2013 09:20, Laurens Voerman l.voer...@rug.nl mailto:l.voer...@rug.nl wrote: Hi Robert, with svn commit a problem for windows users emerged, the file include/osgViewer/Config prohibits the creation of the directory include/osgViewer/config/ on non case sensitive filesystems. (Turtoise)svn update fails with a permissions error. I would suggest renaming the directory (to winconfig or screenconfig perhaps?). Oh dear, sorry about this. Next considered that there might be an easy with a case. I've been thinking about moving the Config base class as a nested class within osgViewer::View, so this would remove the header so would resolve the issue. I've also been wondering if the directory name should be include/osgViewer/configurations/ Thoughts? 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] Crashes after unloading library
Hi Gabriel, First a question: what operating system are you using? Second question: when your shared library gets unloaded, do any other shared library's get unloaded as well? On windows I can imagines your dll being linked to an osg part that will install callbacks in the scengraph, (osgAnimation.dll as a possible example), while your main application has no such link. On unloading the dependencies can be unloaded as well, causing the callback to call an invalid memory location. Regards, Laurens. On 5/16/2013 11:09 AM, Gabriel Francu wrote: Hi, I have an application built with Qt that uses osg to create a scene and to display it. I have also created a shared library that is loaded and unloaded by my application using QLibrary. In this library I create osg objects that are retained in objects created in the application. If I do not unload the library, all is ok but after I unload the library, strange crashes occurs in osg. I suspect that these are related to memory allocation because osg objects are created on the heap in the shared library and then the shared library in unloaded. Any suggestions? ... Thank you! Cheers, Gabriel -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=54028#54028 ___ 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] problem with include/osgViewer/config for windows users (svn commit 13403)
Hi Robert, Svn update successful, (after deleting config directory by hand and TurtoiseSvn clean up ) Cmake configure seemed to work fine, now compiling. osg97-osgViewer.dll compiled just fine. Regards, laurens. On 5/16/2013 12:12 PM, Robert Osfield wrote: Hi All, I have now checked in the change of osgViewer::Config to ViewConfig, placing the class declaration into include/osgViewer/View, and deleting the Config header. Let me know if there are any build problems so I can address this right away. Cheers, 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] wglGetCurrentContext vs osg::GraphicsContext::createGraphicsContext
Hi Anders, did you try: m_viewer-setReleaseContextAtEndOfFrameHint(false); before the call to m_viewer-frame(); Hope that helps, Laurens. On 3/11/2013 11:33 AM, Anders Backman wrote: No one with insight on this? /Anders On Fri, Mar 8, 2013 at 11:27 AM, Anders Backman ande...@cs.umu.se mailto:ande...@cs.umu.se wrote: Hi all. I have a small problem where I use osg::GraphicsContext::createGraphicsContext to create a context for a window-widget (in .NET), but I also use another piece of software that use wglGetCurrentContext to check for context. But wglGetCurrentContext() returns null for the context that OSG creates. My init method: bool GraphicsWindow::initOSG( HWND hwnd) { if (m_viewer.valid()) return true; m_viewer = new osgViewer::Viewer(); m_viewer-setThreadingModel( osgViewer::ViewerBase::SingleThreaded ); m_root = new osg::Group; m_viewer-setSceneData( m_root.get() ); m_traits = new osg::GraphicsContext::Traits(); m_traits-inheritedWindowData = new osgViewer::GraphicsWindowWin32::WindowData( hwnd ); m_traits-setInheritedWindowPixelFormat = true; m_traits-doubleBuffer = true; m_traits-windowDecoration = true; m_traits-sharedContext = NULL; m_traits-supportsResize = true; RECT rect; ::GetWindowRect( hwnd, rect ); m_traits-x = 0; m_traits-y = 0; m_traits-width = rect.right - rect.left; m_traits-height = rect.bottom - rect.top; m_graphicsContext = osg::GraphicsContext::createGraphicsContext( m_traits.get() ); m_viewer-getCamera()-setGraphicsContext( m_graphicsContext.get() ); m_viewer-getCamera()-setViewport( new osg::Viewport( 0, 0, m_traits-width, m_traits-height ) ); m_viewer-getCamera()-setProjectionMatrixAsPerspective(30.0f, static_castdouble(m_traits-width)/static_castdouble(m_traits-height), 1.0f, 1.0f); m_viewer-realize(); m_viewer-frame(); assert(wglGetCurrentContext()); // Fails I have tried m_graphicsContext-makeCurrent(); wglGetCurrentContext STILL returns null... I know that I'm missing something, question is what? /Anders -- __ Anders Backman, HPC2N 90187 Umeå University, Sweden and...@cs.umu.se mailto:and...@cs.umu.se http://www.hpc2n.umu.se Cell: +46-70-392 64 67 tel:%2B46-70-392%2064%2067 -- __ Anders Backman, HPC2N 90187 Umeå University, Sweden and...@cs.umu.se mailto:and...@cs.umu.se http://www.hpc2n.umu.se Cell: +46-70-392 64 67 ___ 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] osgviewer - OS X
Hi Craig, my windows machine continues the output with FindFileInPath() : trying E:\osg\OpenSceneGraph-Data\cow.osg ... FindFileInPath() : USING E:\osg\OpenSceneGraph-Data\cow.osg itr='E:\osg\osgStable\vc91x64\bin' FindFileInPath() : trying E:\osg\osgStable\vc91x64\bin\osgPlugins-3.0.1\osgdb_deprecated_osg.dll ... FindFileInPath() : USING E:\osg\osgStable\vc91x64\bin\osgPlugins-3.0.1\osgdb_deprecated_osg.dll seem like your machine gets stuck while loading or executing osgdb_osg.so. maybe you could try osgviewer cow.osgt ? Laurens. On 1/30/2013 1:52 AM, Craig Miller wrote: I'm looking for some help on getting osgviewer working under OS X. Specifically, osgviewer doesn't open a window and display the specified osg (cow.osg). I've read through the FAQ on this question and have set DYNLD_BIND_AT_LAUNCH environment variable. I've also set OSG_NOTIFY_LEVEL=INFO and now OSG_NOTIFY_LEVEL=DEBUG but don't see anything obvious (output below). It looks like it is loading the .osg file, but then just hangs w/o an error. I installed OSG via MacPorts. Debug output indicates that it's finding the libraries and plugins. I'm brand new to OSG. Any suggestions you might have on where to go next in the debugging process would be very helpful and welcome. Regards, Craig - Here's my environment: $ env M_PROGRAM=Apple_Terminal TERM=xterm-256color SHELL=/bin/bash CLICOLOR=1 OSG_NOTIFY_LEVEL=DEBUG TMPDIR=/var/folders/v9/bl613v9x5zl88dz2903f12g8gn/T/ Apple_PubSub_Socket_Render=/tmp/launch-gQxK5Z/Render TERM_PROGRAM_VERSION=309 OLDPWD=/Users/craig TERM_SESSION_ID=EF6EC728-4691-44D5-8B23-4CA05679414F USER=craig DYLD_BIND_AT_LAUNCH=1 COMMAND_MODE=unix2003 SSH_AUTH_SOCK=/tmp/launch-HgX6z2/Listeners __CF_USER_TEXT_ENCODING=0x1F5:0:0 Apple_Ubiquity_Message=/tmp/launch-kdkoC6/Apple_Ubiquity_Message LSCOLORS=gxBxhxDxfxhxhxhxhxcxcx PATH=/Users/craig/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin PWD=/Users/craig/OpenSceneGraph-Data JAVA_HOME=/Library/java/home LANG=en_US.UTF-8 PS1=\e[0;34m\h \W \e[0m SHLVL=1 HOME=/Users/craig LOGNAME=craig SECURITYSESSIONID=186a5 _=/usr/bin/env Here's the output of the osgviewer command: $ osgviewer --display MONITOR cow.osg CullSettings::readEnvironmentalVariables() DatabasePager::addDatabaseThread() HANDLE_NON_HTTP DatabasePager::addDatabaseThread() HANDLE_ONLY_HTTP Render::Render() 0x7fa8eab13ca0 CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() ShaderComposer::ShaderComposer() 0x7fa8eab15000 CullSettings::readEnvironmentalVariables() ShaderComposer::ShaderComposer() 0x7fa8eab16eb0 _availableQueue.size()=2 DriveManipulator::_height set to ==1.5 getCoordinateFrame(0 -1 0) no coordinate system found, using default orientation View::requestWarpPointer(0,0) View::requestWarpPointer failed no camera containing pointer View::requestWarpPointer(0,0) View::requestWarpPointer failed no camera containing pointer getCoordinateFrame(0 0 0) no coordinate system found, using default orientation getCoordinateFrame(0 -1 0) no coordinate system found, using default orientation CullSettings::readEnvironmentalVariables() Render::Render() 0x7fa8eab1cc70 CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() ShaderComposer::ShaderComposer() 0x7fa8eab1e120 ShaderComposer::ShaderComposer() 0x7fa8eab1fb00 _availableQueue.size()=2 CullSettings::readEnvironmentalVariables() Render::Render() 0x7fa8eab221b0 CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() CullSettings::readEnvironmentalVariables() ShaderComposer::ShaderComposer() 0x7fa8eab23640 ShaderComposer::ShaderComposer() 0x7fa8eab25020 _availableQueue.size()=2 itr='/opt/local/lib/osgPlugins-3.0.1' FindFileInPath() : trying /opt/local/lib/osgPlugins-3.0.1/osgPlugins-3.0.1/osgdb_osg.so ... itr='/Users/craig/Library/Application Support/OpenSceneGraph/PlugIns' FindFileInPath() : trying /Users/craig/Library/Application Support/OpenSceneGraph/PlugIns/osgPlugins-3.0.1/osgdb_osg.so ... itr='/Library/Application Support/OpenSceneGraph/PlugIns' FindFileInPath() : trying /Library/Application Support/OpenSceneGraph/PlugIns/osgPlugins-3.0.1/osgdb_osg.so ... itr='/opt/local/lib/osgPlugins-3.0.1' FindFileInPath() : trying /opt/local/lib/osgPlugins-3.0.1/osgdb_osg.so ... FindFileInPath() : USING /opt/local/lib/osgPlugins-3.0.1/osgdb_osg.so Opened DynamicLibrary osgPlugins-3.0.1/osgdb_osg.so FindFileInPath(cow.osg): returning cow.osg Craig Miller http://spatialminds.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___
Re: [osg-users] Linker error in VS2012 in win 8 64 bit machine
Hi Selvakumar, delete the file G:\Split5\Debug\Split.pdb and rebuild. I added in my CMakeLists.txt /wd4250 to disable the warning you see, (line ~762) Laurens. SET(OSG_AGGRESSIVE_WARNING_FLAGS /W4 /wd4706 /wd4127 /wd4100 /wd4250) On 1/19/2013 12:04 PM, Selvakumar Chellamuthu wrote: Hi, I getting the following linker error in VS2012 in win 8 64 bit os machine. I want to set up project and start coding. g:\openscenegraph-3.0.1-vs100\include\osgdb\fstream(41): warning C4250: 'osgDB::fstream' : inherits 'std::basic_istream_Elem,_Traits::std::basic_istream_Elem,_Traits::_Add_vtordisp1' via dominance 1 with 1 [ 1 _Elem=char, 1 _Traits=std::char_traitschar 1 ] 1 c:\program files (x86)\microsoft visual studio 11.0\vc\include\istream(74) : see declaration of 'std::basic_istream_Elem,_Traits::_Add_vtordisp1' 1 with 1 [ 1 _Elem=char, 1 _Traits=std::char_traitschar 1 ] 1ChildFrm.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification 1LINK : fatal error LNK1207: incompatible PDB format in 'G:\Split5\Debug\Split.pdb'; delete and rebuild Can somebody help me to over come this linker error? Thank you! Cheers, Selvakumar :( :( -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52030#52030 ___ 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] Most efficient way to get a single pixel RGBA from an FBO texture
Hi Ethan, Maybe you could just keep it all on the gpu, and create the text for the hud in a shader like drawtext GLSL shader http://mew.cx/drawtext/drawtext.html Laurens. On 1/23/2013 3:24 PM, Ethan Fahy wrote: I should note that my needs are very similar to the ones described in this post: http://forum.openscenegraph.org/viewtopic.php?t=5941highlight=glreadpixels I adapted the sample code given at the end of that thread and found that while I was able to retrieve the correct pixel values, I also was getting the: warning: detected OpenGL error 'invalid operation' at after RenderBin::draw() warning after every frame, regardless of whether my rtt camera was set to post render or pre render. Unfortunately that thread ended 2.5 years ago without a full resolution to the outstanding questions. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52096#52096 ___ 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] Lock the aspect ratio while allowing the window to be resized
Hi Ethan, I think this should do the trick: camera-setProjectionResizePolicy(osg::Camera::FIXED); Laurens. On 1/21/2013 4:14 PM, Ethan Fahy wrote: Hello, Is there any way to set up an osgViewer::Viewer with a locked aspect ratio that still allows the user to adjust the window size by dragging the bottom-right corner of the view window? Thanks, -Ethan -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52054#52054 ___ 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] Lock the aspect ratio while allowing the window to be resized
Hi Ethan, I did not understand your question correctly. Setting the camera to camera-setProjectionResizePolicy(osg::Camera::FIXED) will fix the projection, not the window. As the version you want is not implemented in osg, you will need to catch resize attempts and force the window to resize while preserving the aspect ratio. the osgviewer application has a viewer.addEventHandler(new osgViewer::WindowSizeHandler); You probably should replace that with a new handler, allowing only to resize with fixed aspect ratio. Laurens. On 1/22/2013 2:10 PM, Ethan Fahy wrote: Hi Laurens, I tried setting the resize policy as you suggested for the osgViewer::Viewer default camera as well as the rtt camera and hud camera that are in my project, but I was still able to freely resize my viewer window without it locking. I didn't get any errors, it just didn't lock the window size. Perhaps there is a difference between projection size and window size. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52066#52066 ___ 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] Export 3ds max to *.osg or *.dae.
Hi Peterakos, I have made some successful conversions with Bones and skinning by exporting to .fbx format. Laurens. On 11/21/2012 8:57 PM, Peterakos wrote: Edit second sentence: Now i try to use it in OSG. ___ 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] statically linking osgPlugins for Android
Hi James, in c++ code add the macro: #include osgDB/Registry USE_OSGPLUGIN(3ds) link with osgdb_3ds.lib this is also used in the static linked viewer example: OpenSceneGraph\examples\osgstaticviewer Regards, Laurens. On 8/23/2012 12:51 AM, James Cotton wrote: I managed to get OSG compiled without issue for Android and incorporate it into my application. However, the models I would like to use are .3DS and I'm trying to get the 3ds plugin used. It was disabled in the build process, but was reenable without much issue. However, I don't know how to tie it into my application. Currently the Android toolchain builds OSG statically but when I enable debugging messages the code is still looking for .so plugins. This is also an issue for the texture files (osgdb_imageio.so). So I have two questions for possible solutions: 1) is there a way to make things that currently use plugins use statically linked code? Like an alternative registration to permanently register those plugins at init and make sure the code gets linked in? 2) if not, can anyone suggest how to make the plugins build as a .so and the core code to build as a static library (for Android). Or any other approaches you guys can suggest. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49415#49415 ___ 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] osgb exports from unices not importable on win32 / osgt works fine
Hi Jan, your ogsb file seems to have been converted to windows newline style: every 0x0A byte has been replaced by 0x0D0A Is something converting your files while you copy? Laurens. On 4/30/2012 6:28 PM, Jan Ciger wrote: On Mon, Apr 30, 2012 at 6:08 PM, Robert Osfield robert.osfi...@gmail.com mailto:robert.osfi...@gmail.com wrote: Hi Stegan, This sounds very much like a bug, it'll be a new one as the new .osgb format and serializers are new to the OSG. Unfortunately the original author, Wang Rui, of the serializers hasn't yet chipped in to this thread, he is probably best placed to help solve this. Hopefully he'll see my reply and chip in. Actually I see similar issues on Windows too. Models that export ok to .osg format are exported incorrectly into .osgx or .osgb. Regards, Jan ___ 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] osgAnimation: Jump to animation
Hi Martin, It's not very pritty, but from reading the code I think this will work: animationManager-playAnimation( myAnimation ); myAnimation-setStartTime(myAnimation-getStartTime() -3.0); Regards, Laurens. On 3/6/2012 12:21 PM, Martin Haffner wrote: Hi, I have a little question about osgAnimation. When I want to start an animation from the beginning I make this call: Code: animationManager-playAnimation( myAnimation ); Lets say I want to play animation myAnimation, but this time starting at second N (for example 3) and NOT from the start (second 0). In other words: I want to jump in the middle of an animation. Is there a way to do this with osgAnimation? Thank you! Cheers, Martin -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=46055#46055 ___ 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] osgmaxexp problems
Hi Seppo, What compiler are you using? I think max 2012 is compiled with VC 2008 SP 1, (at least the x64 version is; found some hints at autodesk.com that's true for x86 too). Using a different compiler for osg or osgMaxExp might cause problems. Laurens. On 1/31/2012 1:51 PM, Sergey Polischuk wrote: Hi If there were osg interface changes between version which ships with osgexp and yours, it can cause a crash. You should recompile osgexp with your osg version. 31.01.2012, 11:13, Seppo se...@kuutio.net: Hi Farshid, Yes, when 3ds max starts up it gives this error. Could it be since I also use newer OSG version than what was with the current stable release of osgmaxexp (1.0.1)? I have copied the corresponding dll files there too so it is not atleast missing any dll files, but I am not sure if that causes the problem anyway. Thanks, -Seppo *From:*osg-users-boun...@lists.openscenegraph.org mailto:osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org mailto:osg-users-boun...@lists.openscenegraph.org] *On Behalf Of *Farshid Lashkari *Sent:* 26. tammikuuta 2012 20:02 *To:* OpenSceneGraph Users *Subject:* Re: [osg-users] osgmaxexp problems Hi Seppo, On Tue, Jan 24, 2012 at 12:37 AM, Seppo se...@kuutio.net mailto:se...@kuutio.net wrote: I have compiled osgmaxexp svn rev 236 without problems, but when using that I get this error when running 3DS max 2012 (32bit version): DLL (OSGEXP.dle) failed to initialize. Error code 998 - Invalid access to memory location. Are you getting this error when 3ds max starts up or when you try to export? Cheers, Farshid ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto: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] Play audio files
Hi Héctor, I have no solution, our software just calls pause() from osg::ImageStream, and has the same stuttering on restart. Laurens. On 1/24/2012 10:32 AM, Héctor Martínez wrote: Thank you Mattias and Laurens. I am testing the code you (Laurens) have attached and it is working, but the audio is not synchronized and if I pause the audio and then I play again, it seems that it plays some kind of buffered audio and then the audio begins to sound with cuts. I am trying to find the reason of this behavior, but I write it here in case you now the solution. Best regards. -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Laurens Voerman Sent: lunes, 23 de enero de 2012 15:12 To: OpenSceneGraph Users Subject: Re: [osg-users] Play audio files Hi All, I have ffmpeg movie audio working with osgAudio, but have been to busy to clean up the code, create an example and submit for inclusion in the osgAudio library. To avoid duplicate work I attach my current code as is. Currently this is working part of our program, running both on linux (AMD64) and win7 (x64) . It compiles and runs on Win32 x86 but is probably never tested. attached is a zipfile with AudioSink.h example should be a variation on osgMovie, but should be in the osgAudio library, because osgAudio depends on osg. Laurens. Quick cut and paste from our program to show how to use this 'audioSink': // includes: #define OV_EXCLUDE_STATIC_CALLBACKS #includeosgAudio/SoundManager.h #includeosgAudio/SoundRoot.h #include AudioSink.h //init osgAudio::SoundManager::instance()-init( 16 ); osgAudio::SoundManager::instance()-getEnvironment()-setDistanceModel(osgAu dio::InverseDistance); osgAudio::SoundManager::instance()-getEnvironment()-setDopplerFactor(1); if (!noAudio) { _sceneRootGroup-addChild(new osgAudio::SoundRoot); } // play movie audio osg::ImageStream::AudioStreams audioStreams = ffstream-getAudioStreams(); if (_playAudio (!audioStreams.empty()) audioStreams[0].valid()) { osg::AudioStream* audioStream = audioStreams[0].get(); osg::notify(osg::NOTICE)AudioStream read [audioStream-getName()]std::endl; osgRCAudio::AudioSink *sink; try { sink = new osgAudio::AudioSink(audioStream); } catch (...) { osg::notify(osg::WARN) new AudioSink failed std::endl; } audioStream-setAudioSink(sink); } // cleanup osgAudio::SoundManager *sndMgr = osgAudio::SoundManager::instance(); if (sndMgr-initialized()) sndMgr-shutdown(); if (osg::Referenced::getDeleteHandler()) { osg::Referenced::getDeleteHandler()-setNumFramesToRetainObjects(0); osg::Referenced::getDeleteHandler()-flushAll(); } On 1/23/2012 11:22 AM, Mattias Helsing wrote: Hello Héctor You need to extend osg::AudioSink with the osgAudio code that you have working. Have a look at the osgmovie exemple. It (optionally) implements the osg::AudioSink interface using SDL. You need to do it using osgAudio (or whatever sound backend you prefer). cheers Mattias 2012/1/23 Héctor Martínezhector.marti...@sensetrix.com: Hi, Now, the following question: is there a straight way to connect the audio from a video to osgAudio? I am using the ffmpeg plugin to read the videos and I get audioStreams as it is done in the osgmovie example. Thank you in advance. ___ 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] Frame syncing over multiple contexts
Hi Anna, Robbert, I think the bufferswaps on window are by default not synchronized, a call to wglJoinSwapGroupNV(HDC hdc, GLuint group) is needed to make different windows synchronize. the osg lib has the code to make the call, just set traits-swapGroupEnabled = true; before createGraphicsContext(traits); Output should look like: (set OSG_NOTIFY_LEVEL=INFO) GraphicsCostEstimator::calibrate(..) GraphicsWindowWin32::setSyncToVBlank on GraphicsWindowWin32::wglJoinSwapGroupNV (0) returned 1 GraphicsWindowWin32::wglBindSwapBarrierNV (0, 0) returned 0 the wglBindSwapBarrierNV fails if you don't have a gsync card (hardware connection card for multiple graphics cards) Still, as Robbert says, a single graphics window is likely to perform better, and is of course automatically in sync. But I suppose you don't want fullscreen with stereo mode VERTICAL_SPLIT. Laurens. On 1/16/2012 10:17 AM, Robert Osfield wrote: Hi Anna, This should work out of the box - the two windows should be rendering and synchronised. How are you setting up your viewer and graphics contexts? A a general note, if you are using a single graphics card for best performance one usually tries to use a single graphics window and have two cameras or more share this context. Is there a reason why you need two separate windows rather than a single window with two views? Robert. On 14 January 2012 21:21, Anna Sokolannaso...@gmail.com wrote: Hi, I am trying to figure out how to keep multiple graphics contexts in frame sync. My operating system is Windows XP SP3. My graphics is NVidia Quadro NVS 290 with the latest driver 276.42. I'm using OpenSceneGraph 3.0.1 compiled with Visual C++ 2005 for win32. I have vsync on in the driver and in Traits, also I am using a CullDrawThreadPerContext as the threading model. I have 2 graphics windows with separate contexts showing the same scene with a left and right view on one display. I have the scene moving across both windows so that I can see if its properly syncing. It sometimes visibly looks to be a number of frames out of sync (i.e. one of the rendered context is dragging behind). What could be causing this? In the threads? Or down in the graphics card? Is there any specific settings I should set to make the rendered contexts stay in frame sync? Regards, Anna Sokol _ Once we accept our limits, we go beyond them. -- Albert Einstein ___ 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] png plugin - problem loading images
Hi Andrey, Just assuming the libpng15.dll is the one you build from source, and not something you happened to have in your path.. renaming the way you did is not very likely to work, an executable should now the name of the dll it wants to use, and will fail to start if you renamed it. However, the libpng15.dll itself tends to depend on libz.dll (or libz1.dll) - the one you build. that should also be in your path. Laurens. On 11/30/2011 6:22 PM, Andrey Ibe wrote: thank you for the tip. i tried locating the libpng library and i found there was a file libpng15.dll in the system path. i don't really know how this library file-name-thing really works so i renamed it to libpng.dll and tried running my osg app again, but without any success. i will try the program you suggested shortly and report the result, though i have all the libraries that i needed to compile the libpng and the osg in the system path variable. Andrey -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44139#44139 ___ 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] png plugin - problem loading images
Hi Andrey, Most likely your osgdb_png.dll depens on a dll not in your path. It might be libpng.dll but now I am just guessing. use dependencywalker (http://www.dependencywalker.com/) http://www.dependencywalker.com/ to see what's the problem. Laurens. On 11/23/2011 6:33 PM, Andrey Ibe wrote: Hello good ppl! i am quite new to OSG, though i managed to build it from source with several plugins. now one of them is not working - PNG. and i do need it. i am using MinGW gcc compiler suite and w7/x64 system. i built osg 3.xy from sources, with libpng, zlib, libjpg and coin plugins, which i also built from sources. i have a model that is supposed to load .png files as textures, but i'm getting this message with all the files Code: Warning: Could not find plugin to read objects from file .\textures\13.png. [Arrow] i tried renaming the png file to some nonsense and the program screamed that the file does not exist - so i guess the file path in the model is all right. [Arrow] i also tried putting the folder with osg plugins into the system path, as suggested in one of the threads. [Arrow] then i tried renaming the texture to load in the model then saving the texture into .jpg file - it worked. so the plugins themselves DO work. so where is or can the prblem be? [Question] why does the plugin not work? [Question] i do have mingw_osgdb_png.dll in the plugins folder, which is accessible from the console i run my applcation, or the osgviewer program. you may ask why do i need png textures when i am able to use .jpg textures - the answer is easy - i need transparent textures. Thank you for your time! Cheers, Andrey [/code] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=44012#44012 ___ 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] RenderBin-question/problem
Hi Stephan, You created a nested renderbin, and because of its non negative bin number it will draw after the contents of the first bin. Both are DepthSortedBin with binNumber 10. Regards, Laurens. On 11/14/2011 5:56 PM, Stephan Maximilian Huber wrote: Hi I am having problems with renderbins, this is maybe a bug in osg or I have problems to understand the concepts behind renderbins. Here's a simplified test: root + PAT 1 + geode + geo + PAT 2 + geode + geo + PAT 3 + geode + geo the root-group has a stateset with TRANSPARENT_BIN, PAT 1 is positioned at (0/0/0) and has a geode containing a geometry with a red quad (see links) and another PAT 2 holding some linestrip geometry. PAT 3 contains a geode with a green geometry, positioned at 100/100/100. The camera projection matrix is basically a hud. When PAT 2 has a stateset with -setRenderingHint(osg::StateAttribute::TRANSPARENT_BIN) then the depth-sorting is wrong (see bad.osg), if I remove the setRenderingHint-call, everything is correct (good.osg). So what's wrong with my setup? basically all drawables should end in render-bin 10, regardless of additional setRenderingHint-calls by enclosed childs, shouldn't they? AFAIK this worked in previous versions of osg. Attached you'll find two osg-models showing the problem and the corresponding screenshots: good: http://scrups.cefix.org//8k/ikhqjtvumlwco.png bad : http://scrups.cefix.org//8r/nozjb4u5y8owc.png This is with a recent checkout of osg-trunk (3.1.0) cheers, Stephan ___ 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] Crashing when building scene
Seems to me that the transformer arrays are uninitialized. for(int i=0; inumFloors; i++){ elevatorShaftXforms[i] = new osg::PositionAttitudeTransform(); floorXforms[i] = new osg::PositionAttitudeTransform(); glassXforms[i] = new osg::PositionAttitudeTransform(); pillarXforms[i] = new osg::PositionAttitudeTransform(); } Laurens. On 5/20/2011 5:22 PM, Robert Kern wrote: Hi, I'm expanding an application so that instead of one level of elevators, there can be several. However, when I am building my scene, one of my for loops causes the program to crash. I have a loop that assigns the models to their respective PositionAttitudeTransform pointers. However, after the very first call of elevatorShaftXforms[i]-addChild(elevatorShaftNodes[i]) the value of i jumps from 0 to 30934149 and numFloors changes from 7 to 5 and on the following line, I get the error: Unhandled exception at 0x01d80485 in fltviewer.exe: 0xC096: Privileged instruction. Code: int numFloors = 7; osg::Group* elevatorRoot = new osg::Group(); //create nodes: later for full tower, consider arrays of nodes osg::Node* elevatorNode = NULL; osg::Node* elevatorShaftNode= NULL; osg::Node* floorNode= NULL; osg::Node* glassNode= NULL; osg::Node* pillarNode = NULL; //node arrays osg::Node** elevatorShaftNodes = new osg::Node *[numFloors]; osg::Node** floorNodes = new osg::Node *[numFloors]; osg::Node** glassNodes = new osg::Node *[numFloors]; osg::Node** pillarNodes = new osg::Node *[numFloors]; //create transformers //osg::Group* rootPAT = new osg::Group(); osg::PositionAttitudeTransform* rootPATXform= new osg::PositionAttitudeTransform(); osg::PositionAttitudeTransform* elevatorXform = new osg::PositionAttitudeTransform(); osg::PositionAttitudeTransform* elevatorShaftXform = new osg::PositionAttitudeTransform(); osg::PositionAttitudeTransform* floorXform = new osg::PositionAttitudeTransform(); osg::PositionAttitudeTransform* glassXform = new osg::PositionAttitudeTransform(); osg::PositionAttitudeTransform* pillarXform = new osg::PositionAttitudeTransform(); //transformer arrays osg::PositionAttitudeTransform** elevatorShaftXforms= new osg::PositionAttitudeTransform *[numFloors]; osg::PositionAttitudeTransform** floorXforms= new osg::PositionAttitudeTransform *[numFloors]; osg::PositionAttitudeTransform** glassXforms= new osg::PositionAttitudeTransform *[numFloors]; osg::PositionAttitudeTransform** pillarXforms = new osg::PositionAttitudeTransform *[numFloors]; //create textures osg::Texture2D* elevatorTexture = new osg::Texture2D; osg::Texture2D* elevatorShaftTexture= new osg::Texture2D; osg::Texture2D* floorTexture= new osg::Texture2D; osg::Texture2D* glassTexture= new osg::Texture2D; osg::Texture2D* pillarTexture = new osg::Texture2D; elevatorTexture-setDataVariance(osg::Object::DYNAMIC); elevatorShaftTexture-setDataVariance(osg::Object::DYNAMIC); floorTexture-setDataVariance(osg::Object::DYNAMIC); glassTexture-setDataVariance(osg::Object::DYNAMIC); pillarTexture-setDataVariance(osg::Object::DYNAMIC); //load models elevatorNode= osgDB::readNodeFile(C:/3DVisualizer_Ped_Walk/VE_Model/Elevators.obj); elevatorShaftNode = osgDB::readNodeFile(C:/3DVisualizer_Ped_Walk/VE_Model/ElevatorShafts.obj); floorNode = osgDB::readNodeFile(C:/3DVisualizer_Ped_Walk/VE_Model/Floor.obj); glassNode = osgDB::readNodeFile(C:/3DVisualizer_Ped_Walk/VE_Model/Glass.obj); pillarNode = osgDB::readNodeFile(C:/3DVisualizer_Ped_Walk/VE_Model/Pillars.obj); //assign models to nodes for(int i=0; inumFloors; i++){ elevatorShaftNodes[i] = elevatorShaftNode; floorNodes[i] = floorNode; glassNodes[i] = glassNode; pillarNodes[i] = pillarNode; } //add transformers to root //rootnode-addChild(rootPAT); elevatorRoot-addChild(elevatorXform); //elevatorRoot-addChild(elevatorShaftXform); //elevatorRoot-addChild(floorXform); //elevatorRoot-addChild(glassXform);
Re: [osg-users] OSGExp: CMake build
Thanks. On 5/19/2011 6:06 PM, Farshid Lashkari wrote: Thanks for pointing that out, should be fixed now. Cheers, Farshid On Thu, May 19, 2011 at 8:59 AM, Laurens Voerman l.voer...@rug.nl mailto:l.voer...@rug.nl wrote: Hi Farshid, sorry to bother you again, I think you are not even using the cmake files. The CMakeLists I send you for osgExp is not correct, the line ${HEADER_PATH}/MaterialData.cpp is wrong, should refer to the .h Regards, Laurens. On 5/19/2011 5:44 PM, Farshid Lashkari wrote: Thank you Laurens. On Thu, May 19, 2011 at 7:58 AM, Laurens Voerman l.voer...@rug.nl mailto:l.voer...@rug.nl mailto:l.voer...@rug.nl mailto:l.voer...@rug.nl wrote: Hi Farshid, attached are updated CMakelist.txt files for Helpers OsgExp A fix for missing header files and an update with the added files (svn rev 199) Regards, Laurens. ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto: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 - Trying to understand climbing mem usage
Hi Sukender, Just a guess here, when you say Generate a PagedLOD, to load 'groupFile' do you call PagedLOD::addChild(Node *child, ) ? for the pageLOD will then hold the child in memory until PagedLOD::removeExpiredChildren() is called. Normally this is done in the frame loop (in updateSceneGraph()) but I think you're not in a frame loop (yet). Laurens. On 3/23/2011 10:19 AM, Sukender wrote: Hi Robert, Sorry for being too vague. It's a data preparation + viewer app, but the problem arises during the data preparation. Some data sets do not present the symptoms whereas some others do... Here is a more detailed view of the problematic method, in pseudo-code: void function(Group parent, const string path) { If path is a directory osg::ref_ptrosg::Group group(new osg::Group); Foreach entry in the directory, do a recursive call: function(group, entry). write 'group' to disk, in 'groupFile' (somewhere out of the current directory structure) Generate a PagedLOD, to load 'groupFile' when below a given view distance (using group-getBound()) Add that PagedLOD to 'parent' unload the group (well, it's a local variable!) else if it's a 3D file Get the AABB of the 3D file (the file isn't loaded in memory) Generate a PagedLOD, to load the 3D file when below a given view distance (using AABB info) Add that PagedLOD to 'parent' } This makes memory rise very high and very quickly on a given dataset. This dataset is a hierarchical tree structure with at most 1000 3D files in each dir. What is strange is that the algorithm seems quite straightforward. I'm just going crazy! I'm pretty sure there is a stupid little thing around here that I didn't spot. Or is there some OSG internal mechanism I didn't deactivate? Tries: - As I told, I wrote (before the method runs) options = osgDB::Registry::instance()-getOptions(); options-setBuildKdTreesHint(osgDB::Options::DO_NOT_BUILD_KDTREES); options-setObjectCacheHint(osgDB::Options::CACHE_NONE); - I also tried adding databasePager.clear(); after writing the 'groupFile', but this doesn't change anything. Any idea? Many thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Robert Osfieldrobert.osfi...@gmail.com a écrit : Hi Sukender, You explanation of what you are doing in your app is way too light for us to be able to guess what might be amiss. Are you running the viewer? Is it just data preperation? I haven't got a clue. Robert. On Tue, Mar 22, 2011 at 5:42 PM, Sukendersuky0...@free.fr wrote: Hi all, Here's something strange: - I create PageLODs that will load files on disk when needed - I create Groups of PagedLODs - I write those groups to disk (OSGB/T format). They thus contain only few data (just nodes and paths where data is). - I create a PagedLOD which loads this newly file on disk. The group is theorically unloaded after this. When repeating this, my memory usage climbs very high... but the groups should not be in memory... I wrote osgDB::Options * options = osgDB::Registry::instance()-getOptions(); options-setBuildKdTreesHint(osgDB::Options::DO_NOT_BUILD_KDTREES); options-setObjectCacheHint(osgDB::Options::CACHE_NONE); But this doesn't change anything. And of course I finally run out of memory. For info, small graphs behave normally in osgViewer (nodes load when approaching, memory usage rises, etc.). Any idea? Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ___ 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 - Trying to understand climbing mem usage
Hi Sukender, Your code can't cause the problem I suggested, so it must be something else. I have no other suggestions to offer. Laurens. On 3/23/2011 11:12 AM, Sukender wrote: Hi Laurens, Thanks for the tip. But my function looks like: osg::ref_ptrosg::PagedLOD paged( new osg::PagedLOD ); paged-addChild(new osg::Node); paged-setFileName(1, pathTo3DFile); paged-setRange(0, dist, FLT_MAX); paged-setRange(1, 0, dist); I create an empty child at index 0, viewable from 'dist' to FLT_MAX. The second thing is not a child but a range+filename, viewable from 0 to 'dist. This seems correct to me. Thoughts? Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Laurens Voermanl.voer...@rug.nl a écrit : Hi Sukender, Just a guess here, when you say Generate a PagedLOD, to load 'groupFile' do you call PagedLOD::addChild(Node *child, ) ? for the pageLOD will then hold the child in memory until PagedLOD::removeExpiredChildren() is called. Normally this is done in the frame loop (in updateSceneGraph()) but I think you're not in a frame loop (yet). Laurens. On 3/23/2011 10:19 AM, Sukender wrote: Hi Robert, Sorry for being too vague. It's a data preparation + viewer app, but the problem arises during the data preparation. Some data sets do not present the symptoms whereas some others do... Here is a more detailed view of the problematic method, in pseudo-code: void function(Group parent, const string path) { If path is a directory osg::ref_ptrosg::Group group(new osg::Group); Foreach entry in the directory, do a recursive call: function(group, entry). write 'group' to disk, in 'groupFile' (somewhere out of the current directory structure) Generate a PagedLOD, to load 'groupFile' when below a given view distance (using group-getBound()) Add that PagedLOD to 'parent' unload the group (well, it's a local variable!) else if it's a 3D file Get the AABB of the 3D file (the file isn't loaded in memory) Generate a PagedLOD, to load the 3D file when below a given view distance (using AABB info) Add that PagedLOD to 'parent' } This makes memory rise very high and very quickly on a given dataset. This dataset is a hierarchical tree structure with at most 1000 3D files in each dir. What is strange is that the algorithm seems quite straightforward. I'm just going crazy! I'm pretty sure there is a stupid little thing around here that I didn't spot. Or is there some OSG internal mechanism I didn't deactivate? Tries: - As I told, I wrote (before the method runs) options = osgDB::Registry::instance()-getOptions(); options-setBuildKdTreesHint(osgDB::Options::DO_NOT_BUILD_KDTREES); options-setObjectCacheHint(osgDB::Options::CACHE_NONE); - I also tried adding databasePager.clear(); after writing the 'groupFile', but this doesn't change anything. Any idea? Many thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Robert Osfieldrobert.osfi...@gmail.com a écrit : Hi Sukender, You explanation of what you are doing in your app is way too light for us to be able to guess what might be amiss. Are you running the viewer? Is it just data preperation? I haven't got a clue. Robert. On Tue, Mar 22, 2011 at 5:42 PM, Sukendersuky0...@free.fr wrote: Hi all, Here's something strange: - I create PageLODs that will load files on disk when needed - I create Groups of PagedLODs - I write those groups to disk (OSGB/T format). They thus contain only few data (just nodes and paths where data is). - I create a PagedLOD which loads this newly file on disk. The group is theorically unloaded after this. When repeating this, my memory usage climbs very high... but the groups should not be in memory... I wrote osgDB::Options * options = osgDB::Registry::instance()-getOptions(); options-setBuildKdTreesHint(osgDB::Options::DO_NOT_BUILD_KDTREES); options-setObjectCacheHint(osgDB::Options::CACHE_NONE); But this doesn't change anything. And of course I finally run out of memory. For info, small graphs behave normally in osgViewer (nodes load when approaching, memory usage rises, etc.). Any idea? Thanks. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ ___ 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
Re: [osg-users] Reading/writing float data into an image
Hi Mahendra , osgimage::data() returns an (unsigned char *) so the array indexing only steps one byte. use ((float *)dirImage-data(i))[0] = pos.x();//same effect ((float *)dirImage-data(i))[1] = pos.y();//different effect ((float *)dirImage-data(i))[2] = pos.z(); Laurens. On 10/15/2010 10:55 AM, Mahendra G.R wrote: Hello guys, I'm trying to write and then read back float data from an image but for some reason only the last written data seems correct code: dirImage-allocateImage((int) vertices.size(), (int)vertices.size(), (int)vertices.size(), GL_RGB, GL_FLOAT); for ( unsigned int i = 0; i vertices.size(); i++) { osg::Vec3 pos = vertices[i]; (float )dirImage-data(i)[0] = pos.x(); (float )dirImage-data(i)[1] = pos.y(); (float )dirImage-data(i)[2] = pos.z(); std::coutactual.x ispos.x()std::endl; std::coutactual.y ispos.y()std::endl; std::coutactual.z ispos.z()std::endl; std::coutpos.x is(float )dirImage-data(i)[0]std::endl; std::coutpos.y is(float )dirImage-data(i)[1]std::endl; std::coutpos.z is(float )dirImage-data(i)[2]std::endl; } can anybody point out the mistake, sorry if its too silly. -- http://www.mahendragr.com ___ 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] Developer release of OSG and VPB imminent, please test.
Hi Robert, OSG builds fine on my Windows XP, with VS2008. Our application runs as expected. I have not tested VPB nor have I tested with linux (not test case ready). Laurens. On 6/18/2010 10:30 AM, Robert Osfield wrote: On Thu, Jun 17, 2010 at 5:23 PM, Robert Osfield robert.osfi...@gmail.com wrote: I would like tag developer releases of the OSG and VPB tomorrow so testing across compile and runtime platforms would be very useful. Oooo the silence... Has anyone tested out svn/trunk for OSG and VPB since my call? If there no negative feedback I'll have to assume everything is fine just go ahead and tag this morning. My plan is start pupping out dev releases weekly again as we start working towards 3.0. 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] valgrind, memory leak debugging
Hi Thomas, I did a quick read of your code, and the first thing I notice is that the osgDB::readNodeFile result is assigned to a osg::Group*, NOT a osg::ref_ptrosg::Group . The pointers run out of scope at the end of generateSimplifiedNodes, mergeNodes seems to take most of the geometry, but this looks like a leak to me. Laurens. On 5/2/2010 8:07 PM, Tomas Hnilica wrote: Hello OSG users, I am working on a project that processes large amount of data a have problems with memory leaks. Problematic part of the code does simplification of OSG subgraphs and writes out the results. In this code, no graphical window exists, it's only about reading - processing - writing of .ive files. The code reads in two .ive files, merges the geometries in these files, does simplification on the merged geometries and writes the result to the .ive file. On very large models the system goes out of memory in the simplification phase. There must be some memory leak in the code, I guess in the merging phase, because this is done by myself :) During the process in the single simplification step, the memory is allocated and then deallocated, but not to the same amount as before (that may be OS allocation strategy specific). When the process goes through several simplification steps, the amount of overall reserved memory increases (this is what MS Windows task manager says). I tried to find the problem with valgrind on Linux, but it reports loss of memory in the OSG code, what is probably wrong interpretation. Does anynone use valgrind for memory leak detection in OSG apps or can you recommend other method? I attached simplified snapshot of incremented piece of my code, if different eyes could have a short look I would highly appreciate it - maybe there is only wrong usage of readNodeFiles, merging data or osg::ref_ptr's...it seems that only small portion of the allocated memory is not deallocated. Some messages coming from valgrind that are not clear to me (I hope OSG is memory leak free because of osg::ref_ptr ): ==11693== 12,137 (328 direct, 11,809 indirect) bytes in 1 blocks are definitely lost in loss record 287 of 432 ==11693== at 0x4C23809: operator new(unsigned long) (vg_replace_malloc.c:230) ==11693== by 0x56B7D09: osg::Node::getOrCreateStateSet() (in /home/tomas/OpenSceneGraph-2.8.0/lib/libosg.so.2.8.0) ==11693== by 0x5EF992D: osgFX::Effect::build_dummy_node() (in /home/tomas/OpenSceneGraph-2.8.0/lib/libosgFX.so.2.8.0) ==11693== by 0x5EFA072: osgFX::Effect::Effect() (in /home/tomas/OpenSceneGraph-2.8.0/lib/libosgFX.so.2.8.0) ==11693== by 0x5EFCDDF: osgFX::Scribe::Scribe() (in /home/tomas/OpenSceneGraph-2.8.0/lib/libosgFX.so.2.8.0) ==11693== by 0x2989BE06: ??? ==11693== 17,616 (1,560 direct, 16,056 indirect) bytes in 15 blocks are definitely lost in loss record 286 of 432 ==11693== at 0x4C23809: operator new(unsigned long) (vg_replace_malloc.c:230) ==11693== by 0x6BD87C1: EdgeCollapse::addEdge(EdgeCollapse::Triangle*, EdgeCollapse::Point*, EdgeCollapse::Point*) (in /home/tomas/OpenSceneGraph-2.8.0/lib/libosgUtil.so.2.8.0) ==11693== by 0x6BDB815: EdgeCollapse::addTriangle(EdgeCollapse::Point*, EdgeCollapse::Point*, EdgeCollapse::Point*) (in /home/tomas/OpenSceneGraph-2.8.0/lib/libosgUtil.so.2.8.0) ==11693== by 0x6BDD72D: EdgeCollapse::collapseEdge(EdgeCollapse::Edge*, EdgeCollapse::Point*) (in /home/tomas/OpenSceneGraph-2.8.0/lib/libosgUtil.so.2.8.0) ==11693== by 0x6BCD03D: osgUtil::Simplifier::simplify(osg::Geometry, std::vectorunsigned, std::allocatorunsigned const) (in /home/tomas/OpenSceneGraph-2.8.0/lib/libosgUtil.so.2.8.0) ==11693== by 0x6BCD456: osgUtil::Simplifier::simplify(osg::Geometry) (in /home/tomas/OpenSceneGraph-2.8.0/lib/libosgUtil.so.2.8.0) - The linux code is OSG 2.8.0, I tested the same with 2.9.7 as well. Thank you very much for any comments and help in advance, Tomas Hnilica ___ 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] Refreshing a Scenegraph
Hi Suvajit, From your description I suspect that your problem is caused by the osg object cache. try osgDB::Registry::instance()-clearObjectCache(); before the ReadFile() to see if that's the problem. If that helps you might want to just supress the usage of the cache for this readfile call: osgDB::ReaderWriter::Options* opt = osgDB::Registry::instance()-getOptions(); if (!opt) opt = new osgDB::ReaderWriter::Options(); opt-setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_NONE); osgDB::Registry::instance()-setOptions(opt); readFile() opt-setObjectCacheHint(osgDB::ReaderWriter::Options::CACHE_ALL); osgDB::Registry::instance()-setOptions(opt); Cheers, Laurens. On 4/28/2010 3:49 PM, Suvajit Sengupta wrote: Hi Robert, Yes, I am calling the viewer-frame() after updating the model assuming that after the model is built then only I can call for update and render traversal. Now the question to me how to re-render a scene ? Looking for some directions. ... Thank you! Cheers, Suvajit -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=27368#27368 ___ 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] Static linking with user pulgins AND dynamic OSG?
Hi Sukender, I still think that it should work, and the problems you discribe sound like you have different #defines for the plugin and the main executable, possibly caused by different include path (or order in the include path). Possibly different compiler settings (esp. C/C++-Code Generation-Runtime Library). To check you could dig up the compler command line from the BuildLog for the executable and the static lib objects, something like /O2 /Ob2 /I X:\osg\3rdparty\include /I X:\osg\OpenSceneGraph\include /I X:\osg\vc9\include /D WIN32 /D _WINDOWS /D NDEBUG /D _SCL_SECURE_NO_WARNINGS /D _CRT_SECURE_NO_DEPRECATE /D WIN32_LEAN_AND_MEAN /D _WIN32_WINNT=0x0500 /D CMAKE_INTDIR=\Release\ /D _MBCS /FD /EHsc /MD /arch:SSE2 /Foosgrc.dir\Release\\ /FdX:/osg/osgRC/lib/Release/osgrc.pdb /W3 /c /TP /Zm1000 /MP I suspect there is a difference. If they match the .obj file will be effectively identical, so the linker should behave identical. The option to use the .obj files instead of the .lib is avialable in visual studio if the projects are part of the same solution, in the property's for the executable: Configuration Properties-Linker(-General) set Use Libraray dependencies: Yes (and make the exe project dependent of the .lib projects and remove the .lib from Linker-Input Additional Dependencies if this is not already the configuration) Use Libraray dependency Inputs: Yes Laurens. Sukender wrote: Hi Laurens, Many thanks for the examples and the modified readers. I don't have time to browse it right now but I will soon. Well, USE_OSGPLUGIN() in Main.cpp causes linker to complain about duplicated symbols (inline methods in osgDB). I think this is because the compiler can silently refuse inlining and thus create the methods' code in each .cpp. I didn't find a way to work around this, except: - Making OSG static (which is what I don't want, for multiple reasons) - Directly including reader-writers code into my project (it works as expected) If you know a way, please tell ! It would be nice to tell CMake to directly include .o/.obj files from a project into another one at link-time, but I guess it's a bit tricky and non portable... Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Laurens Voerman l.voer...@rug.nl a écrit : Hi Sukkender, if you are linking whith the .lib the USE_OSGPLUGIN() is required. - Unless your project is set up to silently ignore the lib file and link the .obj files instead. (can't find the option atm.) What is the effect of the USE_OSGPLUGIN() in the Main.cpp? Attached is a reduced version of my project whith all the plugins, where our viewer has been replaced by the osgviewer. The cmake files generate dynamic link libs (osgdb_dds.dll) and always stuff the plugin into the final .exe too. modified dds reader and .mip helper reader are someware in osg-submissions archive: see the thread proposing dds mmToSkip option starting on 3 dec 2009. Code is in the attachment.(possibly updated) Laurens. Sukender wrote: Forgot to mention: under MSVC, I've put /OPT:NOREF to avoid symbols from being excluded when linking static libs. Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Sukender suky0...@free.fr a écrit : Hi Laurens, hi all, Hum, could you give me a hint, please? If I write: class BBB : public osgDB::ReaderWriter {... blah blah blah ...}; REGISTER_OSGPLUGIN(bbb, BBB) in bbb.cpp (in my main exe), then the BBB reader/writer is constructed and added to the registry when process loads. However if I put that .cpp in a static lib, which is linked to my main exe, then the BBB reader/writer is never built (nor added to the registry). As far as I know, static libs are roughly a bunch of objects! Were's the difference? And of course, using USE_OSGPLUGIN() doesn't work. BTW, The feature you're mentioning seems interesting. Is there any chance you release the code, under a licence or another? Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Laurens Voerman l.voer...@rug.nl a écrit : Hi Sukender, my modified dds reader is able to skip reading high res mipmaps from the dds file. For the version you are using, I am guessing that your link errors might originate in compliling the static plugin lib with OSG_LIBRARY_STATIC defined. And/Or linking the plugin with the osg libs. Mixing debug and release versions will also create confusing link errors. Of course the USE_OSGPLUGIN(ext1) must be mirrored by a REGISTER_OSGPLUGIN(ext1,myReaderWriterExtention1) Laurens. Sukender wrote: Hi Laurens, This is what I mean. Glad to see it can work! But I have: - A static lib - No dllexport stuff - Two USE_PLUGIN() in the main exe And I have linker errors. Any idea? BTW, what your modified plugin does? I had problems with DDS (saw some 3rd-party apps read RGB as BGR and vice-versa). Cheers
Re: [osg-users] Static linking with user pulgins AND dynamic OSG?
Hi Sukender, my modified dds reader is able to skip reading high res mipmaps from the dds file. For the version you are using, I am guessing that your link errors might originate in compliling the static plugin lib with OSG_LIBRARY_STATIC defined. And/Or linking the plugin with the osg libs. Mixing debug and release versions will also create confusing link errors. Of course the USE_OSGPLUGIN(ext1) must be mirrored by a REGISTER_OSGPLUGIN(ext1,myReaderWriterExtention1) Laurens. Sukender wrote: Hi Laurens, This is what I mean. Glad to see it can work! But I have: - A static lib - No dllexport stuff - Two USE_PLUGIN() in the main exe And I have linker errors. Any idea? BTW, what your modified plugin does? I had problems with DDS (saw some 3rd-party apps read RGB as BGR and vice-versa). Cheers, Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ - Laurens Voerman l.voer...@rug.nl a écrit : Hi Sukender, I'm very confused about Robert's reply, because it's working fine for me. I am using a modified dds reader linked into my app, which takes precedence over any osgdb_dds.dll because it registers on startup. This can be done by simply adding the (modified) ReaderWriterDDS.cpp to the project producing the executable, in this version there is no need for USE_PLUGIN() - it will cause a link error. If you compile the plugin into a static link lib, you need the USE_PLUGIN() and link to the lib. This can work because the plugins I am using are not exporting any symbols, so there is no __declspec(dllexport) stuff in the way. Laurens. Robert Osfield wrote: Hi Sukender, On Tue, Apr 6, 2010 at 10:15 AM, Sukender suky0...@free.fr wrote: Hi all, I found several ressources(*) about static linking but didn't found an answer to my question: can I combine dynamic OSG/OT + dynamic OSG plugins + static custom (= user) plugins? If yes, how? I can't see how this would work as it seems to be there would be a conflict between what version of core libraries that the dynamic vs static plugins would need to link to. If you want dynamic linking then use it everywhere. 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] Static linking with user pulgins AND dynamic OSG?
Hi Sukender, I'm very confused about Robert's reply, because it's working fine for me. I am using a modified dds reader linked into my app, which takes precedence over any osgdb_dds.dll because it registers on startup. This can be done by simply adding the (modified) ReaderWriterDDS.cpp to the project producing the executable, in this version there is no need for USE_PLUGIN() - it will cause a link error. If you compile the plugin into a static link lib, you need the USE_PLUGIN() and link to the lib. This can work because the plugins I am using are not exporting any symbols, so there is no __declspec(dllexport) stuff in the way. Laurens. Robert Osfield wrote: Hi Sukender, On Tue, Apr 6, 2010 at 10:15 AM, Sukender suky0...@free.fr wrote: Hi all, I found several ressources(*) about static linking but didn't found an answer to my question: can I combine dynamic OSG/OT + dynamic OSG plugins + static custom (= user) plugins? If yes, how? I can't see how this would work as it seems to be there would be a conflict between what version of core libraries that the dynamic vs static plugins would need to link to. If you want dynamic linking then use it everywhere. 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] OSGEXP building problem...
Hi Alessandro, I usually build the exporter with a static linked osg, so I have no recent experience with your problem. It seems to me that you might be missing a dependency for osgdb_ive.dll, as the osgdb_osg.dll is found and working I can't see any reason why the ive plugin would not be found. Checking the dependency's for my ive plugin gives me the following list (beyond the ones required for osg) OSG64-OSGSIM.DLL OSG64-OSGFX.DLL OSG64-OSGTEXT.DLL OSG64-OSGTERRAIN.DLL OSG64-OSGVOLUME.DLL Are these all in your path or in the max directory? Regards, Laurens. alessandro terenzi wrote: Thanks Laurens, I've solved every building problems...beyond the one described earlier, I could not build because I needed the Platform SDK in order to compile OSGExp's resources. But although the preview works fine inside 3dsMax, exporting to files do not... 1) if I export to .OSG then the osg file is created successfully 2) if I export to .IVE then 3dsMax crashes because the ive plugin is not found..but I put every osgdb_* plugins in the expected directory (ie max directory, same as the osg plugin that works) ...I also tried to put plugins in the osgplugins-2.8.2 sub-directory inside max dir and I also added the referenced CRT...but the ive plugin is never found... Any suggestion? Thanks. Regards. Alessandro On Mon, Mar 8, 2010 at 1:05 AM, L. Voerman l.voer...@rug.nl mailto:l.voer...@rug.nl wrote: I solved this like this: #if MAX_VERSION_MAJOR 12 //MAX2010 TCHAR* renderBinName; #else const MCHAR* renderBinName; #endif for all TCHAR* in OSGHelpers.cpp (3x) and once TCHAR *name; in MtlKeeper.cpp. Laurens. alessandro terenzi wrote: Don't know if this is the right place to ask for help, but I'm trying to build OSGExp wrt OSG 2.9.7 and Max SDK 2010 and I get compile errors (many like this): 1..\..\src\OSGExp\OSGHelpers.cpp(220) : error C2664: 'BOOL IParamBlock2::GetValue(ParamID,TimeValue,float ,Interval ,int)' : cannot convert parameter 3 from 'TCHAR *' to 'float ' I'm building using Visual C++ 2008 Express. Anyone having the same problem? Any suggestion? Thanks in advance. Kind regards. Alessandro ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto:osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org mailto: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] OpenSceneGraph-2.8.2 release candidate three tagged
Paul Melis wrote: Jason Daly wrote: Paul Melis wrote: Okay, can you give me some pointers how to make it work then? I have VS8 sp1, have downloaded the corresponding debug package from the OSG website and have a really small test application that forces OSG to use some freed memory. If I build (in debug mode of course) and then run the test from VS with F5 it nicely catches the error, but in the stack trace none of the OSG dlls show any symbols... I think the problem is that OSG is using /Zi instead of /Z7, but at the same time, the .pdb files aren't being distributed in the packages. Right, that is what I originally suspected. So is there any point to the debug packages *in their current form*? As 2.8.2 is probably released pretty soon it might be a good point in time to fix this? My guess is that the extra size comes from optimizations being turned off (the default in Debug mode), but I don't make the packages, so I'm not sure. Is there any way to test for a given dll if there is debug information in it, e.g. with some MSVC tool? Paul Hi Paul, Does this help? %VCINSTALLDIR%\bin\dumpbin.exe /PDBPATH:VERBOSE osg55-osgd.dll Laurens. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] side-by-side stereo display
Hi Tom, for wat you're describing set OSG_STEREO=ON set OSG_STEREO_MODE=HORIZONTAL_SPLIT should do the trick. See http://www.openscenegraph.org/index.php?page=UserGuides.StereoSettings for more details. Laurens Voerman HPCV CIT University of Groningen www: http://www.rug.nl/cit/hpcv Tom Pearce wrote: Hey everyone, I'm new (in the past couple months) to OSG and to this list, and I was hoping someone could point me in the right direction on this question: How do I best go about getting two views into a scene to display side-by-side in a window so a stereo monitor can display it properly? I need an interactive environment, so creating two animations and editing them won't work. Essentially the view from each camera needs to be scaled in the x direction to fit half the screen, and displayed seamlessly next to the scaled view from the other camera. Any advice or links to previous answers or anything would be much appreciated! Thanks, Tom ___ 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