OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

(no subject)


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
andersb (Anders Backman)
User


Joined: 07 Jun 2010
Posts: 72

PostPosted: Thu Feb 04, 2016 9:10 am    Post subject:
(no subject)
Reply with quote

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
(
Only registered users can see emails on this board!
Get registred or enter the forums!
http://www.hpc2n.umu.se
Cell: +46-70-392 64 67

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12353

PostPosted: Thu Feb 04, 2016 11:02 am    Post subject:
(no subject)
Reply with quote

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 <> wrote:
Quote:
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
http://www.hpc2n.umu.se
Cell: +46-70-392 64 67





------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
andersb (Anders Backman)
User


Joined: 07 Jun 2010
Posts: 72

PostPosted: Thu Feb 04, 2016 11:30 am    Post subject:
(no subject)
Reply with quote

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 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
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 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
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
(
Only registered users can see emails on this board!
Get registred or enter the forums!
) http://www.hpc2n.umu.se
Cell: [url=tel:%2B46-70-392%2064%2067]+46-70-392 64 67[/url]



Quote:
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




--
__________________________________________
Anders Backman, HPC2N
90187 Umeå University, Sweden
(
Only registered users can see emails on this board!
Get registred or enter the forums!
http://www.hpc2n.umu.se
Cell: +46-70-392 64 67

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
andersb (Anders Backman)
User


Joined: 07 Jun 2010
Posts: 72

PostPosted: Thu Feb 04, 2016 1:08 pm    Post subject:
(no subject)
Reply with quote

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 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
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 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
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 < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
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
(
Only registered users can see emails on this board!
Get registred or enter the forums!
) http://www.hpc2n.umu.se
Cell: [url=tel:%2B46-70-392%2064%2067]+46-70-392 64 67[/url]



Quote:
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




--
__________________________________________
Anders Backman, HPC2N
90187 Umeå University, Sweden
(
Only registered users can see emails on this board!
Get registred or enter the forums!
http://www.hpc2n.umu.se
Cell: [url=tel:%2B46-70-392%2064%2067]+46-70-392 64 67[/url]







--
__________________________________________
Anders Backman, HPC2N
90187 Umeå University, Sweden
(
Only registered users can see emails on this board!
Get registred or enter the forums!
http://www.hpc2n.umu.se
Cell: +46-70-392 64 67

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12353

PostPosted: Thu Feb 04, 2016 1:24 pm    Post subject:
(no subject)
Reply with quote

Hi Anders,

On 4 February 2016 at 13:03, Anders Backman <> wrote:
Quote:
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.

I wouldn't worry to much right now as I haven't yet worked out what is
going wrong in your case. The changes to the core OSG aren't meant to
cause new restrictions on usage. The only case where we might not be
able to retain support for is if there was originally buggy code that
was doing things wrong and somehow by luck didn't cause problems now
causes problems. For the later case we need to find the problem in
client code.

However, let me investigate the bug at my end. This should clarify
things. I haven't had a chance to investigate yet as I've been
testing and checking a block of work this morning.

Quote:
Right now I do not really see a solution for this. It was working in 3.4.0.

Right now just go back to OSG-3.4.0,

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12353

PostPosted: Thu Feb 04, 2016 2:39 pm    Post subject:
(no subject)
Reply with quote

Hi Anders,

On 4 February 2016 at 13:19, Robert Osfield <> wrote:
Quote:
However, let me investigate the bug at my end. This should clarify
things. I haven't had a chance to investigate yet as I've been
testing and checking a block of work this morning.

I have tracked the problem down to the various
osgShadow::ShadowTechnique not implementing the resizeGLObjects() and
releaseGLObjects() methods that they should have been implementing all
along, this is a bug in these classes, which have been revealed by the
changes to the core OSG w.r.t release GL objects. Fixes for these
ommissions is something I'm currently working on. These changes would
be appropriate to older versions of the OSG as well as.

I will complete these fixes and get them checked in, once I do I'll
update this thread.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 12353

PostPosted: Thu Feb 04, 2016 7:12 pm    Post subject:
(no subject)
Reply with quote

Hi Anders et.al,

On 4 February 2016 at 14:34, Robert Osfield <> wrote:
Quote:
I will complete these fixes and get them checked in, once I do I'll
update this thread.

I have fixed the problems in osgShadow and checked in fixes to git master.

Gotta be said that some elements of the osgShadow code is right mess,
far more complicated and difficult to follow than it should be. There
are quite a few classes in there that I should never have merged as
they really make a mockery of clean and clear class design and
implementation. I'm wondering whether I should just remove such parts
of the OSG as we go forward.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts (no subject) General 2 Thu Mar 08, 2018 3:16 am View latest post
No new posts (no subject) Andre Normann Submission 2 Mon Nov 13, 2017 10:00 am View latest post
No new posts (no subject) tanshihaj General 0 Tue Sep 19, 2017 2:26 pm View latest post
No new posts (no subject) filnet Submission 0 Wed Jun 29, 2016 9:31 am View latest post
No new posts (no subject) grendah General 1 Sat Apr 23, 2016 1:45 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP