Re: [osg-users] CompositeViewer, update traversal, prerender branch

2008-09-21 Thread Fabian Bützow

Hi Robert,
thanks for your help in this case and thanks for all your other replies, 
you have been a great source of motivation and advice.


However, my problem has not been completely solved, yet. You were right, 
with the single graphics context and window for all views, the textures 
are updated now in each View. Cheers! The problem is, that i want to 
project the render result with 2 or 3 projectors onto an object, each 
projector with an individual View. Is it possible to extend the one 
graphics window over several screens/projectors? With that i could undo 
the window decoration and fake two independent views..? Otherwise i 
probably have to use multiple graphics windows and share the context 
(what id like to avoid, since you said that would cause even more problems).


Cheers,
Fabian

ps: i try to summarise, my (restricted) knowledge of graphics 
window/context etc.. Maybe others can contribute to that as well.
When you dont specify a graphics context for a View, osg generates a new 
unique one for each View. Graphics contexts comprise basically 
everything you need for standard rendering, buffers etc. The scene data 
of the View is copied. Each graphics context is displayed in a new 
graphics window. (One graphics context-one window, multiple 
Views-multiple graphics contexts-multiple graphics windows).


An update traversal is done only once per scenegraph(?), starting from 
the View that is placed highest in the scenegraph. After that cull and 
draw traversals are executed for each View.


[Prerender cameras nodes under a View in the scenegraph are rendered 
once for each View, the results of this step are not shared among the 
Views.]


hmm-more assumptions than knowledge..i should better stop ;)

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


Re: [osg-users] CompositeViewer, update traversal, prerender branch

2008-09-21 Thread Ralf Stokholm
Hi Fabian

Windows should handle a window that expands ower multiple devices, in our
application we have a single graphicswindow set up on two screens, the
graphics window is handmodified to position itself in the top left corner,
0,-1080 in this case and extends past both screens. I then set up two views
each taking up the space of a single monitor, and disable the window
decorator.

I know there is a call to do the setup something like
setupviewacrossalllscreens or so, but I havent experimentet with that yet.
Good luck.

Brgs

Ralf Stokholm

2008/9/21 Fabian Bützow [EMAIL PROTECTED]

 Hi Robert,
 thanks for your help in this case and thanks for all your other replies,
 you have been a great source of motivation and advice.

 However, my problem has not been completely solved, yet. You were right,
 with the single graphics context and window for all views, the textures are
 updated now in each View. Cheers! The problem is, that i want to project the
 render result with 2 or 3 projectors onto an object, each projector with an
 individual View. Is it possible to extend the one graphics window over
 several screens/projectors? With that i could undo the window decoration and
 fake two independent views..? Otherwise i probably have to use multiple
 graphics windows and share the context (what id like to avoid, since you
 said that would cause even more problems).

 Cheers,
 Fabian

 ps: i try to summarise, my (restricted) knowledge of graphics
 window/context etc.. Maybe others can contribute to that as well.
 When you dont specify a graphics context for a View, osg generates a new
 unique one for each View. Graphics contexts comprise basically everything
 you need for standard rendering, buffers etc. The scene data of the View is
 copied. Each graphics context is displayed in a new graphics window. (One
 graphics context-one window, multiple Views-multiple graphics
 contexts-multiple graphics windows).

 An update traversal is done only once per scenegraph(?), starting from the
 View that is placed highest in the scenegraph. After that cull and draw
 traversals are executed for each View.

 [Prerender cameras nodes under a View in the scenegraph are rendered once
 for each View, the results of this step are not shared among the Views.]

 hmm-more assumptions than knowledge..i should better stop ;)


 ___
 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] CompositeViewer, update traversal, prerender branch

2008-09-19 Thread Robert Osfield
Hi Fabian,

I'm afraid you don't really say enough about the specifics of your
setup for others to know enough to help you.

With your View, do they are share the same GaphicsWindow?  How do you
setup the pre render step?  A slave Camera?  A Camera in the scene
graph, how do you grab the live Camera stream?

What version of the OSG, OS and hardware are you using?

Robert.

On Fri, Sep 19, 2008 at 4:26 AM, Fabian Bützow [EMAIL PROTECTED] wrote:
 Hi everybody,

 Ive got some problems with displaying the result of a prerender step in
 different views.

 The root node has two basic branches:
 a prerender branch that renders and processes a live camera image, and a
 main render branch, that has two subnodes. The output texture of the
 prerender step is applied to the subnodes in different ways. A View is set
 to each subnode to display the specific view of the scene. A third View is
 set to the root node to observe the overall behavior of the texture (applied
 to both subnodes).

 The problem is, that the Texture gets updated in the overall view, but not
 in the subnode views (it shows the initialised static texture, not even the
 updated camera image). When I set the scene data of the subnode views to the
 root, the texture gets updated, but the framerate drops. When i assign no
 View to the scene root, the prerender branch isnt traversed at allAs far
 as i know, the update traversal is called once per frame for a composite
 viewer, that should update the texture in all nodes. Please help me with
 that one.

 Cheers,
 Fabian



 ___
 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] CompositeViewer, update traversal, prerender branch

2008-09-19 Thread Fabian Bützow

Ok, sorry Robert, now more specifically:

Hardware/software: WinXP, Opteron 2 GHz, 1 GB Ram, Geforce 8800 GS, OSG 2.4.

The prerender node has 5 camera nodes, a textured rectangle is attached 
to each camera node. The cameras render to texture in a defined 
RenderOrder. The textures of the rectangles are connected in a way that 
the output of one RTT camera is the input of the next. The pointer to 
the final texture is stored in a data class. The live-camera image is 
retrieved via CMUfirewire API, and updated in a StateAttribute::Callback 
function attached to the initial live-camera texture.


The Views are defined by the setUpViewInWindow() functions and added to 
a CompositeViewer. The scene data of the overall View (A) is set to the 
root node (thats the View that shows the updated texture), the scene 
data of the other two Views(B,C) is set to the subnodes in the scene 
graph. The camera position of each View is set via the 
getCamera()-setProjection() / ViewMatrix() methods. Rectangles are 
attached to the subnodes that should display the output of the prerender 
step (they get the texture via the pointer in the data class), but the 
textures dont get updated in the subviews B,C (they remain in their 
initialised state). I call CompositeViewer-frame() in the render loop. 
(No slave cameras or anything like that.)


The strange thing is, when I set the scene data of View B or C to the 
root node, the rendered textures get updated. (Maybe then, for this View 
the prerender branch is also traversed, causing the loss of fps, but on 
the other hand the Callback of the live-camera texture is called only 
once per frame..)


Thanks for your interest,
cheers,
Fabian
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] CompositeViewer, update traversal, prerender branch

2008-09-19 Thread Robert Osfield
Hi Fabian,

The first problem to resolve is the fact that views are each using a
separate GraphicsWindow, this means a separate GraphicsContext for
each view, which in term means that FBO's/texture objects/display
lists have be duplicated for each context, unless you enable sharing
of contexts, but this itself introduces other problems.

The best thing you could do would be to create a single GraphicsWindow
and then share this between all your Views, you then won't have an
problems with rendering order and sharing of textures or FBOs as it'll
all be on one graphics context.  See the sogcompositeviewer example
for how to set up the Views/Camera  GraphicsWindow.

Robert.

On Fri, Sep 19, 2008 at 11:17 AM, Fabian Bützow [EMAIL PROTECTED] wrote:
 Ok, sorry Robert, now more specifically:

 Hardware/software: WinXP, Opteron 2 GHz, 1 GB Ram, Geforce 8800 GS, OSG 2.4.

 The prerender node has 5 camera nodes, a textured rectangle is attached to
 each camera node. The cameras render to texture in a defined RenderOrder.
 The textures of the rectangles are connected in a way that the output of one
 RTT camera is the input of the next. The pointer to the final texture is
 stored in a data class. The live-camera image is retrieved via CMUfirewire
 API, and updated in a StateAttribute::Callback function attached to the
 initial live-camera texture.

 The Views are defined by the setUpViewInWindow() functions and added to a
 CompositeViewer. The scene data of the overall View (A) is set to the root
 node (thats the View that shows the updated texture), the scene data of the
 other two Views(B,C) is set to the subnodes in the scene graph. The camera
 position of each View is set via the getCamera()-setProjection() /
 ViewMatrix() methods. Rectangles are attached to the subnodes that should
 display the output of the prerender step (they get the texture via the
 pointer in the data class), but the textures dont get updated in the
 subviews B,C (they remain in their initialised state). I call
 CompositeViewer-frame() in the render loop. (No slave cameras or anything
 like that.)

 The strange thing is, when I set the scene data of View B or C to the root
 node, the rendered textures get updated. (Maybe then, for this View the
 prerender branch is also traversed, causing the loss of fps, but on the
 other hand the Callback of the live-camera texture is called only once per
 frame..)

 Thanks for your interest,
 cheers,
 Fabian
 ___
 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