[osg-users] problem with openscenegraph-data?
Morning all, I have been doing some testing and have updated a fresh copy from SVN of openscenegraph-data and the latest SVN. After running examples.bat I get a blank screen on a lot of the examples... If I run osgviewer cow.osg it works, but cow.osgt does not, it looks like its WIP but just to let you know or I am not understanding the new format osgt. Is there a new plugin for this, maybe my OSG is not using it? Cheers Martin ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Martin, On Mon, Jun 27, 2011 at 11:00 AM, Martin Naylor martinnay...@virginmedia.com wrote: I have been doing some testing and have updated a fresh copy from SVN of openscenegraph-data and the latest SVN. After running examples.bat I get a blank screen on a lot of the examples... If I run osgviewer cow.osg it works, but cow.osgt does not, it looks like its WIP but just to let you know or I am not understanding the new format osgt. Is there a new plugin for this, maybe my OSG is not using it? The .osgt is the new native ascii file fomat that deprecates .osg. Both the old format and new .osgt, .osgb and .osgx formats are all supported from the same osg plugin, but the serializers are now located in src/osgWrappers/serializers and srcWraperss/deprecated_dot_osg plugins that are loading by the osg plugin as required. Now if the .osgt format is not loading for you then I'd suspect that you haven't built and installed the latest dev, svn/trunk or OSG-3.0-rc* properly. What version do you get when your run: osgversion You should get 3.1.0 is you are using svn/trunk and OSG-3.0.0 for any of the rc's or the OSG-3.0 branch. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] setContextID comment block
Hi Paul, Thanks for the note about the out of data comments. I've updated this comment and checked it into svn/trunk and the OSG-3.0. The ContextID is set by the osgViewer::GraphicsWindow intialization, calling GraphicsContext::createContextID() that manages the unique ID's. Robert. On Sun, Jun 26, 2011 at 10:43 PM, Paul Martz pma...@skew-matrix.com wrote: Hi Robert -- in the osg/State header, the comment block for the setContextID() method reads as follows: /** Set the current OpenGL context uniqueID. Note, it is the application developers responsibility to set up unique ID for each OpenGL context. This value is then used by osg::StateAttribute's and osg::Drawable's to ... I suspect this is an old comment, as it has not been the application developer's responsibility to set a unique ID for, well, I've been working with OSG since 2004 and I've never recalled having to do this, so at least 7 years. I'd submit a change, but I'm not quite sure (upon glancing at the source) where the unique ID comes from. If you would, could you update the comment to explain how the unique ID is generated and set in modern OSG? Thanks, -- -Paul Martz Skew Matrix Software http://www.skew-matrix.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph-3.0.0-rc6 tagged
Robert, The unices built fine. Thanks! Mathias -- Dr. Mathias Fröhlich, science + computing ag, Software Solutions Hagellocher Weg 71-75, D-72070 Tuebingen, Germany Phone: +49 7071 9457-268, Fax: +49 7071 9457-511 -- Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Philippe Miltin Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Robert, Yeah its 3.1.0 Let me take a look at a few bits and check my paths etc... Cheers Martin -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: 27 June 2011 11:11 To: OpenSceneGraph Users Subject: Re: [osg-users] problem with openscenegraph-data? Hi Martin, On Mon, Jun 27, 2011 at 11:00 AM, Martin Naylor martinnay...@virginmedia.com wrote: I have been doing some testing and have updated a fresh copy from SVN of openscenegraph-data and the latest SVN. After running examples.bat I get a blank screen on a lot of the examples... If I run osgviewer cow.osg it works, but cow.osgt does not, it looks like its WIP but just to let you know or I am not understanding the new format osgt. Is there a new plugin for this, maybe my OSG is not using it? The .osgt is the new native ascii file fomat that deprecates .osg. Both the old format and new .osgt, .osgb and .osgx formats are all supported from the same osg plugin, but the serializers are now located in src/osgWrappers/serializers and srcWraperss/deprecated_dot_osg plugins that are loading by the osg plugin as required. Now if the .osgt format is not loading for you then I'd suspect that you haven't built and installed the latest dev, svn/trunk or OSG-3.0-rc* properly. What version do you get when your run: osgversion You should get 3.1.0 is you are using svn/trunk and OSG-3.0.0 for any of the rc's or the OSG-3.0 branch. 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] [build] OSG 3.1.0 SVN don't work for me
Hi Emmanuel, I has occurred to me that perhaps your build of the latest OSG is linking to the mesa driver at runtime rather than the NVidia driver. The OSG itself just links to libGL.so so should pick up any GL driver that this linked to, and it could be that on your install of the GL drivers this doesn't yet link the NVidia driver. Have a look at what your /usr/lib/libGL.so links to. Also double check what the CMake build of the OSG is linking to - use: cd OpenSceneGraph ccmake . Press 't' to toggle on the advanced options, then scroll down to the OPENGL_gl_LIBRARY entry - this typically would be /usr/lib/libGL.so. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Martin, On Mon, Jun 27, 2011 at 12:03 PM, Martin Naylor martinnay...@virginmedia.com wrote: I have had a look around and can come up with no problems. Not sure where to look at the moment, running via remote desktop at present so ignore the GL errors...it did happen when running on my desktop yesterday so I am ruling RDP out for the moment as osgviewer cow.osg works via RDP... Attached is the logfile from the debug not sure if it will help. I noticed it when I wiped my openscenegraph-data and checked it out again... The debug output looks OK, it does look that the osgdb_serializer_osg.dll is found should it should be able to load the data. The only slighty odd thing is that the osgdb_serializer_ prefix is only used right at the end, it should really be checked right at the start rather than searching for osg.dll. I'll look into this but I don't think this is the cause of the issues on your system. Could you try an: osgconv cow.osgt test.osg To see what result you get. Try the test.osg with osgviewer. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Robert, Yeah the same results, attached is the converted osg file just in case you spot some oddities.. Certainly a small file, let me know if you need any debug output or anything you want me to try. Not sure if it will convert ok being on remotedesktop... Cheers Martin. -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: 27 June 2011 12:12 To: OpenSceneGraph Users Subject: Re: [osg-users] problem with openscenegraph-data? Hi Martin, On Mon, Jun 27, 2011 at 12:03 PM, Martin Naylor martinnay...@virginmedia.com wrote: I have had a look around and can come up with no problems. Not sure where to look at the moment, running via remote desktop at present so ignore the GL errors...it did happen when running on my desktop yesterday so I am ruling RDP out for the moment as osgviewer cow.osg works via RDP... Attached is the logfile from the debug not sure if it will help. I noticed it when I wiped my openscenegraph-data and checked it out again... The debug output looks OK, it does look that the osgdb_serializer_osg.dll is found should it should be able to load the data. The only slighty odd thing is that the osgdb_serializer_ prefix is only used right at the end, it should really be checked right at the start rather than searching for osg.dll. I'll look into this but I don't think this is the cause of the issues on your system. Could you try an: osgconv cow.osgt test.osg To see what result you get. Try the test.osg with osgviewer. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org test.osg Description: Binary data ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Martin, The test.osg you have is missing all the contents of the scene graph save for the root group. I would suspect that loading of the serializers is amiss somewhere. The curious thing is that other windows users have been use the new serializers for a while now without any problems. As another test could you try: osgconv cow.osg test.osgt osgviewer test.osgt Robert. On Mon, Jun 27, 2011 at 12:19 PM, Martin Naylor martinnay...@virginmedia.com wrote: Hi Robert, Yeah the same results, attached is the converted osg file just in case you spot some oddities.. Certainly a small file, let me know if you need any debug output or anything you want me to try. Not sure if it will convert ok being on remotedesktop... Cheers Martin. -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: 27 June 2011 12:12 To: OpenSceneGraph Users Subject: Re: [osg-users] problem with openscenegraph-data? Hi Martin, On Mon, Jun 27, 2011 at 12:03 PM, Martin Naylor martinnay...@virginmedia.com wrote: I have had a look around and can come up with no problems. Not sure where to look at the moment, running via remote desktop at present so ignore the GL errors...it did happen when running on my desktop yesterday so I am ruling RDP out for the moment as osgviewer cow.osg works via RDP... Attached is the logfile from the debug not sure if it will help. I noticed it when I wiped my openscenegraph-data and checked it out again... The debug output looks OK, it does look that the osgdb_serializer_osg.dll is found should it should be able to load the data. The only slighty odd thing is that the osgdb_serializer_ prefix is only used right at the end, it should really be checked right at the start rather than searching for osg.dll. I'll look into this but I don't think this is the cause of the issues on your system. Could you try an: osgconv cow.osgt test.osg To see what result you get. Try the test.osg with osgviewer. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Martin, I've had another thought, the old .osg plugin explictly preloads the core osg class wrappers to retain backwards compatibility with how they worked bofore, while the new serailizers load an the serializer dll's on demand. It could be this secondary dll loading that is at fault. Could you try: osgviewer cessnafire.osg As this should get the plugin to load the osgParticle NodeKit and associate deprecated osgParticle wrappers. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
HI Robert, That works fine! Is it the files that are naff that are downloaded from Openscenegraph-data, or need updating? Cheers Martin -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: 27 June 2011 12:23 To: OpenSceneGraph Users Subject: Re: [osg-users] problem with openscenegraph-data? Hi Martin, The test.osg you have is missing all the contents of the scene graph save for the root group. I would suspect that loading of the serializers is amiss somewhere. The curious thing is that other windows users have been use the new serializers for a while now without any problems. As another test could you try: osgconv cow.osg test.osgt osgviewer test.osgt Robert. On Mon, Jun 27, 2011 at 12:19 PM, Martin Naylor martinnay...@virginmedia.com wrote: Hi Robert, Yeah the same results, attached is the converted osg file just in case you spot some oddities.. Certainly a small file, let me know if you need any debug output or anything you want me to try. Not sure if it will convert ok being on remotedesktop... Cheers Martin. -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: 27 June 2011 12:12 To: OpenSceneGraph Users Subject: Re: [osg-users] problem with openscenegraph-data? Hi Martin, On Mon, Jun 27, 2011 at 12:03 PM, Martin Naylor martinnay...@virginmedia.com wrote: I have had a look around and can come up with no problems. Not sure where to look at the moment, running via remote desktop at present so ignore the GL errors...it did happen when running on my desktop yesterday so I am ruling RDP out for the moment as osgviewer cow.osg works via RDP... Attached is the logfile from the debug not sure if it will help. I noticed it when I wiped my openscenegraph-data and checked it out again... The debug output looks OK, it does look that the osgdb_serializer_osg.dll is found should it should be able to load the data. The only slighty odd thing is that the osgdb_serializer_ prefix is only used right at the end, it should really be checked right at the start rather than searching for osg.dll. I'll look into this but I don't think this is the cause of the issues on your system. Could you try an: osgconv cow.osgt test.osg To see what result you get. Try the test.osg with osgviewer. 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] problem with openscenegraph-data?
Hi Robert, Using .osg works fine, but .osgt is still coming up blank... Converted cessnafire to osgt and it works ok.. Cheers Martin -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: 27 June 2011 12:43 To: OpenSceneGraph Users Subject: Re: [osg-users] problem with openscenegraph-data? Hi Martin, I've had another thought, the old .osg plugin explictly preloads the core osg class wrappers to retain backwards compatibility with how they worked bofore, while the new serailizers load an the serializer dll's on demand. It could be this secondary dll loading that is at fault. Could you try: osgviewer cessnafire.osg As this should get the plugin to load the osgParticle NodeKit and associate deprecated osgParticle wrappers. 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] problem with openscenegraph-data?
Hi Martin, On Mon, Jun 27, 2011 at 12:56 PM, Martin Naylor martinnay...@virginmedia.com wrote: Is it the files that are naff that are downloaded from Openscenegraph-data, or need updating? As far as I'm aware the .osgt files in OpenSceneGraph-Data are all correct, I have now tagged and posted the OpenSceneGraph-Data-3.0.0. http://www.openscenegraph.org/projects/osg/wiki/Downloads/SampleDatasets Could you post your the cow.osgt so I can double check it's OK. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Robert, I just sent you the cow.osgt I was using, but its stuck in the list manager approval... Also I have downloaded and replaced the dataset with the same results. Anything else you want me to try just shout... Cheers Martin -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: 27 June 2011 13:14 To: OpenSceneGraph Users Subject: Re: [osg-users] problem with openscenegraph-data? Hi Martin, On Mon, Jun 27, 2011 at 12:56 PM, Martin Naylor martinnay...@virginmedia.com wrote: Is it the files that are naff that are downloaded from Openscenegraph-data, or need updating? As far as I'm aware the .osgt files in OpenSceneGraph-Data are all correct, I have now tagged and posted the OpenSceneGraph-Data-3.0.0. http://www.openscenegraph.org/projects/osg/wiki/Downloads/SampleDatasets Could you post your the cow.osgt so I can double check it's OK. 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] problem with openscenegraph-data?
Hi Martin, On Mon, Jun 27, 2011 at 1:18 PM, Martin Naylor martinnay...@virginmedia.com wrote: Hi Robert, Here is the osgt cow... I will check out 3.0.0 dataset and give that a go.. I've just done a diff and uour cow.osgt is identical with the one OpenSceneGaph-Data-3.0.0. The problem at you end has to be an issue with loading the new and utilzing the new serializers. I'm afraid I don't have any clue at all why they might be failing. From your previous emails you reported sucsess, but you weren't specific in which test this was. So just for cariity what happens when you do: osgconv cow.osg test.osgt osgviewer test.osgt If this works could you compare the cow.osgt in OpenSceneGraph-Data and the test.osgt. Robert. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph-3.0.0-rc6 tagged
Hi All, Any more feedback on the OSG-3.0 branch or OSG-3.0.0-rc6?? I'm ready to tag the release now. All I need to do is type make tag-run and then update the website... but first I'd like to see some more feedback on how things are looking. I'm particularily keen to get feedback from Windows users and whether the new serializers are work OK for you, for background see see the today's thread openscenegraph-data?. Could you please test the new OpenSceneGraph-Data in svn/trunk or the new OpenSceneGraph-Data.3.0.0.zip that I uploaded this morning. The data is now linked from. http://www.openscenegraph.org/projects/osg/wiki/Downloads/SampleDatasets To test run: osgviewer cow.osgt osgviewer osgcool.osgt osgviewer cessnafire.osgt osgvewier glsl_mandelbrot.osgt I haven't seen any reports of problems with the new serializers other than one with handling invalid numerical values that I came across, Wang Rui's already addressed this problem, so until Martin's post this morning it looked like everything was working well. It could be that Martin's build or runtime has gone wrong for some reason, or it could be that this is a platform specific bug. I'd like to work out which of these two it is so I can make a judgement call on whether it's safe to tag 3.0.0. Thanks for you help, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Robert, I just did a diff on the files, it's the old chestnut of carriage returns at the end of the files(unix style), when comparing against the one using osgconv. Believe you have a tool for updating the mass unix carriage returns...does that make sense? Cheers Martin -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: 27 June 2011 13:31 To: OpenSceneGraph Users Subject: Re: [osg-users] problem with openscenegraph-data? Hi Martin, On Mon, Jun 27, 2011 at 1:18 PM, Martin Naylor martinnay...@virginmedia.com wrote: Hi Robert, Here is the osgt cow... I will check out 3.0.0 dataset and give that a go.. I've just done a diff and uour cow.osgt is identical with the one OpenSceneGaph-Data-3.0.0. The problem at you end has to be an issue with loading the new and utilzing the new serializers. I'm afraid I don't have any clue at all why they might be failing. From your previous emails you reported sucsess, but you weren't specific in which test this was. So just for cariity what happens when you do: osgconv cow.osg test.osgt osgviewer test.osgt If this works could you compare the cow.osgt in OpenSceneGraph-Data and the test.osgt. Robert. 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] OpenSceneGraph-3.0.0-rc6 tagged
Hi Robert, I'll be at home in some hours, I'll give you feedback as soon as possible, I think in 4 hours from now. Would it be possible to include a collada example file into the OSG example data? Thank you! Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40913#40913 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph-3.0.0-rc6 tagged
Hi Torben, On Mon, Jun 27, 2011 at 1:49 PM, Torben Dannhauer tor...@dannhauer.info wrote: I'll be at home in some hours, I'll give you feedback as soon as possible, I think in 4 hours from now. All testing is useful, but I'd like to tag 3.0.0 as soon as possible as I have lots on stuff to do in prep for my heading off on family holiday tomorrow, so may well have tagged 3.0.0 by the time you get back. Would it be possible to include a collada example file into the OSG example data? I have already tagged and uploaded the OpenSceneGraph-Data-3.0.0 data, I don't plan on updating it as I have plenty of other work to do. You can always upload the data to the wilki. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph-3.0.0-rc6 tagged
Hi Robert, ok, thanks! Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40916#40916 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Robert, From your previous emails you reported sucsess, but you weren't specific in which test this was. So just for cariity what happens when you do: osgconv cow.osg test.osgt osgviewer test.osgt If this works could you compare the cow.osgt in OpenSceneGraph-Data and the test.osgt. I've just done the same test on my nightly built OSG. I've done this: osgviewer cow.osgt (meaning the cow.osgt that's in OSG-Data) and this comes up blank. Then I did as you suggest: osgconv cow.osg test.osgt osgviewer test.osgt and this works fine. Diffing cow.osgt (from OSG-Data) and test.osgt (from my osgconv) gives a lot of small precision differences in floating point numbers (probably meaningless) and a difference in line endings as Martin said. If I change cow.osgt (from OSG-Data) to Windows line endings, then it loads correctly in osgviewer. So the question is, why does the line ending style make any difference? Perhaps the osgt plugin tries to read the file's header, fails because of line endings, and then hands off responsibility of loading to another plugin? I can have a go at debugging this if you have no ideas. Clearly changing all the files in OSG-Data to have Windows line endings is not a solution. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi J-S, On Mon, Jun 27, 2011 at 2:20 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: If I change cow.osgt (from OSG-Data) to Windows line endings, then it loads correctly in osgviewer. So the question is, why does the line ending style make any difference? Perhaps the osgt plugin tries to read the file's header, fails because of line endings, and then hands off responsibility of loading to another plugin? I can have a go at debugging this if you have no ideas. Clearly changing all the files in OSG-Data to have Windows line endings is not a solution. Thanks for the testing. It confirms that it isn't a problem specific problem to Martin's system, and show's that we all haven't done enough testing of all the different combinations of usage of the new serializers. I'm glad this has now been spotted, unfortunately Rui is likely to have headed off to be so we'll probably need to track down the line ending issues ourselves. I'll convert line endings to dos on my system to see if I can recreate the problem under Linux. Cheers, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi J-S, On Mon, Jun 27, 2011 at 2:41 PM, Robert Osfield robert.osfi...@gmail.com wrote: I'll convert line endings to dos on my system to see if I can recreate the problem under Linux. I've just done a test and .osgt with dos line endings works fine under Linux. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
On 27/06/11 15:46 , Robert Osfield wrote: I'll convert line endings to dos on my system to see if I can recreate the problem under Linux. I've just done a test and .osgt with dos line endings works fine under Linux. I ran the same test on OS X and it works fine here as well (line endings don't make a difference). /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Robert, I can have a go at debugging this if you have no ideas. Clearly changing all the files in OSG-Data to have Windows line endings is not a solution. OK, debugging into this, it gets into InputStream::readObjectFields() (src/osgDB/InputStream.cpp line 632 on trunk). Here as I understand it, it's supposed to read the data for each type in the object's class hierarchy. It reads the Object part, then the Node part, and when it gets to the Group part (which has only the Children field to read) it fails (in UserSerializer::read() - include/osgDB/Serializer line 162). if ( !is.matchString(_name) ) return true; (here _name is Children). Going into matchString, which is this: std::string s; readString(s); // ... After readString(s), s is 1, which means that the Children string had already been consumed somewhere. Starting over, it seems that the Children gets consumed when it tries to deserialize UserDataContainer (the last field of osg::Object to be deserialized). This doesn't match, so it should go back in the stream, but it doesn't because from then on when reading osg::Node's properties, it always gets the 1. I don't quite know how to debug this further... Any hints? J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Robert, Thanks for the testing. It confirms that it isn't a problem specific problem to Martin's system, and show's that we all haven't done enough testing of all the different combinations of usage of the new serializers. Yeah, well this is the first time I've tried using .osgt files someone else created, before I was the one creating them and using them so as we saw that use case worked fine. I agree it's something we should have tested before, sorry for that. I'm glad this has now been spotted, unfortunately Rui is likely to have headed off to be so we'll probably need to track down the line ending issues ourselves. See my other message. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Displaying depth buffer
Hi, I would like to render the depth buffer of my scene instead of the color buffer. I would also like to be able to save the depth buffer and the colorbuffer to a file (i.e. bmp or jpg or whatever). How can I do this? Cheers, aaron -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40922#40922 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi J-S, Thanks for looking into this issue. I will need to dig into the code itself to have a go at understanding it so can't yet provide any suggestions, the difference in behaviour between Windows and Unices seems to be the key, so I'd suspect there is something probably happening when reading from the stream that one system end of tokens/lines are picked up and the other system these aren't. Unfortunately I have to head offline for half an hour as I have children to look after and they are icing a birthday that needs some adult assistance, ahhh the joys of juggling work and family :-) Robert. On Mon, Jun 27, 2011 at 3:01 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Robert, I can have a go at debugging this if you have no ideas. Clearly changing all the files in OSG-Data to have Windows line endings is not a solution. OK, debugging into this, it gets into InputStream::readObjectFields() (src/osgDB/InputStream.cpp line 632 on trunk). Here as I understand it, it's supposed to read the data for each type in the object's class hierarchy. It reads the Object part, then the Node part, and when it gets to the Group part (which has only the Children field to read) it fails (in UserSerializer::read() - include/osgDB/Serializer line 162). if ( !is.matchString(_name) ) return true; (here _name is Children). Going into matchString, which is this: std::string s; readString(s); // ... After readString(s), s is 1, which means that the Children string had already been consumed somewhere. Starting over, it seems that the Children gets consumed when it tries to deserialize UserDataContainer (the last field of osg::Object to be deserialized). This doesn't match, so it should go back in the stream, but it doesn't because from then on when reading osg::Node's properties, it always gets the 1. I don't quite know how to debug this further... Any hints? J-S -- __ Jean-Sebastien Guay jean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] unable to save render-to-texture image
Hi loveRiceee Did you manage to get this working? Aaron loveRiceee wrote: Hi,all I was trying to save a render-to-texture image file many ways, however, failed each time. when i attach texture to camera.it works fine. but i attach image to camera. it doesn't work right. I saved the image data to .jpg, .png, .bmp format . but when i double-click the saved image file, there's nothing but blank.and when i tried do the same thing in the osg example osgprerender, the problem was still that. i use osgDB::writeImageFile(*image, d:\\data\\test.bmp); why? Is there someone met this problem? How did you fix it? Code: osg::ref_ptrosg::Texture2D colorMap = new osg::Texture2D; colorMap-setTextureSize(width, height); colorMap-setInternalFormat(GL_RGBA); colorMap-setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR); colorMap-setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR); osg::ref_ptrosg::Texture2D depthMap = new osg::Texture2D; depthMap-setTextureSize(width,height); depthMap-setInternalFormat(GL_DEPTH_COMPONENT); depthMap-setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::LINEAR); depthMap-setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::LINEAR); osg::ref_ptrosg::Camera camera = new osg::Camera; camera-setClearColor(osg::Vec4(1.0f, 1.0f, 1.0f, 1.0f)); camera-setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); camera-setReferenceFrame(osg::Transform::RELATIVE_RF); camera-setProjectionMatrixAsFrustum(-proj_right, proj_right, -proj_top, proj_top, znear, zfar); //camera-setReferenceFrame(osg::Transform::ABSOLUTE_RF); camera-setProjectionMatrix(osg::Matrixd::identity()); camera-setViewMatrixAsLookAt(bs.center()-osg::Vec3(0.0f,2.0f,0.0f)*bs.radius(),bs.center(),osg::Vec3(0.0f,0.0f,1.0f)); camera-setViewMatrix(osg::Matrixd::identity()); camera-setViewport(0, 0, width, height); camera-setRenderOrder(osg::Camera::PRE_RENDER); camera-setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT); camera-attach(osg::Camera::DEPTH_BUFFER, depthMap); camera-attach(osg::Camera::COLOR_BUFFER, colorMap); osg::ref_ptrosg::Image image = new osg::Image; image-allocateImage(width, height, 1, GL_RGBA, GL_FLOAT); image-setInternalTextureFormat(GL_RGBA); camera-attach(osg::Camera::COLOR_BUFFER, image.get()); osg::ref_ptrosg::Geode geo = createCube(colorMap, depthMap); camera-addChild(modelNode.get()); osg::ref_ptrosg::Group parent = new osg::Group; parent-addChild(geo.get()); parent-addChild(camera.get()); osgDB::writeImageFile(*image, test.bmp); //colorMap-setImage(0, image); return parent.get(); ... Thank you! Cheers, sun -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40925#40925 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Animation Embedded in an Object
Hi, I've been looking at this without any progress. Any ideas on how to debug this from my application or is there a way to ensure that the animation gets advanced? Thank you! Cheers, John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40926#40926 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi All, Cheers all for looking into it, glad it was not my system... Let me know if I can be of anymore assistance on the matter. The good news is I have not found anything else that is causing me issues under VS2008x64 and Windows 7 x64, with Nvidia 480gtx and latest drivers. Robert -Enjoy the holiday and icing, I suspect you have had enough of Ice in Scotland ;) Cheers Martin -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Robert Osfield Sent: 27 June 2011 15:10 To: OpenSceneGraph Users Subject: Re: [osg-users] problem with openscenegraph-data? Hi J-S, Thanks for looking into this issue. I will need to dig into the code itself to have a go at understanding it so can't yet provide any suggestions, the difference in behaviour between Windows and Unices seems to be the key, so I'd suspect there is something probably happening when reading from the stream that one system end of tokens/lines are picked up and the other system these aren't. Unfortunately I have to head offline for half an hour as I have children to look after and they are icing a birthday that needs some adult assistance, ahhh the joys of juggling work and family :-) Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] strange exception
well, i install OSG like say in this page: http://dwightdesign.com/2009/05/installing-openscenegraph-280/ a friend that install OSG with this metod can run the proyect, i instal OSG same way but mark the error mentioned above -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40928#40928 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] weird problem with Intel GMAs
Hi all, I am experiencing a weird problem with a custom osg-project (osg 2.9.x) on windows xp and an Intel GMA 965 (I know, the intel-driver are crappy as hell, but unfortunately I have to stick with them) My scene consists basically of a textured quad, playing a video via a TextureSubloadCallback. All works fine on OS X and other windows boxes. On the intel-box the performance is really bad (about 3-4 fps) If i switch the stats on, the performce restores back to normal: 60fps. If I cycle through the various stat-modes performance is good, but as soon as the stats are disabled, the performance is back to 3-4fps. Any idea? thanks in advance, Stephan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] weird problem with Intel GMAs
HI Stephan, I don't have any idea what might be up with the driver, it's rather counter-intuitive that doing the on screen stats would improve things. My own suggestion would be to add a final draw callback to the viewer's Camera that calls glFlush or glFinish to see if either of these has an effect. This might provide you a bit more feel for the nature of the driver bug. Robert. On Mon, Jun 27, 2011 at 4:40 PM, Stephan Maximilian Huber ratzf...@digitalmind.de wrote: Hi all, I am experiencing a weird problem with a custom osg-project (osg 2.9.x) on windows xp and an Intel GMA 965 (I know, the intel-driver are crappy as hell, but unfortunately I have to stick with them) My scene consists basically of a textured quad, playing a video via a TextureSubloadCallback. All works fine on OS X and other windows boxes. On the intel-box the performance is really bad (about 3-4 fps) If i switch the stats on, the performce restores back to normal: 60fps. If I cycle through the various stat-modes performance is good, but as soon as the stats are disabled, the performance is back to 3-4fps. Any idea? thanks in advance, 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] problem with openscenegraph-data?
Hi J-S, I'm back online once more. Have you looked into this topic any further? Unfortunately as I don't have a Windows box at it's a window specific problem I'm rather stuck in debugging it. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] render depth buffer to image for one time
SOLUTION For anyone who struggled with this here is my solution. I really have no idea how correct it is but it works for me Code: //Setup of the viewer and scenedata here osg::ref_ptrosg::Camera osgCam = viewer.getCamera(); osg::ref_ptrosg::Image colorImage= new osg::Image; osg::ref_ptrosg::Image zImage = new osg::Image; colorImage-allocateImage(1024, 768, 1, GL_RGBA, GL_UNSIGNED_BYTE); zImage-allocateImage(1024, 768, 1, GL_DEPTH_COMPONENT , GL_UNSIGNED_BYTE); osgCam-attach(osg::Camera::COLOR_BUFFER, colorImage.get()); osgCam-attach(osg::Camera::DEPTH_BUFFER, zImage.get()); /* */ viewer.frame(); Sleep(100); osgDB::writeImageFile(*colorImage.get(),color.bmp); osgDB::writeImageFile(*zImage.get(),depth.bmp); Cheers, aaron -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40935#40935 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Window dev's, I'm currently investigation the problem under Windows with the unix line endings, which is a bit awkward as I only have a Linux system so can't test it directly... So will need Windows users to test stuff out for me. One thing I'd like to test is whether the addition of the new UserDataContainer causes a problem, the check for this new data structure is only added to .osgt files that are tagged later than so version 76. This version is listed in the first few lines of a .osgt file, so in the cow.osgt you'll see the so version number listed under the #Version line: #Ascii Scene #Version 78 #Generator OpenSceneGraph 2.9.17 Could copy the cow.osgt to cow_76.osgt and then you ammend this files so the top few lines read read #Ascii Scene #Version 76 #Generator OpenSceneGraph 2.9.17 And then attempt to run : osgviewer cow_76.osgt Ohh, you'll need to make sure that the line endings don't change with the editing. If you have problem with this I can post you a modified file. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] weird problem with Intel GMAs
Hi Robert, thanks for your suggestion. Meanwhile I found a hack to fix my problem: I added some GL_ALPHA-textured quads to the scene with alpha 0 (mimicing osgText). Don't ask me why. thanks again, Stephan Am 27.06.11 17:52, schrieb Robert Osfield: HI Stephan, I don't have any idea what might be up with the driver, it's rather counter-intuitive that doing the on screen stats would improve things. My own suggestion would be to add a final draw callback to the viewer's Camera that calls glFlush or glFinish to see if either of these has an effect. This might provide you a bit more feel for the nature of the driver bug. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] weird problem with Intel GMAs
On 6/27/2011 10:47 AM, Stephan Maximilian Huber wrote: Hi Robert, thanks for your suggestion. Meanwhile I found a hack to fix my problem: I added some GL_ALPHA-textured quads to the scene with alpha 0 (mimicing osgText). Don't ask me why. I don't have an answer, but I wonder if gDebugger might give you any insight? -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Digital Imaging. OpenGL. Scene Graphs. GIS. GPS. Training. Consulting. Contracting. There is no Truth. There is only Perception. To Perceive is to Exist. - Xen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Robert, I'm back online once more. Have you looked into this topic any further? Unfortunately as I don't have a Windows box at it's a window specific problem I'm rather stuck in debugging it. Looking at it some more, the problem seems to be here: virtual bool matchString( const std::string str ) { std::string s; readString(s); // (1) if ( s==str ) return true; // (2) else _in-seekg( -(int)(s.length()), std::ios::cur ); // (3) return false; } (src/osgPlugins/osg/AsciiStreamOperator.h line 277 in trunk) str is UserDataContainer. readString(s) reads Children, without quotes of course, which is the next item in the string. (1) Then, since the (s==str) test fails (2), it's supposed to seek back by 8 characters (3). The call to seekg does give -8 as parameter, but for some reason the call seems to not do anything, though it doesn't return an error either... Oh, I think I've just found the problem, and it's definitely weird if it's that. It seems that when seeking back by 8 characters, the _fseek() function (which seekg eventually calls) converts the relative position of -8 to an absolute one. For that, it must know the current position in the file, so it calls _ftell. It looks like it counts line endings as \r\n when counting the characters, even if they are only \n in the actual file. So the position it seeks back to is 148 - 8 = 140. Notice that the Children line is the 9th line of the file, so there are exactly 8 extra \r characters counted (by pure coincidence), and the length of Children is also 8, so when seeking back to before Children it actually seeks to right after it. I don't know how to fix this. It seems to me like the _ftell function is broken, it should count exactly what is in the file and not add extra characters that aren't there. I guess setting the file to binary mode, and then manually replacing all \r\n by \n, and then reading files as on Linux on all platforms would work. Or, on Windows, we could read the whole file in binary mode, replace \n with \r\n, and then use that in a stringstream to be read from by the .osgt plugin. But that sounds like a lot of work for something that should work automatically. Did we ever have a similar problem for the other .osg plugin? J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Robert, Could copy the cow.osgt to cow_76.osgt and then you ammend this files so the top few lines read read #Ascii Scene #Version 76 #Generator OpenSceneGraph 2.9.17 And then attempt to run : osgviewer cow_76.osgt This didn't make any difference. The result is the same, only the top Group is read because it can't read the Children tag. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi J-S, Thanks for digging into the problem. I find it difficult to believe that tell, seek istream implementations are broken. It might be worth putting a tellg before and after the seek to see what values it's using. As for moving to binary mode, this is possible, nor sure of the fallout though, but it terms of making sure we get the same results across all platforms it might well be the best thing to do. Off hand I don't know how much of a fallout this would have. As for the .osg plugin, I deliberately avoiding using seek and instead implemented caching of strings within the FieldReaderIterator to hide the fact that we'd read data in but then not use it directly. Potentially would could do something similar with InputStream, but again I'm not sure how much of a impact this might have. Robert. On Mon, Jun 27, 2011 at 6:46 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Hi Robert, I'm back online once more. Have you looked into this topic any further? Unfortunately as I don't have a Windows box at it's a window specific problem I'm rather stuck in debugging it. Looking at it some more, the problem seems to be here: virtual bool matchString( const std::string str ) { std::string s; readString(s); // (1) if ( s==str ) return true; // (2) else _in-seekg( -(int)(s.length()), std::ios::cur ); // (3) return false; } (src/osgPlugins/osg/AsciiStreamOperator.h line 277 in trunk) str is UserDataContainer. readString(s) reads Children, without quotes of course, which is the next item in the string. (1) Then, since the (s==str) test fails (2), it's supposed to seek back by 8 characters (3). The call to seekg does give -8 as parameter, but for some reason the call seems to not do anything, though it doesn't return an error either... Oh, I think I've just found the problem, and it's definitely weird if it's that. It seems that when seeking back by 8 characters, the _fseek() function (which seekg eventually calls) converts the relative position of -8 to an absolute one. For that, it must know the current position in the file, so it calls _ftell. It looks like it counts line endings as \r\n when counting the characters, even if they are only \n in the actual file. So the position it seeks back to is 148 - 8 = 140. Notice that the Children line is the 9th line of the file, so there are exactly 8 extra \r characters counted (by pure coincidence), and the length of Children is also 8, so when seeking back to before Children it actually seeks to right after it. I don't know how to fix this. It seems to me like the _ftell function is broken, it should count exactly what is in the file and not add extra characters that aren't there. I guess setting the file to binary mode, and then manually replacing all \r\n by \n, and then reading files as on Linux on all platforms would work. Or, on Windows, we could read the whole file in binary mode, replace \n with \r\n, and then use that in a stringstream to be read from by the .osgt plugin. But that sounds like a lot of work for something that should work automatically. Did we ever have a similar problem for the other .osg plugin? J-S -- __ Jean-Sebastien Guay jean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi J-S and all other Window dev's I have just re-implemented the possibly offending matchString method with a seekp that uses absolute positions. The code looks like - the #if 0 is the original implementation, and the #else implementation is my new version based on absolute file positions. The full modified OpenSceneGraph/src/osgPlugins/osg/AsiiStreamOperator.h is attached. Robert. #if 0 virtual bool matchString( const std::string str ) { std::string s; readString(s); if ( s==str ) return true; else _in-seekg( -(int)(s.length()), std::ios::cur ); return false; } #else virtual bool matchString( const std::string str ) { // record position before read to fallback on if match doesn't succeed. std::streampos filePos = _in-tellg(); std::string s; readString(s); if ( s==str ) return true; else { _in-seekg( filePos, std::ios::beg ); } return false; } #endif I have tested this under Linux and it works fine. I have no clue to how things will work out under Windows. Fingers crossed. Robert. #ifndef OSGDB_ASCIISTREAMOPERATOR #define OSGDB_ASCIISTREAMOPERATOR #include ostream #include osgDB/StreamOperator class AsciiOutputIterator : public osgDB::OutputIterator { public: AsciiOutputIterator( std::ostream* ostream ) : _readyForIndent(false), _indent(0) { _out = ostream; } virtual ~AsciiOutputIterator() {} virtual bool isBinary() const { return false; } virtual void writeBool( bool b ) { indentIfRequired(); if ( b ) *_out TRUE ; else *_out FALSE ; } virtual void writeChar( char c ) { indentIfRequired(); *_out (short)c ' '; } virtual void writeUChar( unsigned char c ) { indentIfRequired(); *_out (unsigned short)c ' '; } virtual void writeShort( short s ) { indentIfRequired(); *_out s ' '; } virtual void writeUShort( unsigned short s ) { indentIfRequired(); *_out s ' '; } virtual void writeInt( int i ) { indentIfRequired(); *_out i ' '; } virtual void writeUInt( unsigned int i ) { indentIfRequired(); *_out i ' '; } virtual void writeLong( long l ) { indentIfRequired(); *_out l ' '; } virtual void writeULong( unsigned long l ) { indentIfRequired(); *_out l ' '; } virtual void writeFloat( float f ) { indentIfRequired(); *_out f ' '; } virtual void writeDouble( double d ) { indentIfRequired(); *_out d ' '; } virtual void writeString( const std::string s ) { indentIfRequired(); *_out s ' '; } virtual void writeStream( std::ostream (*fn)(std::ostream) ) { indentIfRequired(); *_out fn; if ( isEndl( fn ) ) { _readyForIndent = true; } } virtual void writeBase( std::ios_base (*fn)(std::ios_base) ) { indentIfRequired(); *_out fn; } virtual void writeGLenum( const osgDB::ObjectGLenum value ) { GLenum e = value.get(); const std::string enumString = osgDB::Registry::instance()-getObjectWrapperManager()-getString(GL, e); indentIfRequired(); *_out enumString ' '; } virtual void writeProperty( const osgDB::ObjectProperty prop ) { std::string enumString = prop._name; if ( prop._mapProperty ) { enumString = osgDB::Registry::instance()-getObjectWrapperManager()-getString(prop._name, prop._value); } indentIfRequired(); *_out enumString ' '; } virtual void writeMark( const osgDB::ObjectMark mark ) { _indent += mark._indentDelta; indentIfRequired(); *_out mark._name; } virtual void writeCharArray( const char* s, unsigned int size ) {} virtual void writeWrappedString( const std::string str ) { std::string wrappedStr; unsigned int size = str.size(); for ( unsigned int i=0; isize; ++i ) { char ch = str[i]; if ( ch=='\' ) wrappedStr += '\\'; else if ( ch=='\\' ) wrappedStr += '\\'; wrappedStr += ch; } wrappedStr.insert( std::string::size_type(0), 1, '\' ); wrappedStr += '\'; indentIfRequired(); writeString( wrappedStr ); } protected: inline void indentIfRequired() { if ( _readyForIndent ) { for (int i=0; i_indent; ++i) *_out ' '; _readyForIndent = false; } } bool _readyForIndent; int _indent; }; class AsciiInputIterator : public osgDB::InputIterator { public: AsciiInputIterator( std::istream* istream ) { _in = istream; } virtual ~AsciiInputIterator() {} virtual bool isBinary() const { return false; } virtual void readBool( bool b ) { std::string boolString;
Re: [osg-users] problem with openscenegraph-data?
Hi Robert, Thanks for digging into the problem. I find it difficult to believe that tell, seek istream implementations are broken. It might be worth putting a tellg before and after the seek to see what values it's using. I did this: virtual bool matchString( const std::string str ) { std::string s; readString(s); if ( s==str ) return true; else { std::istream::pos_type pos_before = _in-tellg(); _in-seekg( -(int)(s.length()), std::ios::cur ); std::istream::pos_type pos_after = _in-tellg(); } return false; } What I get is pos_before = 148, pos_after = 140. However, next time matchString is called, the value of s is 1 instead of Children, so it obviously didn't succeed... Changing the function to: virtual bool matchString( const std::string str ) { std::string s; readString(s); if ( s==str ) return true; else { std::istream::pos_type pos_before = _in-tellg(); for (unsigned int i = 0; i s.length(); ++i) _in-unget(); std::istream::pos_type pos_after = _in-tellg(); } return false; } (so instead of seeking back by 8 characters, we call unget() 8 times) This works, i.e. the next time matchString is called the value of s is Children, and the cow is read correctly. What's weird is that I kept the two tellg() calls, and they still return the same values (pos_before = 148 and pos_after = 140). There seems to be some inconsistency between how seekg and tellg work (or the underlying functions they eventually call to do their work). So unless someone finds a better solution, I suggest changing matchString from this: virtual bool matchString( const std::string str ) { std::string s; readString(s); if ( s==str ) return true; else _in-seekg( -(int)(s.length()), std::ios::cur ); return false; } to this: virtual bool matchString( const std::string str ) { std::string s; readString(s); if ( s==str ) return true; else { for (unsigned int i = 0; i s.length(); ++i) _in-unget(); } return false; } Or you can obfuscate it by removing newlines if you want :-) It's really sad we need to avoid seekg for one particular platform (and I wonder if VC++ 2010 fixes this... I'm on 2008). As for moving to binary mode, this is possible, nor sure of the fallout though, but it terms of making sure we get the same results across all platforms it might well be the best thing to do. Off hand I don't know how much of a fallout this would have. As for the .osg plugin, I deliberately avoiding using seek and instead implemented caching of strings within the FieldReaderIterator to hide the fact that we'd read data in but then not use it directly. Potentially would could do something similar with InputStream, but again I'm not sure how much of a impact this might have. For these two possible solutions I'll defer to you or others who might know about how stream i/o works on multiple platforms. I'm generally just a user of these things and hack at them until they work, I'm not well placed to say what will work and what the consequences will be... J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Robert, _in-seekg( filePos, std::ios::beg ); Still doesn't work for me, same effect... See my other message, and in particular the fact that the tellg() calls returned the same values in both the working and non-working cases makes me think this is not reliable, so even seeking with an absolute position does not work since this position comes from tellg()... _ftell() which is called from tellg() seems to be the source of the problem, and my solution in the other message doesn't use this. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph-3.0.0-rc6 tagged
Hi Robert, rc6 builds fine in release mode on Debian Tesing x86_64, g++ 4.6. Running osgviewer with the .osgt examples that you mentioned also works ok. Greetings Stephan On 27.06.2011 14:43, Robert Osfield wrote: Hi All, Any more feedback on the OSG-3.0 branch or OSG-3.0.0-rc6?? I'm ready to tag the release now. All I need to do is type make tag-run and then update the website... but first I'd like to see some more feedback on how things are looking. I'm particularily keen to get feedback from Windows users and whether the new serializers are work OK for you, for background see see the today's thread openscenegraph-data?. Could you please test the new OpenSceneGraph-Data in svn/trunk or the new OpenSceneGraph-Data.3.0.0.zip that I uploaded this morning. The data is now linked from. http://www.openscenegraph.org/projects/osg/wiki/Downloads/SampleDatasets To test run: osgviewer cow.osgt osgviewer osgcool.osgt osgviewer cessnafire.osgt osgvewier glsl_mandelbrot.osgt I haven't seen any reports of problems with the new serializers other than one with handling invalid numerical values that I came across, Wang Rui's already addressed this problem, so until Martin's post this morning it looked like everything was working well. It could be that Martin's build or runtime has gone wrong for some reason, or it could be that this is a platform specific bug. I'd like to work out which of these two it is so I can make a judgement call on whether it's safe to tag 3.0.0. Thanks for you help, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi J-S, On Mon, Jun 27, 2011 at 7:34 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Still doesn't work for me, same effect... See my other message, and in particular the fact that the tellg() calls returned the same values in both the working and non-working cases makes me think this is not reliable, so even seeking with an absolute position does not work since this position comes from tellg()... _ftell() which is called from tellg() seems to be the source of the problem, and my solution in the other message doesn't use this. Argghghg unget it is. Could you send me the whole modified file and I'll merge it with svn/trunk, do some testing and if it looks OK check it into the OSG-3.0 branch for the release. Cheers, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] problem with openscenegraph-data?
Hi Robert, Argghghg unget it is. Could you send me the whole modified file and I'll merge it with svn/trunk, do some testing and if it looks OK check it into the OSG-3.0 branch for the release. Argghghg is exactly the term I would use to describe this situation ;-) Here is the file (src/osgPlugins/osg/AsciiStreamOperator.h), and you might want to put a descriptive comment so people know why this was done... After all, my instinct would be to replace a loop with a single function call too... J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ #ifndef OSGDB_ASCIISTREAMOPERATOR #define OSGDB_ASCIISTREAMOPERATOR #include ostream #include osgDB/StreamOperator class AsciiOutputIterator : public osgDB::OutputIterator { public: AsciiOutputIterator( std::ostream* ostream ) : _readyForIndent(false), _indent(0) { _out = ostream; } virtual ~AsciiOutputIterator() {} virtual bool isBinary() const { return false; } virtual void writeBool( bool b ) { indentIfRequired(); if ( b ) *_out TRUE ; else *_out FALSE ; } virtual void writeChar( char c ) { indentIfRequired(); *_out (short)c ' '; } virtual void writeUChar( unsigned char c ) { indentIfRequired(); *_out (unsigned short)c ' '; } virtual void writeShort( short s ) { indentIfRequired(); *_out s ' '; } virtual void writeUShort( unsigned short s ) { indentIfRequired(); *_out s ' '; } virtual void writeInt( int i ) { indentIfRequired(); *_out i ' '; } virtual void writeUInt( unsigned int i ) { indentIfRequired(); *_out i ' '; } virtual void writeLong( long l ) { indentIfRequired(); *_out l ' '; } virtual void writeULong( unsigned long l ) { indentIfRequired(); *_out l ' '; } virtual void writeFloat( float f ) { indentIfRequired(); *_out f ' '; } virtual void writeDouble( double d ) { indentIfRequired(); *_out d ' '; } virtual void writeString( const std::string s ) { indentIfRequired(); *_out s ' '; } virtual void writeStream( std::ostream (*fn)(std::ostream) ) { indentIfRequired(); *_out fn; if ( isEndl( fn ) ) { _readyForIndent = true; } } virtual void writeBase( std::ios_base (*fn)(std::ios_base) ) { indentIfRequired(); *_out fn; } virtual void writeGLenum( const osgDB::ObjectGLenum value ) { GLenum e = value.get(); const std::string enumString = osgDB::Registry::instance()-getObjectWrapperManager()-getString(GL, e); indentIfRequired(); *_out enumString ' '; } virtual void writeProperty( const osgDB::ObjectProperty prop ) { std::string enumString = prop._name; if ( prop._mapProperty ) { enumString = osgDB::Registry::instance()-getObjectWrapperManager()-getString(prop._name, prop._value); } indentIfRequired(); *_out enumString ' '; } virtual void writeMark( const osgDB::ObjectMark mark ) { _indent += mark._indentDelta; indentIfRequired(); *_out mark._name; } virtual void writeCharArray( const char* s, unsigned int size ) {} virtual void writeWrappedString( const std::string str ) { std::string wrappedStr; unsigned int size = str.size(); for ( unsigned int i=0; isize; ++i ) { char ch = str[i]; if ( ch=='\' ) wrappedStr += '\\'; else if ( ch=='\\' ) wrappedStr += '\\'; wrappedStr += ch; } wrappedStr.insert( std::string::size_type(0), 1, '\' ); wrappedStr += '\'; indentIfRequired(); writeString( wrappedStr ); } protected: inline void indentIfRequired() { if ( _readyForIndent ) { for (int i=0; i_indent; ++i) *_out ' '; _readyForIndent = false; } } bool _readyForIndent; int _indent; }; class AsciiInputIterator : public osgDB::InputIterator { public: AsciiInputIterator( std::istream* istream ) { _in = istream; } virtual ~AsciiInputIterator() {} virtual bool isBinary() const { return false; } virtual void readBool( bool b ) { std::string boolString; *_in boolString; if ( boolString==TRUE ) b = true; else b = false; } virtual void readChar( char c ) { short s = 0; *_in s; c = (char)s; } virtual void readSChar( signed char c ) { short s = 0; *_in s; c = (signed char)s; } virtual void readUChar( unsigned char c ) {
Re: [osg-users] OpenSceneGraph-3.0.0-rc6 tagged
Hi Robert, OSG3.0 RC6 works find in 32 bit and 64 bit on Win x64, MSVC 9.0 (2008) Sp1 , BUT... the osgt models of OpenSceneGraph-Data-3.0.0 do not work, only empty viewer ist shown. Cheers, Torben -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40948#40948 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] render depth buffer to image for one time
Hi, Aaron If you set singlethreaded mode and stop threading on viewer you can skip Sleep() step. Used same thing couple of times :) Cheers, Sergey. 27.06.2011, 20:11, aaron wetzler aaronwetz...@gmail.com: SOLUTION For anyone who struggled with this here is my solution. I really have no idea how correct it is but it works for me Code: //Setup of the viewer and scenedata here osg::ref_ptrosg::Camera osgCam = viewer.getCamera(); osg::ref_ptrosg::Image colorImage= new osg::Image; osg::ref_ptrosg::Image zImage = new osg::Image; colorImage-allocateImage(1024, 768, 1, GL_RGBA, GL_UNSIGNED_BYTE); zImage-allocateImage(1024, 768, 1, GL_DEPTH_COMPONENT , GL_UNSIGNED_BYTE); osgCam-attach(osg::Camera::COLOR_BUFFER, colorImage.get()); osgCam-attach(osg::Camera::DEPTH_BUFFER, zImage.get()); /* */ viewer.frame(); Sleep(100); osgDB::writeImageFile(*colorImage.get(),color.bmp); osgDB::writeImageFile(*zImage.get(),depth.bmp); Cheers, aaron -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40935#40935 ___ 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] render depth buffer to image for one time
Hi Aaron, Is there any reason why an osg::Camera FinalDrawCallback wouldn't work fine for handling the writes when required? This would work fine for multi-threaded usage and any length of time the the rendering would take. Robert. On Mon, Jun 27, 2011 at 5:11 PM, aaron wetzler aaronwetz...@gmail.com wrote: SOLUTION For anyone who struggled with this here is my solution. I really have no idea how correct it is but it works for me Code: //Setup of the viewer and scenedata here osg::ref_ptrosg::Camera osgCam = viewer.getCamera(); osg::ref_ptrosg::Image colorImage= new osg::Image; osg::ref_ptrosg::Image zImage = new osg::Image; colorImage-allocateImage(1024, 768, 1, GL_RGBA, GL_UNSIGNED_BYTE); zImage-allocateImage(1024, 768, 1, GL_DEPTH_COMPONENT , GL_UNSIGNED_BYTE); osgCam-attach(osg::Camera::COLOR_BUFFER, colorImage.get()); osgCam-attach(osg::Camera::DEPTH_BUFFER, zImage.get()); /* */ viewer.frame(); Sleep(100); osgDB::writeImageFile(*colorImage.get(),color.bmp); osgDB::writeImageFile(*zImage.get(),depth.bmp); Cheers, aaron -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40935#40935 ___ 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] Animation Embedded in an Object
Hi, John By default calling viewer::frame updates simulation time. My best bet in this situation is that update traversal dont get to animation path callback on your model. Check nodepath from your model to scene root, and check all update callbacks on nodes in path, they must call traverse(osg::Node*, osg::NodeVisitor*) inside operator()(osg::Node*, osg::NodeVisitor*) to continue traversal on graph downwards. You can derive your own animation path callback and change default with yours, and add debug output there in operator()(...) of your callback to check if it ever called. Cheers, Sergey. 27.06.2011, 18:32, John Farrier john.farr...@gmail.com: Hi, I've been looking at this without any progress. Any ideas on how to debug this from my application or is there a way to ensure that the animation gets advanced? Thank you! Cheers, John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40926#40926 ___ 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 openscenegraph-data?
Hi J-S, On Mon, Jun 27, 2011 at 8:29 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Here is the file (src/osgPlugins/osg/AsciiStreamOperator.h), and you might want to put a descriptive comment so people know why this was done... After all, my instinct would be to replace a loop with a single function call too... Many thanks for the fix, finally back on trackalbeit rather later in the evening than I had planned. The comment of explanation I went for was: virtual bool matchString( const std::string str ) { std::string s; readString(s); if ( s==str ) return true; else { // originally _in-seekg( -(int)(s.length()), std::ios::cur ); was used below but // problems under windows occurred when reading ascii files with unix line endings. // The workaround for this problem was to unget each of the characters in term, // hacky yes, but at least it works! for (unsigned int i = 0; i s.length(); ++i) _in-unget(); } return false; } Let me know if it doesn't make sense. I've now merged this change with svn/trunk and the OSG-3.0 branch. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OpenSceneGraph-3.0.0-rc6 tagged
Hi Torben, On Mon, Jun 27, 2011 at 8:40 PM, Torben Dannhauer tor...@dannhauer.info wrote: OSG3.0 RC6 works find in 32 bit and 64 bit on Win x64, MSVC 9.0 (2008) Sp1 , BUT... the osgt models of OpenSceneGraph-Data-3.0.0 do not work, only empty viewer ist shown. The .osgt issue was picked up earlier today and turned out to be a bug with the windows implementation of seekg when handling ascii files with unix line endings, The workaround for this was to use unget to rewind the stream rather than seekg. The attached src/osgPlugins/osg/AsciiStreamOperator.h will address this issue. Robert. #ifndef OSGDB_ASCIISTREAMOPERATOR #define OSGDB_ASCIISTREAMOPERATOR #include ostream #include osgDB/StreamOperator class AsciiOutputIterator : public osgDB::OutputIterator { public: AsciiOutputIterator( std::ostream* ostream ) : _readyForIndent(false), _indent(0) { _out = ostream; } virtual ~AsciiOutputIterator() {} virtual bool isBinary() const { return false; } virtual void writeBool( bool b ) { indentIfRequired(); if ( b ) *_out TRUE ; else *_out FALSE ; } virtual void writeChar( char c ) { indentIfRequired(); *_out (short)c ' '; } virtual void writeUChar( unsigned char c ) { indentIfRequired(); *_out (unsigned short)c ' '; } virtual void writeShort( short s ) { indentIfRequired(); *_out s ' '; } virtual void writeUShort( unsigned short s ) { indentIfRequired(); *_out s ' '; } virtual void writeInt( int i ) { indentIfRequired(); *_out i ' '; } virtual void writeUInt( unsigned int i ) { indentIfRequired(); *_out i ' '; } virtual void writeLong( long l ) { indentIfRequired(); *_out l ' '; } virtual void writeULong( unsigned long l ) { indentIfRequired(); *_out l ' '; } virtual void writeFloat( float f ) { indentIfRequired(); *_out f ' '; } virtual void writeDouble( double d ) { indentIfRequired(); *_out d ' '; } virtual void writeString( const std::string s ) { indentIfRequired(); *_out s ' '; } virtual void writeStream( std::ostream (*fn)(std::ostream) ) { indentIfRequired(); *_out fn; if ( isEndl( fn ) ) { _readyForIndent = true; } } virtual void writeBase( std::ios_base (*fn)(std::ios_base) ) { indentIfRequired(); *_out fn; } virtual void writeGLenum( const osgDB::ObjectGLenum value ) { GLenum e = value.get(); const std::string enumString = osgDB::Registry::instance()-getObjectWrapperManager()-getString(GL, e); indentIfRequired(); *_out enumString ' '; } virtual void writeProperty( const osgDB::ObjectProperty prop ) { std::string enumString = prop._name; if ( prop._mapProperty ) { enumString = osgDB::Registry::instance()-getObjectWrapperManager()-getString(prop._name, prop._value); } indentIfRequired(); *_out enumString ' '; } virtual void writeMark( const osgDB::ObjectMark mark ) { _indent += mark._indentDelta; indentIfRequired(); *_out mark._name; } virtual void writeCharArray( const char* s, unsigned int size ) {} virtual void writeWrappedString( const std::string str ) { std::string wrappedStr; unsigned int size = str.size(); for ( unsigned int i=0; isize; ++i ) { char ch = str[i]; if ( ch=='\' ) wrappedStr += '\\'; else if ( ch=='\\' ) wrappedStr += '\\'; wrappedStr += ch; } wrappedStr.insert( std::string::size_type(0), 1, '\' ); wrappedStr += '\'; indentIfRequired(); writeString( wrappedStr ); } protected: inline void indentIfRequired() { if ( _readyForIndent ) { for (int i=0; i_indent; ++i) *_out ' '; _readyForIndent = false; } } bool _readyForIndent; int _indent; }; class AsciiInputIterator : public osgDB::InputIterator { public: AsciiInputIterator( std::istream* istream ) { _in = istream; } virtual ~AsciiInputIterator() {} virtual bool isBinary() const { return false; } virtual void readBool( bool b ) { std::string boolString; *_in boolString; if ( boolString==TRUE ) b = true; else b = false; } virtual void readChar( char c ) { short s = 0; *_in s; c = (char)s; } virtual void readSChar( signed char c ) { short s = 0; *_in s; c = (signed char)s; } virtual void readUChar( unsigned char c ) { short s = 0; *_in s; c = (unsigned char)s; } virtual void readShort( short s ) { std::string str;
Re: [osg-users] [build] OSG 3.1.0 SVN don't work for me
Hi, All This may be unrelated, because seen on other osg builds, but i've seen similar behavior on two machines under ubuntu with nvidia cards. In my case this was some kind of driver failure, in some conditions driver would just go crazy and throw errors or even segfaults (with proper gl usage, guaranteed ofc :), or just drawing black screens without any errors. Even after terminating app graphics driver still corrupted somehow, and system need to be restarted to go back to normal state. I think it is just unlucky driver and gl state usage combo. Changes in osg may have lead to revealing some rare driver bug or something. Try different drivers. Cheers, Sergey. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] render depth buffer to image for one time
Thanks hybr and robertosfield for your comments. Both useful and I will use those tips. Although my solution does work its not enough and Im now stuck on a couple of things. If you could point me in the right direction or to the right links that would be great 1)How do I render the depth image to the screen instead of rendering the color buffer? Whats the name of the function that lets me define which buffer I want rendered to the screen (or FBO for that matter) 2) I actually want to invert my depth image and edit its values. How do I do that before writing the image? 3) The dimensions I put in the allocateImage call i.e. (1024, 768) have no effect on the size of the written image. How can I change that? Looking forward to hearing from you Aaron -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40958#40958 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] OSGExp, movie textures and OSG file formats
Hi Alessandro, Both the .ive and .osgb formats support reading/writing images that are externally loaded so this is probably the best workaround. If you run: osgconv --format ive OR osgconv --format osgb You'll get a list of the options avaiable to pass in to the plugin to make them use external files for images. Robert. On Fri, Jun 24, 2011 at 8:06 PM, Alessandro Terenzi a.tere...@gmail.com wrote: I wonder if anybody else experienced my same problem: I wrote a visitor that looks for movie textures in order to play them, the input files come from 3dsMax via OSGExp v1.0.0, but I made it work only if I export to .osg, if I export to either .ive or .osgb the visitor fails to dynamic_cast any found Image to ImageStream so I cannot play those movie textures. I also noticed that if I export to .osgt then the Image's DataVariance is set to STATIC, even though the texture file type is avi, mov or others (so I have to change it to DYNAMIC otherwise they won't play) Does anyone have the same issues (especially those with the binary formats)? Is all this related to OSGExp only or am I supposed to look for movie texture in a different way than the way I use with .osg files? Thanks. Alessandro -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40884#40884 ___ 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] render depth buffer to image for one time
Hi, Aaron. 1) You can render scene depth to texture(using additional camera), then render screen aligned quad with this texture on screen. Or you can use osgPPU nodekit to do this, in this case you will need to make pipeline of two units: UnitDepthBufferBypass and UnitOut (iirc) 2) You have two options: first you can work with raw data in your image before writing (there are interfaces to pointer to raw data), second - you can preprocess it with shaders (again, using osgPPU (add one UnitInOut with correct shader between two mentioned earlier) or add shader that will process data when drawing screen aligned quad mentioned earlier) 3) iirc image will resize if it is not large enough to capture entire window(with framebuffer rendering) or viewport (with fbo rendering) so you may need to setup your window correctly or create camera that render to fbo with correct dimensions and use it for image capture. Cheers, Sergey. 28.06.2011, 01:55, aaron wetzler aaronwetz...@gmail.com: Thanks hybr and robertosfield for your comments. Both useful and I will use those tips. Although my solution does work its not enough and Im now stuck on a couple of things. If you could point me in the right direction or to the right links that would be great 1)How do I render the depth image to the screen instead of rendering the color buffer? Whats the name of the function that lets me define which buffer I want rendered to the screen (or FBO for that matter) 2) I actually want to invert my depth image and edit its values. How do I do that before writing the image? 3) The dimensions I put in the allocateImage call i.e. (1024, 768) have no effect on the size of the written image. How can I change that? Looking forward to hearing from you Aaron -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40958#40958 ___ 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 openscenegraph-data?
Hi, all, Sorry I'm late to the thread, but I can confirm that seeking doesn't work for files open in text mode in VC++. I ran into this with some of my software in the past. It's rather unbelievable, but it's true. The docs at msdn.microsoft.com confirm it (search for seekg and look at the remarks). The same is true for the fseek() function in C. JS's unget fix is probably the best workaround. --J Sent from my iPhone On Jun 27, 2011, at 11:38 PM, Robert Osfield robert.osfi...@gmail.com wrote: Hi J-S, On Mon, Jun 27, 2011 at 8:29 PM, Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com wrote: Here is the file (src/osgPlugins/osg/AsciiStreamOperator.h), and you might want to put a descriptive comment so people know why this was done... After all, my instinct would be to replace a loop with a single function call too... Many thanks for the fix, finally back on trackalbeit rather later in the evening than I had planned. The comment of explanation I went for was: virtual bool matchString( const std::string str ) { std::string s; readString(s); if ( s==str ) return true; else { // originally _in-seekg( -(int)(s.length()), std::ios::cur ); was used below but // problems under windows occurred when reading ascii files with unix line endings. // The workaround for this problem was to unget each of the characters in term, // hacky yes, but at least it works! for (unsigned int i = 0; i s.length(); ++i) _in-unget(); } return false; } Let me know if it doesn't make sense. I've now merged this change with svn/trunk and the OSG-3.0 branch. 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] problem with openscenegraph-data?
Hi Robert, Jason, Thanks for the checkin Robert, looks good though I would have been a bit less familiar in the comment but that's fine :-) Sorry I'm late to the thread, but I can confirm that seeking doesn't work for files open in text mode in VC++. I ran into this with some of my software in the past. It's rather unbelievable, but it's true. Yeah, really weird. At least we have a workaround, though I would have thought something that basic would work out of the box... Thanks for confirming! J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.dyndns-web.com/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Animation Embedded in an Object
[quote=hybr]check all update callbacks on nodes in path, they must call traverse(osg::Node*, osg::NodeVisitor*) inside operator()(osg::Node*, osg::NodeVisitor*) to continue traversal on graph downwards. [quote] That was the problem. One of my NodeCallback classes was not calling traverse. Thanks a lot! - John -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=40968#40968 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Please test OSG-3.0 branch or 3.0.0-rc7
Hi Robert, Compiles well with Windows XP and VisualStudio 8 SP1. The sample osgt files work render properly. Wang Rui 2011/6/28 Robert Osfield robert.osfi...@gmail.com: Hi All, The bug report of problems reading .osgt in the OpenSceneGraph-Data under Windows rather set us back a number of hours today, it's now pretty late here in Scotland, relistically too late to go for the release with such a last minute bug fix just checked in. Orignally I was planning to start travelling on my trip first thing tomorrow morning, but we've shifted our plans to go late morning, this will give me a small window in which I could tag the release and update the website. Releasing tomorrow morning will allow those still working the US today, and those in the lands east of Scotland to have a few hours to test the build and runtime in the morning before I get online to tag the release. In prep for tomorrow I've tagged 3.0.0-rc7: source package : http://www.openscenegraph.org/downloads/developer_releases/OpenSceneGraph-3.0.0-rc7.zip svn tag: svn co http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-3.0.0-rc7 OpenSceneGraph You can also test the OpenSceneGraph-3.0 branch and svn/trunk as both the 3.0 branch they are all pretty close to be indentical save for version numbers. Please let me know how your build and runtime testing goes. 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