Hah!!! It’s done. We have real low level multipass rendering now. ;D
The MultiPassView has disused. I’ve set it deprecated as well as org.xith3d.render.multipass.RenderPass. Please see org.xith3d.test.render.MultipassTest(2).
The multipass rendering works without any bufferswapping suppression or buffer clearing. It doesn’t even loose the stencil buffer in layered mode. The work is done inside the OpenGL rendering and saves time by not doing the whole rendering code for all passes but only the differing one. The opengl frame initialisation (don’t know how expensive) is done only for each frame, but not for each frame and pass.
And this is how it goes:
- Create and instance of BranchGroup and pass either to the constructor or to the appropriate setter an instance of com.xith3d.render.RenderPassConfigProvider, which can be e.g. com.xith3d.render.RenderPassConfig and set the properties if it.
- Create as much more BranchGroups as you like and handle them alike
- Add these BranchGroups to the Locale instance, just as you already know it.
- Set the property universe.getRenderer().setLayeredMode(boolean) to what ever you like. The default is false regulary, since people shouldn’t get a different rendering behaviour when they’ve existing code with multiple BranchGroups in a Locale. When you’re using Xith3DEnvironment, the default is automatically set to true.
Should be most easy.
BranchGroups that don’t hold an instance of com.xith3d.render.RenderPassConfigProvider don’t effect the rendering and the values are taken from the View.
Well, this shoud give us a (small) performance boost. Tomorrow I’ll check, if we can get rid of this every-frame-RenderBins-refilling problem. I think, we can modify the RenderBins only when a modification on the scenegraph was made. No need to traverse the whole scenegraph every frame. This should give a really bug performance boost. ;D
Cheers,
Marvin