Re: [osg-users] Custom Graphics Context not applied?
Hi, ah nice, thats even better. Will experiment with it. Thank you! Cheers, Philipp -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=68489#68489 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Custom Graphics Context not applied?
HI Philipp, The is a osg:GraphicsContext::SwapCallback that you can subclass and then assign to the created GraphicsContext via the GraphicsConctext::setSwapCallback(mySwapCallback);. This gives you control over the swap callback, including issue any extra calls before or after the actual swap callback. Note, the swap callback replaces the default call to GraphicsContext:swapBuffersImplementation() so you must call this within your callback otherwise the buffer won't be swapped. Robert. On 30 August 2016 at 13:30, Philipp Meyer wrote: > Hi, > > I want to measure the frametime without waiting for vsync. On my test system > I have no way to turn vsync off, but I still need to benchmark. > > So the plan was to call glFinish() after the rendering traversal is over, but > BEFORE swapBuffers() (because thats the call that actually blocks until the > vsync signal arrives). That way, in theory, I should be able to receive > frametimes without vsync. > > Thank you! > > Cheers, > Philipp > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=68487#68487 > > > > > > ___ > 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] Custom Graphics Context not applied?
Hi, I want to measure the frametime without waiting for vsync. On my test system I have no way to turn vsync off, but I still need to benchmark. So the plan was to call glFinish() after the rendering traversal is over, but BEFORE swapBuffers() (because thats the call that actually blocks until the vsync signal arrives). That way, in theory, I should be able to receive frametimes without vsync. Thank you! Cheers, Philipp -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=68487#68487 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Custom Graphics Context not applied?
Hi Philipp On 30 August 2016 at 13:20, Philipp Meyer wrote: > How do I provide a graphics context for a viewer? I see there is a method > returning all graphics contexts, but I cant find any methods to set the > context, and the constructor of osgViewer doesnt take a graphics context > either. You assign the GraphicsContext to the viewer Camera(s). The osgViewer:realize() method will create and assign a GraphicsContext if one is not already assigned, this exists just as a fallback, ideally the viewer and associated Camera(s) should be set up prior to the realize() call. An example of manually creating and assigning GraphicsContext/Window can be found in the osgwindows examples. > Maybe there is an easier way to accomplish what I need? I want to store a > timestamp BEFORE the call to swapBuffers, but after rendering traversal. You are creating a custom GraphicsContext just to get a timestamp? When you say before swap buffers, do you mean just before the call to swap buffers or do you mean any time in the frame before swap buffers. What do you need to the timestamp for? Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Custom Graphics Context not applied?
How do I provide a graphics context for a viewer? I see there is a method returning all graphics contexts, but I cant find any methods to set the context, and the constructor of osgViewer doesnt take a graphics context either. Maybe there is an easier way to accomplish what I need? I want to store a timestamp BEFORE the call to swapBuffers, but after rendering traversal. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=68485#68485 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Custom Graphics Context not applied?
Hi Philipp, It impossible for us to know what is going wrong given the details you have provided. I can't even answer whether the OSG is creating a graphics context behind the scenes as there it's so open ended what you may or may not be doing. If you don't provide an graphics context that osgViewer will attempt to create one for you, perhaps this is happening. However, as I've said, there isn't any way for us to know what is going wrong, only you have the code and the ability to run your application and debug it first hand. Robert. On 30 August 2016 at 11:21, Philipp Meyer wrote: > Hi, > > I'm trying to create a custom graphics context to replace the default X11 > Graphics context (I need to add some additional code). > > To do this, I created a new "CustomGraphicsContextX11" class, deriving from > "PixelBufferX11". I reimplemented the virtual methods that I need to adjust. > > Then, I apply the custom graphics context to my master camera and start up > the viewer. > > However, to my own surprise the swapBuffersImplementation() method of my > custom context is never executed. Same goes for "realizeImplementation()". > > Is OSG still using another graphics context behind the scenes for some > reason? The method described above worked fine for me on another system > without the X11 windowing system. > > Thank you! > > Cheers, > Philipp > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=68483#68483 > > > > > > ___ > 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] Custom Graphics Context not applied?
Hi, I'm trying to create a custom graphics context to replace the default X11 Graphics context (I need to add some additional code). To do this, I created a new "CustomGraphicsContextX11" class, deriving from "PixelBufferX11". I reimplemented the virtual methods that I need to adjust. Then, I apply the custom graphics context to my master camera and start up the viewer. However, to my own surprise the swapBuffersImplementation() method of my custom context is never executed. Same goes for "realizeImplementation()". Is OSG still using another graphics context behind the scenes for some reason? The method described above worked fine for me on another system without the X11 windowing system. Thank you! Cheers, Philipp -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=68483#68483 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org