[osg-users] (no subject)
Anders Backman
andersb at cs.umu.se
Thu Feb 4 05:03:15 PST 2016
Seems that this actually caused a lot more problem than I first thought...
The fact that you need to have a valid reference while tearing down nodes,
means that our system with plugins (dll:s loaded etc) now causes problems.
The Camera it self, has references to a scene, states, (Renderer) etc, and
if I keep a reference of the Camera to last, I get crashes when the camera
destructor is called, due to the fact that most of the nodes, shaders,
programs where created (allocated) in dll:s that has already been unloaded.
So to recap:
I need a context when a node is removed (if the node contains for example a
shader/program).
If I keep a reference to the Camera (hence the context), the camera also
keep references to just about everything I put into the scenegraph, meaning
that I delay the destruction of objects very late.
Right now I do not really see a solution for this. It was working in 3.4.0.
/A
On Thu, Feb 4, 2016 at 12:25 PM, Anders Backman <andersb at cs.umu.se> wrote:
> Yep sorry. I was having some (other) issue where text was not rendered
> when I had enabled shadows, so I was messing with osgViewer.cpp copying
> sample code from osgShadow there.
>
> The example that reveals the issue at shutdown is plainly osgShadow.cpp
>
>
> Output:
>
> osgshadow.exe --window 0 0 1024 768
> FOV is 29.1484
> Error: OpenGL version test failed, requires valid graphics context.
>
> And a crasch. Interestingly only if you first move the camera (left mouse
> move) in the graphics window.
> If you do not interact with the scene, it only show the error message.
>
> /Anders
>
>
>
> On Thu, Feb 4, 2016 at 11:57 AM, Robert Osfield <robert.osfield at gmail.com>
> wrote:
>
>> Hi Anders,
>>
>> There is a new mechanism for managing clean up of GL objects, which in
>> theory should help improve management of lifetimes of GL objects.
>>
>> The warning suggests that something is try to do GL call after the
>> context is cleaned up, I don't know yet if this is a bug in the new
>> code or whether the new code is just revealling an old bug elsewhere.
>>
>> Could you be more specific of how to reproduce the problem as there
>> isn't an --ssm option supported by the osgviewer example.
>>
>> Robert.
>>
>>
>> On 4 February 2016 at 09:05, Anders Backman <andersb at cs.umu.se> wrote:
>> > Hi all.
>> >
>> > Trying OSG 3.5.1 and I have started to get some problems with objects
>> > (osg::Program/osg::Shaders etc.) being de-allocated after context is
>> > destroyed:
>> >
>> > Error: OpenGL version test failed, requires valid graphics context.
>> >
>> >
>> > Sometime it crasches sometimes it just print the warning.
>> >
>> > I can reproduce it with osgViewer --ssm
>> >
>> > The only solution so far has been to keep a static reference to the
>> camera
>> > in the scene, which feels a lot like a hack.
>> > The same code worked in 3.4.0. So as you wrote in an earlier post, this
>> > probably reveals something that was not deallocated before.
>> >
>> > As soon as the viewer is destroyed, it takes the camera with it. Hence
>> the
>> > Context is also destroyed.
>> >
>> > Not sure how to handle this in an general way.
>> >
>> > /Anders
>> >
>> >
>> > --
>> > __________________________________________
>> > Anders Backman, HPC2N
>> > 90187 Umeå University, Sweden
>> > anders at cs.umu.se http://www.hpc2n.umu.se
>> > Cell: +46-70-392 64 67
>> >
>> > _______________________________________________
>> > osg-users mailing list
>> > osg-users at lists.openscenegraph.org
>> >
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> >
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
>
> --
> __________________________________________
> Anders Backman, HPC2N
> 90187 Umeå University, Sweden
> anders at cs.umu.se http://www.hpc2n.umu.se
> Cell: +46-70-392 64 67
>
--
__________________________________________
Anders Backman, HPC2N
90187 Umeå University, Sweden
anders at cs.umu.se http://www.hpc2n.umu.se
Cell: +46-70-392 64 67
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160204/7eb778f7/attachment-0003.htm>
More information about the osg-users
mailing list