jME context system

The long-awaited system presented in the thread multicanvas rendering is now available for download.





See the class TestJmeContext for a usage example.

Included is also an advanced StereoRenderPass with many features, and a LWJGL JmeContext implementation.



Download (41 KB zip)

seems to be missing com.gibbon.mfkarpg.helpers.ResourceHelper;

if I comment the above out it works


Hi guys, I'm really interested in this "package" so I suppose that allows to draw in stereoscopy mode :-o :-o :-o . I'll tried to put content of zip in the source folder, and after add the package manually to the project I have in eclipse, but it says: " Package already exists with a different case ". It's the package included in the CVS? Where is it? I don't find it :? I'm starting with "eclipse" and i would be really pleased if you can help me :slight_smile:



Thanks a lot :slight_smile: :slight_smile: :slight_smile:

This "package" does not allow you to draw in stereoscopy mode… But it has a RenderPass class that does. It requires you to use the context system included in the package though, which you might not want to do if your application is already well established. As far as I know it is not included in CVS, if it was then the devs would at least rename the package names so it appears in com.jme.** instead of com.gibbon.jme.context.** which would not cause the conflicts.

I still have not started my application because of this, I'm searching for the best solution before starting. So, if I need the stereoscopy mode, will I need your Context System? Or there are another possibilities? I need it because I'm planning to use a VR Helmet and I must draw in stereo.



I'm starting now with jME and I don't know how is the "SystemContext" so if you can do a very little explanation of this I would be pleased.



Thanks.



P.D. Finally I can include your package in the project :wink:

Stereoscopy is completely unrelated to the context system, you can do stereoscopy in jME without it. BUT the stereoscopy pass in this package requires the context system because it is an example of usage of the system.

Thanks for the explanation :slight_smile: I must investigate a little bit more to do that :wink:

Momoko_Fan said:

Stereoscopy is completely unrelated to the context system, you can do stereoscopy in jME without it.


hm could you elaborate a bit on what you mean by this?  I've been searching the forum for information on rendering multiple views, so that I can do stereoscopy, and found this thread.

Thanks!

Look at the StereoRenderPass class in the package and adapt it to your needs.

Well okay, I was hoping for a little explanation other than the code itself, but that's already a nice gift from you.

Uh, sorry. I was in a bit of a hurry that time, I am not really sure how expirienced you are with jME.

I think adapting it to a GameState would satisfy most people. The code under runPass is what you need to put under the "render" method, initPass is what you put in the OpenGL thread initialization, and the constructor can be called anywhere you want (loading thread or GL thread). The helper methods need to be copied as well of course.

And then there's the option of using this "package" as-is, e.g downloading it and using the jME-context like it was intended to.

I can't get around the missing package.



ResourceHelper is being used in the code so commenting the import out doesn't help much.

I am currently working on a jME2.0 version, with some bug fixes and other additions. Will release soon…

What is the status?



I'm trying to convert my current Java3D program to Jme 2.0.

The Java3D program has multiple canvases/views on the same scenegraph, and

I think that is not possible with Jme.



I'm asking because I like to try your JmeContext with Jme 2.0  :slight_smile:

The jME2 version can be checked out from the radakan source

I found the code and did some tests with it.

I have now two canvases (JmeContexts) beside each other in a JFrame.



Is it possible to use the Skybox with multiple canvases?

I'm asking because in the TestSkybox example the following line of code:



m_skybox.setLocalTranslation(cam.getLocation());



is used and I guess this would not work with multiple cameras (camera per canvas)


You have to store the renderer or JmeContext object for each canvas. Each renderer has it's own camera so you can access them if you store a reference to the canvas's context renderer.

Yes, initially the rendering works, but when I move one of the cameras, the other canvas is also changed because the location of the skybox is updated. Here is part of the code:



   private static class SkyBoxUpdater extends RenderPass
   {
      private Node skybox;

      public SkyBoxUpdater(Node skybox)
      {
         this.skybox = skybox;
      }

      @Override
      public void doUpdate(JmeContext context)
      {
         super.doUpdate(context);
         skybox.setLocalTranslation(context.getRenderer().getCamera().getLocation());
      }
   }

    ...
    Skybox skybox = buildSkyBox();
    rootNode.attachChild(skybox);
    ...
    cx.getPassManager().add(new SkyBoxUpdater(skybox));
    cx2.getPassManager().add(new SkyBoxUpdater(skybox));
    ...

Why are you adding the skybox to the rootNode? It should be rendered in a seperate pass. If you're having problems, perhaps it's best to clone the skybox for each of the canvases?