Hi Jon, >From the pictures my best guess is that a bug fix in OSG-3.2 has revealed a bug in your application setup code that was hidden by the original bug in the OSG.
The bug in the OSG-3.0.x and versions of the OSG prior to this was that Viewer' Camera's StateSet were discarded and replaced by an internal StateSet settings that was managed by osgUtil::SceneView which is used by the rendering backend. These new settings override the defaults in OpenGL, enabling things like depth test etc, these new defaults are actually what most 3D application need so overriding the defaults works well for most apps. The bug on the OSG side is these new defaults come at expense of any of the settings that user had applied to the Viewer's Camera as these would simply be discarded. What you see now in your application is what happens when you just render if OpenGL defaults. In OSG-3.2.x onwards the bug where SceneView was discarding the settings the Viewer's Camera's StateSet has been fixed, but as the osg::View (that Viewer subclasses) actually does the set up of the Camera's StateSet to the appropriate defaults for you (the actual call is StateSet::setGlobalDefaults()) most users will still see their scene correctly, as the default appropriate for most are all correctly in place. Since SceneView doesn't overrride this StateSet the user is now able to apply their own settings in their viewer setup without them being lost, so we have the best of both worlds. Unfortunately, while this bug fix works seamlessly for most users, users that apply their own osg::Camera to the Viewer but don't set up the StateSet with the appropriate settings just end up with OpenGL defaults. The OSG does exactly what the application is asking of it - applying only the settings that you apply, but as you don't provide the missing settings that once were erroneously applied you now see a different behaviour. The fix is simple. You either: 1) reuse the Viewer's Camera rather than applying your own, so the the osg::View(er)'s StateSet has be default been setup with the StateSet::setGobalDefaults() call. 2) when you create your own Camera and apply this to the Viewer you explictly call setGlobalDefaults(). i.e. viewer.getCamera()->getOrCreateStateSet()->setGlobalDefaults(). I have covered this topic several time times now, both in the run to OSG-3.2 and subsequently so you'll find discussion of this in the archives. I would recommend tracking discussions when new releases come out so you can catch corner issues like these. Robert. On 7 August 2014 16:34, Jon <[email protected]> wrote: > Hi all, > We are using OSG for a simulator that involves rendering collada models of > robots. For legacy reasons we use the assimp library for loading them, > rather than using OSG's collada plugin. This worked fine up through the > 3.0.1 release. > > However, it started producing strange behavior with 3.2.0. The models now > have inconsistent transparency (some parts invisible, so parts fully > opaque), and the layering is incorrect (a rear wheel occludes a front wheel > from camera perspective). Images attached. Also documented here: github: > /golems/grip2/issues/36 > (can't post link, but it's on github under "grip2", issue #36) > > This behavior has been reproduced on OSX (retina MBP on 10.9.4), and > ubuntu (dell precision T3600 on ubuntu 14.04). Also reproduced using > latest 3.3.1 build on Mavericks. > > We would be grateful for any suggestions on how to resolve this issue. We > have not been able to build OSG 3.0.1 OSX Mavericks > > Thank you! > > Cheers, > Jon > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=60582#60582 > > > > > Attachments: > http://forum.openscenegraph.org//files/osgkrang_desired_232.png > http://forum.openscenegraph.org//files/osgkrang2_189.png > http://forum.openscenegraph.org//files/osgkrang1_185.png > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

