Hello Carsten, thank you for the fast reply.
On 04.02.2010 16:23, Carsten Neumann wrote: > Hello Bastian, > > Bastian Sdorra wrote: > >> I try to render a small sub-tree of my scenegraph to a depth texture. >> For this >> purpose I use a combination of SimpleStageNode, VisitSubTreeNode and >> FrameBufferObject. >> >> The sub-tree is encapsulated in an own class with a >> renderDepthImage()-method on it, which does the depth to texture rendering. >> I'm now wondering about the kind of window and viewport to use in the >> class for the render call. >> > hm, you could render the depth texture as part of the normal scene, by > adding your SimpleStage as the first child of the root node [1]. It > would then use the window that is used to render the rest of the scene > (but not affect what is visible in that window, it would still write to > the depth texture). > > Ah, I didn't think about that. But there's a problem, I don't have access to the screen render window to trigger a redraw at the point where I need the depth image. The screen isn't constantly updated, only on demand (user interaction or explicit update call). It should be possible to change the code to work this way, but for convenience and design reasons it would be nice to have a independent entity, returning depth images on demand. >> Currently, I pass a PassiveWindow with a Viewport pointing to the root of >> the complete scenegraph to the class after I created it. It works, but I >> really >> want to avoid the window passing. >> Is there a way to let the class hold it's own window and viewport to do >> the rendering step? >> > a window in OpenSG represents an OpenGL context, so if you create a > second window you'd have a second context that is used to render the > depth texture. > > >> I previously tried to create the PassiveWindow in the class constructor >> and use >> it with a viewport pointing to the VisitSubTree root or the SimpleStage >> parent, >> but both without success. I suppose, there is a context problem with the >> Passive >> Window... >> > the PassiveWindow remembers the OpenGL context that is active when > init() is running. What OS are you using and what do you use to create > the application window (e.g. glut, X11, WIN32) ? > Hm ok, then my window should have the context I used before? So what happens to the context, if I delete the newly created window? Is the context also deleted? (This would explain the GL_INVALID_OPERATION error I got the last time I tried to run the application.:)) If so, is there a way to preserve the context ? I'm using OpenSG 2.0 + QT 4.6.1 on a WinXP machine. For the render window I use the QGLWidget + OSGPassiveWindow. > Cheers, > Carsten > > [1] making it the first child ensures that it is rendered before the > rest of the scene, in case you need the depth texture as input when > drawing the scene itself. > > > ------------------------------------------------------------------------------ > The Planet: dedicated and managed hosting, cloud storage, colocation > Stay online with enterprise data centers and the best network in the business > Choose flexible plans and management services without long-term contracts > Personal 24x7 support from experience hosting pros just a phone call away. > http://p.sf.net/sfu/theplanet-com > _______________________________________________ > Opensg-users mailing list > Opensg-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/opensg-users > Regards, Bastian ------------------------------------------------------------------------------ The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com _______________________________________________ Opensg-users mailing list Opensg-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensg-users