Re: [osg-users] LWO loading problem
Robert Osfield a écrit : On Sat, Feb 7, 2009 at 6:10 PM, Frederic Bouvier wrote: I disabled optimisations in the release mode ( /Od ) and the model shows up as expected. This code beats the compiler :-( Is this another VS compiler bug then? Maybe. Someone reported success with VS2005 on the FG ml -Fred -- Frédéric Bouvier http://my.fotolia.com/frfoto/ Photo gallery http://fgsd.sourceforge.net/FlightGear Scenery Designer ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
Frederic Bouvier a écrit : Csaba Halász a écrit : On Fri, Feb 6, 2009 at 1:18 PM, Robert Osfield robert.osfi...@gmail.com wrote: Could you please try out the svn/trunk or OSG-2.8 branch to double check that the lwo plugin is now behaving itself. Hi Robert, Apparently both versions now load the model, thank you. There is only the original issue with multitexturing remaining, as reported by Marco in november. That mail thread seems to have died without ever receiving a reply from the author of the change causing the breakage (Bob) Well, apparently, the problem is only partly solved. Please compare the two images below : http://frbouvi.free.fr/flightsim/suv_debug.png displayed by osgViewerd compiled with MSVC 7.1 in Debug mode http://frbouvi.free.fr/flightsim/suv_release.png displayed by osgViewer compiled with MSVC 7.1 in Release mode The source is the 2.8 branch as of this morning ( clean download and rebuild ) It looks to me that some variables are not initialised. It is notorious that MSVC sets some local variables to 0 in debug mode and not in Release mode. The original model can be found here : http://www.marlinstudios.com/files/trafficfree/trafficfree.zip I disabled optimisations in the release mode ( /Od ) and the model shows up as expected. This code beats the compiler :-( -Fred -- Frédéric Bouvier http://my.fotolia.com/frfoto/ Photo gallery http://fgsd.sourceforge.net/FlightGear Scenery Designer ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
On Sat, Feb 7, 2009 at 6:10 PM, Frederic Bouvier fredlis...@free.fr wrote: I disabled optimisations in the release mode ( /Od ) and the model shows up as expected. This code beats the compiler :-( Is this another VS compiler bug then? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
On Thu, Feb 5, 2009 at 9:35 PM, Csaba Halász csaba.hal...@gmail.com wrote: On Thu, Feb 5, 2009 at 10:16 PM, Csaba Halász csaba.hal...@gmail.com wrote: Rev 9397 is the first non-working revision. Looks like a lot of int-long changes, which seems to agree with your 64 bit theory. Except it is broken on 32 bit too. LOL, it is one for Sukender's list :) for(int i=0; i4; ++i) { *dest_ptr = *src_ptr; } Can you spot the error? :) No pointer increments!! God what I dumbo I can be sometimes... Robert, ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
Hi Cesaba, I've now fixed the problem changeType4 function and hey presto I can load your .lwo without problems. This fix is now checked into svn trunk. Ironically the new code base with the changes from using long to unit actually loads the model, while the 2.7.7 code base didn't work on my 64bit machine. Could you please try out the svn/trunk or OSG-2.8 branch to double check that the lwo plugin is now behaving itself. Cheers, Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
On Fri, Feb 6, 2009 at 1:18 PM, Robert Osfield robert.osfi...@gmail.com wrote: Could you please try out the svn/trunk or OSG-2.8 branch to double check that the lwo plugin is now behaving itself. Hi Robert, Apparently both versions now load the model, thank you. There is only the original issue with multitexturing remaining, as reported by Marco in november. That mail thread seems to have died without ever receiving a reply from the author of the change causing the breakage (Bob). -- Csaba ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
Robert Osfield wrote: On Thu, Feb 5, 2009 at 9:35 PM, Csaba Halász csaba.hal...@gmail.com wrote: On Thu, Feb 5, 2009 at 10:16 PM, Csaba Halász csaba.hal...@gmail.com wrote: Rev 9397 is the first non-working revision. Looks like a lot of int-long changes, which seems to agree with your 64 bit theory. Except it is broken on 32 bit too. LOL, it is one for Sukender's list :) for(int i=0; i4; ++i) { *dest_ptr = *src_ptr; } Can you spot the error? :) No pointer increments!! God what I dumbo I can be sometimes... Robert, I wonder if there is a VS warning that would have found this... /me ducks for cover ;) -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
On Fri, Feb 6, 2009 at 7:47 PM, Paul Speed psp...@progeeks.com wrote: I wonder if there is a VS warning that would have found this... /me ducks for cover ;) No .. but it was my attempt at fixing a gcc warning that introduced this bug... Basically every change you make to the code is prone to error, and no matter how thorough you try to be, compiler errors never give know when the algorithm is wrong, just the syntax. The vast majority of programming errors are algorithm related like this one, it's one only code reviews and code testing that actually catch the vast majority of errors. This particular bug is a good example of the double edge sword of attempting warning fixes. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
Robert Osfield wrote: On Fri, Feb 6, 2009 at 7:47 PM, Paul Speed psp...@progeeks.com wrote: I wonder if there is a VS warning that would have found this... /me ducks for cover ;) No .. but it was my attempt at fixing a gcc warning that introduced this bug... Basically every change you make to the code is prone to error, and no matter how thorough you try to be, compiler errors never give know when the algorithm is wrong, just the syntax. The vast majority of programming errors are algorithm related like this one, it's one only code reviews and code testing that actually catch the vast majority of errors. This particular bug is a good example of the double edge sword of attempting warning fixes. Robert. Totally. I was just seeing if I could here a scream in the key of Scottish brogue from all the way across the Atlantic. ;) -Paul ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
On Fri, Feb 6, 2009 at 9:38 PM, Paul Speed psp...@progeeks.com wrote: Totally. I was just seeing if I could here a scream in the key of Scottish brogue from all the way across the Atlantic. ;) Aye, if Robert Burns we alive noo and working for his sins as programmer, what great prose would he write about stuff like this... ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
HI Csaba, I've just looked at the files, and the .osg file has 0 0 0's for all the vertices, looking at your code segment from the crash it kinda looks like the tex coords are derived from the vertex positions, so all 0 0 0's for vertices would map to lot's of divide by zeros and nans as a result. This would suggest either the original data is broken, or that the vertex reading is broken. Does this model load OK into lightwave? Could you post a screen shot? Robert. On Thu, Feb 5, 2009 at 1:43 AM, Csaba Halász csaba.hal...@gmail.com wrote: Hi everybody. I have gotten a report that the LWO loader doesn't seem to work. Investigating, I grabbed the sample LWO file posted by Marco Jez back in november last year (attached for convenience). Loading into osgviewer, I get an empty view. Trying osgconv, I get an osg file full of zeroes and nans (also attached). With SIGFPE enabled, gdb shows: Program received signal SIGFPE, Arithmetic exception. [Switching to Thread 0x7f9b6be43730 (LWP 10599)] 0x7f9b6756e456 in lwosg::Block::setup_texture_point (this=0xaee3c8, p...@0x7fff73fdcca0) at OpenSceneGraph/src/osgPlugins/lwo/Block.cpp:141 141 Q.x() *= 1/imap_.mapping.size_.x(); Current language: auto; currently c++ (gdb) p imap_.mapping $1 = {center_ = {_v = {0, 0, 0}}, size_ = {_v = {0, 0, 0}}, rotation_ = {_v = {0, 0, 0}}, csys_ = lwosg::Texture_mapping::OBJECT} That's clearly the source of the nans but maybe not the root of the problem. I haven't tried to find the exact svn rev this got broken yet, maybe somebody has a quick solution right away. -- Thanks, Csaba ___ 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] LWO loading problem
On Thu, Feb 5, 2009 at 4:34 PM, Robert Osfield robert.osfi...@gmail.com wrote: HI Csaba, I've just looked at the files, and the .osg file has 0 0 0's for all the vertices, looking at your code segment from the crash it kinda looks like the tex coords are derived from the vertex positions, so all 0 0 0's for vertices would map to lot's of divide by zeros and nans as a result. This would suggest either the original data is broken, or that the vertex reading is broken. Does this model load OK into lightwave? Could you post a screen shot? Don't know, I assume so. Blender loads it. I have tried some other models from different source and they don't work either. Simon reported it worked in 2.7.1, I just verified it worked in 2.7.4 too. I am now gonna build 2.7.8. -- Csaba ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
Hi Csaba, I've just grabbed the source for lwo from 2.7.1 and applied it to OSG-2.8 and I get a different result from doing a conv to .osg but I still don't get a valid model - the tex coords are now all inf, rather nan. If 2.7.4 works for you could you send me the a working .osg so I can compare against. FYI, most of the changes to the lwo were done to fix warnings... so my guess is one of these warning fixes broke the code. Robert. On Thu, Feb 5, 2009 at 3:41 PM, Csaba Halász csaba.hal...@gmail.com wrote: On Thu, Feb 5, 2009 at 4:34 PM, Robert Osfield robert.osfi...@gmail.com wrote: HI Csaba, I've just looked at the files, and the .osg file has 0 0 0's for all the vertices, looking at your code segment from the crash it kinda looks like the tex coords are derived from the vertex positions, so all 0 0 0's for vertices would map to lot's of divide by zeros and nans as a result. This would suggest either the original data is broken, or that the vertex reading is broken. Does this model load OK into lightwave? Could you post a screen shot? Don't know, I assume so. Blender loads it. I have tried some other models from different source and they don't work either. Simon reported it worked in 2.7.1, I just verified it worked in 2.7.4 too. I am now gonna build 2.7.8. -- Csaba ___ 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] LWO loading problem
On Thu, Feb 5, 2009 at 4:49 PM, Robert Osfield robert.osfi...@gmail.com wrote: I've just grabbed the source for lwo from 2.7.1 and applied it to OSG-2.8 and I get a different result from doing a conv to .osg but I still don't get a valid model - the tex coords are now all inf, rather nan. If 2.7.4 works for you could you send me the a working .osg so I can compare against. Hi Robert, I am now on 2.7.6, it works as well (except for the original multitexturing problem Marco reported on 6th November). Attached the .osg file. -- Csaba multitextured_cube.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] LWO loading problem
Hi Csaba, Are you working on a 32 or 64bit system? Robert. On Thu, Feb 5, 2009 at 4:14 PM, Csaba Halász csaba.hal...@gmail.com wrote: On Thu, Feb 5, 2009 at 4:49 PM, Robert Osfield robert.osfi...@gmail.com wrote: I've just grabbed the source for lwo from 2.7.1 and applied it to OSG-2.8 and I get a different result from doing a conv to .osg but I still don't get a valid model - the tex coords are now all inf, rather nan. If 2.7.4 works for you could you send me the a working .osg so I can compare against. Hi Robert, I am now on 2.7.6, it works as well (except for the original multitexturing problem Marco reported on 6th November). Attached the .osg file. -- Csaba ___ 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] LWO loading problem
On Thu, Feb 5, 2009 at 5:24 PM, Robert Osfield robert.osfi...@gmail.com wrote: Are you working on a 32 or 64bit system? I am on linux 64bit. Now I have verified with last night's 32 bit mingw build too, it gives a somewhat different, but equally bad, result (note, I didn't have the textures). Update on the build: 2.7.8 is broken, now building 2.7.7 -- Csaba multitextured_cube_mingw.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] LWO loading problem
On Thu, Feb 5, 2009 at 5:44 PM, Csaba Halász csaba.hal...@gmail.com wrote: Update on the build: 2.7.8 is broken, now building 2.7.7 2.7.7 is fine. So the trouble is somewhere between 2.7.7 and 2.7.8 . Judging from the symptoms, It could be an unitialized variable. Now I have to leave for a couple of hours, but I'll make a valgrind run and continue the bisecting later. -- Csaba ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
Hi Csaba, On Thu, Feb 5, 2009 at 4:57 PM, Csaba Halász csaba.hal...@gmail.com wrote: On Thu, Feb 5, 2009 at 5:44 PM, Csaba Halász csaba.hal...@gmail.com wrote: Update on the build: 2.7.8 is broken, now building 2.7.7 2.7.7 is fine. So the trouble is somewhere between 2.7.7 and 2.7.8 . Judging from the symptoms, It could be an unitialized variable. Now I have to leave for a couple of hours, but I'll make a valgrind run and continue the bisecting later. Thanks for homing in on the problem. I've moved my code base back to 2.7.1 and still had problems, just different ones. moving up to 2.7.6 hasn't changed things. This suggest that there is some other problem going on rather than just the error that was introduced between 2.7.7 and 2.7.8. I was expecting this difference to be down to 64bit vs 32bit but since you're one 64bit as well I'm rather stumped.. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
Hi Csaba, I've now put the 2.7.7 version of the lwo plugin into the my OSG-2.8 branch checkout and still get odd results, the lwo file is loaded but without any primitive data, and errors for the material values and tex coords. I'm now trying a fresh checkout of OpenSceneGraph-2.7.7 and will build it all, perhaps there is some kind of interaction with other parts of the OSG that are introducing these additional problems. BTW, what OS/g++ version are you working on? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
On Thu, Feb 5, 2009 at 5:11 PM, Robert Osfield robert.osfi...@gmail.com wrote: I'm now trying a fresh checkout of OpenSceneGraph-2.7.7 and will build it all, perhaps there is some kind of interaction with other parts of the OSG that are introducing these additional problems. I get errors with a fresh build of 2.7.7 as well. Arggg... I now wonder if the plugin ever worked on this machine... Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
On Thu, Feb 5, 2009 at 6:11 PM, Robert Osfield robert.osfi...@gmail.com wrote: BTW, what OS/g++ version are you working on? debian, with a somewhat old g++ (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21) The mingw build is on 32bit windows xp, g++.exe (GCC TDM-2 for MinGW) 4.3.0 -- Csaba ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
On Thu, Feb 5, 2009 at 5:57 PM, Csaba Halász csaba.hal...@gmail.com wrote: Now I have to leave for a couple of hours, but I'll make a valgrind run and continue the bisecting later. Rev 9397 is the first non-working revision. Looks like a lot of int-long changes, which seems to agree with your 64 bit theory. Except it is broken on 32 bit too. -- Csaba ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] LWO loading problem
On Thu, Feb 5, 2009 at 10:16 PM, Csaba Halász csaba.hal...@gmail.com wrote: Rev 9397 is the first non-working revision. Looks like a lot of int-long changes, which seems to agree with your 64 bit theory. Except it is broken on 32 bit too. LOL, it is one for Sukender's list :) for(int i=0; i4; ++i) { *dest_ptr = *src_ptr; } Can you spot the error? :) -- Csaba ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] LWO loading problem
Hi everybody. I have gotten a report that the LWO loader doesn't seem to work. Investigating, I grabbed the sample LWO file posted by Marco Jez back in november last year (attached for convenience). Loading into osgviewer, I get an empty view. Trying osgconv, I get an osg file full of zeroes and nans (also attached). With SIGFPE enabled, gdb shows: Program received signal SIGFPE, Arithmetic exception. [Switching to Thread 0x7f9b6be43730 (LWP 10599)] 0x7f9b6756e456 in lwosg::Block::setup_texture_point (this=0xaee3c8, p...@0x7fff73fdcca0) at OpenSceneGraph/src/osgPlugins/lwo/Block.cpp:141 141 Q.x() *= 1/imap_.mapping.size_.x(); Current language: auto; currently c++ (gdb) p imap_.mapping $1 = {center_ = {_v = {0, 0, 0}}, size_ = {_v = {0, 0, 0}}, rotation_ = {_v = {0, 0, 0}}, csys_ = lwosg::Texture_mapping::OBJECT} That's clearly the source of the nans but maybe not the root of the problem. I haven't tried to find the exact svn rev this got broken yet, maybe somebody has a quick solution right away. -- Thanks, Csaba multitextured_cube.lwo Description: Binary data multitextured_cube.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] LWO loading problem
Works ok in 2.7.1. 2009/2/5 Csaba Halász csaba.hal...@gmail.com: Hi everybody. I have gotten a report that the LWO loader doesn't seem to work. Investigating, I grabbed the sample LWO file posted by Marco Jez back in november last year (attached for convenience). Loading into osgviewer, I get an empty view. Trying osgconv, I get an osg file full of zeroes and nans (also attached). With SIGFPE enabled, gdb shows: Program received signal SIGFPE, Arithmetic exception. [Switching to Thread 0x7f9b6be43730 (LWP 10599)] 0x7f9b6756e456 in lwosg::Block::setup_texture_point (this=0xaee3c8, p...@0x7fff73fdcca0) at OpenSceneGraph/src/osgPlugins/lwo/Block.cpp:141 141 Q.x() *= 1/imap_.mapping.size_.x(); Current language: auto; currently c++ (gdb) p imap_.mapping $1 = {center_ = {_v = {0, 0, 0}}, size_ = {_v = {0, 0, 0}}, rotation_ = {_v = {0, 0, 0}}, csys_ = lwosg::Texture_mapping::OBJECT} That's clearly the source of the nans but maybe not the root of the problem. I haven't tried to find the exact svn rev this got broken yet, maybe somebody has a quick solution right away. -- Thanks, Csaba ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- The truth is out there. Usually in header files. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org