Multiple renderers one scenegraph

Ok, I digged my way through jMonkey and rigth now I'm lost.

Is there a way to render a scene with two different renderers and one scenegraph.

I'm currently working on an eclipse project and I already have to canvas and everything is working fine when I use a scenegraph for each canvas.

As I read that jMonkey is threadsave I'd like to have one scenegraph for both canvas.

Is there a way to do it?

Just some pseudocode would be enough to give me the direction.



Thx a lot

You might want to check if Render to Texture is what you want. http://www.jmonkeyengine.com/wiki/doku.php?id=texturerenderer



It allows you to have the scene rendered to a texture that you can later place wherever you want… perhaps even in another window.

I finally managed to do it.

Thanks for the hint but I'm doing it right now by rendering the scene twice with different cameras.

By that I can easily utilize two GLCanvas instances inside SWT.

Ok, the last post got away a little too early.

After playing around with it I realized that the framerate dropped from 4000 fps to 70 fps.

It happens when I'm hitteng the render.draw(rootnode) method twice to render the scene from a different angle.

Any idea about that?

Well since now you have two cameras, and are rendering the scenes one at a time (interleaving them, I suppose), that means that the info that needs to be sent to the GPU is changed every frame, which is typically not the case when you use only one camera (here, most of the data can be reused).  :stuck_out_tongue:

Sorry for the very late answer but I was away for some time.

I was expecting an even split like from 4000fps for one canvas to 2000fps for 2 canvas'.

I achieved that even split some time later by carefully disecting my code.

I now get an even split between my canvas (so far I've been testing with 50 canvas, just to show off a little).

AND A HIAL TO THE JMONKEY CREW:

I'M USING 10 DIFFERENT THREADS TO MODIFY THE SCENGRAPH AND IT WORKS!!!

(I hope they heard that ;))

Is there a sample code, to explain how to display two different scene at the same time?

Thanks for your help