Re: [osg-users] Crash when using LineSegmentIntersector

2018-08-03 Thread Robert Osfield
Hi Sam,

Geode used to be the leaf node in the scene graph that could only have
Drawable as children, no traditional node types could be added to a
Geode, so with older versions of the OSG what you are attempting
wouldn't even compile.

I don't recall the exact date, but in the last few years I relaxed the
scene graph so that Drawable leaves could be added to any Group in the
scene graph, so now the Geode only exists for backwards compatibility.
For a modern scene graph I wouldn't create any Geode's at all.  In
doing this I had to relax the Geode so it's more in-line with a normal
Group, but this unfortunately means that you can do things like you
are doing, i.e. adding a Geode as a child to a Geode, which is an
unfortunately side effect.

In you code you are still using a Geode so it's old school OSG, but
you are nesting a Geode within a Geode, which is really not a good
practice.  I really don't know why you are even using a Geode here.
It makes me think that you whole approach is a bit confused.

However, as I've only seen a tiny snippet of your code and explanation
I can't really say where you've understanding of how best to implement
what you need has gone off in the weeds. The fact that it's crashing
is a good sign that something has gone wrong, and nesting of a Geode,
even if it isn't the cause is another indication that you probably
just need to take a step back.

Another general comment is that it's not recommend practice to go
adding objects to the scene graph from within a NodeVisitor.  It's all
too easy to invalidate iterators and end up in a right old mess.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Crash when using LineSegmentIntersector

2018-08-03 Thread Sam Brkopac
Hi Robert,

Looks like in slimming down my code there are some things that look... odd. 
Different meshes can have multiple groupings of the flags so I use one geode to 
render all of those triangles.

Should I not be attaching the geode used to render the triangles to the main 
geode returned from the plugin? I guess what I'm asking is why is it odd to 
have a geode attached to a geode.

Thanks, Sam

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=74463#74463





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] VAO Resource Leak in OSG 3.6.2

2018-08-03 Thread Daniel Emminizer, Code 5773
Hi Robert,

No problem.  I'm out of "panic" mode since I found a work-around with the PR, 
so next week is just fine.

Thanks for the PR feedback.  Unfortunately I'm unavailable all next week.  I'm 
happy to retest any fix you have once I'm back.

I hope Vulkan work is going well.  I'm watching the mailing list with 
anticipation.

 - Dan 


> -Original Message-
> From: osg-users [mailto:osg-users-boun...@lists.openscenegraph.org] On
> Behalf Of Robert Osfield
> Sent: Friday, August 03, 2018 4:11 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] VAO Resource Leak in OSG 3.6.2
> 
> Hi Dan,
> 
> I'll be focusing on Vulkan work today so won't look into this right
> away.  Next week I'll set aside a day for OSG maintenance and
> hopefully will be able to look at this then.
> 
> Robert.
> On Thu, 2 Aug 2018 at 15:49, Daniel Emminizer, Code 5773
>  wrote:
> >
> > Hi Robert,
> >
> > I think I've found a resource leak in OSG 3.6.2.  Attached is a contrived
> sample application that demonstrates the behavior.
> >
> > What appears to be happening is that the VAO is being created with
> glGenVertexArrays(), but does not get deleted with glDeleteVertexArrays().
> Using the open source API Trace, I can see that on exit it does destroy some
> VAO, but not (nearly) all of them.
> >
> > I'm investigating now for a solution, but I'm not very familiar with this 
> > part
> of OSG.  I'm passing this along now in case you see an obvious solution.
> Thanks,
> >
> >  - Dan
> >
> >
> > ___
> > 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] Crash when using LineSegmentIntersector

2018-08-03 Thread Robert Osfield
Hi Sam,

I don't have time to look at build end user code today but I have had
a quick glance at the example and the first thing that jumped out as
add to me was:

osg::ref_ptr drawable(new osg::Geode);
drawable->setName("lnoflags");

geode.addChild(drawable);

Adding a Geode to a Geode is a bit odd.  Why not just do
geode->setName("Inoflags");

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] VAO Resource Leak in OSG 3.6.2

2018-08-03 Thread Robert Osfield
Hi Dan,

I'll be focusing on Vulkan work today so won't look into this right
away.  Next week I'll set aside a day for OSG maintenance and
hopefully will be able to look at this then.

Robert.
On Thu, 2 Aug 2018 at 15:49, Daniel Emminizer, Code 5773
 wrote:
>
> Hi Robert,
>
> I think I've found a resource leak in OSG 3.6.2.  Attached is a contrived 
> sample application that demonstrates the behavior.
>
> What appears to be happening is that the VAO is being created with 
> glGenVertexArrays(), but does not get deleted with glDeleteVertexArrays().  
> Using the open source API Trace, I can see that on exit it does destroy some 
> VAO, but not (nearly) all of them.
>
> I'm investigating now for a solution, but I'm not very familiar with this 
> part of OSG.  I'm passing this along now in case you see an obvious solution. 
>  Thanks,
>
>  - Dan
>
>
> ___
> 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