Re: [osg-users] How to track down memory leaks?

2018-07-12 Thread Wojciech Lewandowski
Hi, Igor, I got interested in this problem and checked your code by converting it to pure osgViewer. Here are my observations: I believe you do have circular reference. Your class Scene is a callback. So RootNode points to callback but Scene callback points to RootNode. Hence circular ref.

Re: [osg-users] osglight demo problems with Intel graphics on Windows

2018-07-12 Thread Ryan Thoryk
robertosfield wrote: > > What you describe sounds like an Intel driver bug. The best thing you > can do is check for latest Intel drivers. > I checked over some things and found that the FFP was removed in GL 3.1, and that the Intel driver is reporting as that version. I tested on an

Re: [osg-users] How to track down memory leaks?

2018-07-12 Thread Igor Spiridonov
Here is simple project which reproduces this issue - RefCountTest (https://bitbucket.org/OmegaDoom/osgrefcounttest) It's a visual studio project with qt and osg. Not sure you are using windows but the main code in scene.cpp. ref count checks inside "Scene::operator()(osg::Node* node,

[osg-users] OpenThreads Mutex::lock() crash

2018-07-12 Thread Guy Volckaert
Hi, Has anyone experienced issues with OpenThreads Mutext::lock()? Occasionally a crash occurs when starting my application but only if the threading model is not SingleThreaded. The crash occurs in the following functions of OpenThreads: Code: int Mutex::lock() { Win32MutexPrivateData

Re: [osg-users] How to track down memory leaks?

2018-07-12 Thread Robert Osfield
On Thu, 12 Jul 2018 at 17:59, Igor Spiridonov wrote: > No, why would I have a circular reference? The OSG doesn't generally leak unless you do something pretty odd, the codebase is pretty heavily tested now. So we can only guess as to what might be wrong. Circular references is one

Re: [osg-users] [build] ViewerBase::setThreadingModel() not working

2018-07-12 Thread Robert Osfield
On Thu, 12 Jul 2018 at 17:52, Guy Volckaert wrote: > I also looked at the osg-submissions archives and could not find any trace of > this change. I went back as far as June 2017. Most submissions now come it via pull requests on github. Robert. ___

Re: [osg-users] [build] ViewerBase::setThreadingModel() not working

2018-07-12 Thread Guy Volckaert
Actually, if we want to adjust the threading affinity when cycling through the threading model, then would`t be better to if we replaced: Code: if (isRealized() && _threadingModel!=SingleThreaded) startThreading(); by Code: if (isRealized() && _threadingModel!=SingleThreaded)

Re: [osg-users] [build] ViewerBase::setThreadingModel() not working

2018-07-12 Thread Guy Volckaert
Hi, I also looked at the osg-submissions archives and could not find any trace of this change. I went back as far as June 2017. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=74329#74329 ___

Re: [osg-users] How to track down memory leaks?

2018-07-12 Thread Igor Spiridonov
No, why would I have a circular reference? And yes, I'm aware that circular references don't work with smart pointers. I will create a simple example which reproduces this issue. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=74328#74328

Re: [osg-users] [build] ViewerBase::setThreadingModel() not working

2018-07-12 Thread Guy Volckaert
Hi, I looked at the commit but the description does not clearly provide a reason for the change. I looked at the forum but could not find anything. I'll try the mailing list next. Thank you! Cheers, Guy -- Read this topic online here:

Re: [osg-users] How to track down memory leaks?

2018-07-12 Thread Robert Osfield
Hi Igor, On Thu, 12 Jul 2018 at 16:24, Igor Spiridonov wrote: > I have found the memory leak cause. Look like I don't understand how osg > works. > I have a root node and its child node. I add UpdateCallback to the root node > and inside this callback i remove child nod's drawables and add

Re: [osg-users] [build] ViewerBase::setThreadingModel() not working

2018-07-12 Thread Robert Osfield
Hi Guy, The commit that changes this was: ommit bb84f1ea3c23625a645b9c2848202bca7c566efb Author: Konstantin S. Matveyev Date: Sat Jan 13 15:46:53 2018 +0300 osgViewer::ViewerBase setThreadingModel func fix: should not start threading, must only restart Off the top of my head I only

[osg-users] [build] ViewerBase::setThreadingModel() not working

2018-07-12 Thread Guy Volckaert
Hi, When I try to cycle through the threading models by pressing the 'm' key (when the ThreadingHandler is registered) the stats would indicates the correct threading model, but the engine would remain in SingleThreaded. So I started investigating the issue and I noticed that, with OSG v3.6.2,

Re: [osg-users] How to track down memory leaks?

2018-07-12 Thread Igor Spiridonov
Hello Robert. I have found the memory leak cause. Look like I don't understand how osg works. I have a root node and its child node. I add UpdateCallback to the root node and inside this callback i remove child nod's drawables and add another ones. I check reference count before I remove them

Re: [osg-users] World space normal.

2018-07-12 Thread Wojciech Lewandowski
Hi, Was going to propose what Glenn already proposed. This should work with uniform scales on x,y,z coord. And IMHO that formula is more precise when dealing with normals than vertices. Thats because the precision issues are somewhat related to huge earth translation offsets in ModelView matrix.

Re: [osg-users] World space normal.

2018-07-12 Thread Glenn Waldron
Marlin, This might work: vec3 normalWorld = mat3(osg_ViewMatrixInverse) * gl_NormalMatrix * gl_Normal; But like Robert says, world coordinates on the GPU will lead to precision loss, so only do it if you are content with a low-precision result. Glenn Waldron On Wed, Jul 11, 2018 at 9:34 AM

[osg-users] [build] Missing OpenThreads PDB when building INSTALL

2018-07-12 Thread Guy Volckaert
Hi, This is not really a big issue, but I noticed that the OpenThreads PDB file is not copied to the INSTALL directory when building OSG v3.6.2 on Windows with VS2013. I looked at .\src\OpenThreads\win32\cmake_install.cmake and the lines required to copy the PDB are missings. Thanks,

Re: [osg-users] Can't access to assets in Android

2018-07-12 Thread michael kapelko
Hi. In OpenSceneGraph cross-platform guide application I first unpacked the resource into local drive, then accessed it the usual way. Here's the sample:

Re: [osg-users] [osgOcean] osgOcean - Render to Texture Camera

2018-07-12 Thread Robert Osfield
On Wed, 11 Jul 2018 at 23:39, Rob Ewbank wrote: > > Thanks Robert, I have been looking through the code and have merged two > branches, one which has been changed to work with OSG 3.4.1 and the master. > > Osgocean seems to do a few weird tricks with shaders and rendering that cause > issues in

Re: [osg-users] EXTERNAL: Re: World space normal.

2018-07-12 Thread Robert Osfield
Hi Marlin, On Wed, 11 Jul 2018 at 19:59, Rowley, Marlin R wrote: > Are you suggesting that I compute the world space normal in the > application and pass it to the shader? I absolutely need world space > coordinates. If so, how would I get the normal of the triangle before > evaluating the

[osg-users] Can't access to assets in Android

2018-07-12 Thread Daniel Ponsoda
Hi everyone, I just compiled the example project for Android (osgAndroidExampleGLES2) and can't figure out how to load osgt files I've put inside the apk (assets folder). I'm trying to load cow.osgt using the load option that appears in the app's menu with no luck (no matter what path I give).