Hi all :’(
I have to work out a GUI screen with some nice details that came out really hard to do. Or rather, hard to find out how to do.
I need to render a 3D bloomed scene, with a (unbloomed) GUI on top of and (unbloomed) mouse atop of it. Nice background hi-res image needs to be rendered behind all that.
Now… I searched the forum and found that this is accomplished by using render passes, so I switched over to the BasicPassManager instead of drawing nodes, but I just cannot make it work.
First render pass consists of only one Quad set to ortho queue with texture state and zbuffer set to NEVER (and all other functions for testing purposes).
Second render pass constist of a BloomRenderPass which renders very simple scene. For some strange reason, this actually works well.
Third render pass consists of simple RenderPass with AbsoluteMouse. Altough, I can never see the mouse.
Then I call display on fengui.
I also tried making custom simple renderpass for displaying fengui, and of course that doesn’t work. I should probably post some code here…
Thanks for the help, anyone…
Creation
private Quad background() {
Quad background = new Quad("background", display.getWidth(), display.getHeight());
background.setLocalTranslation(display.getWidth() / 2, display.getHeight() / 2, 0);
background.setRenderQueueMode(Renderer.QUEUE_ORTHO);
TextureState ts = display.getRenderer().createTextureState();
ts.setTexture(TextureManager.loadTexture(BACKGROUND_FILENAME, Texture.MM_LINEAR, Texture.FM_LINEAR, 1.0f, true));
ts.setEnabled(true);
background.setRenderState(ts);
ZBufferState zs = display.getRenderer().createZBufferState();
zs.setFunction(ZBufferState.CF_NEVER);
zs.setEnabled(true);
background.setRenderState(zs);
background.updateRenderState();
return background;
}
Render pass setup
private void setupRenderer() {
RenderPass rootPass = new RenderPass();
rootPass.add(background());
pManager.add(rootPass);
BloomRenderPass rootNodeRenderPass = new BloomRenderPass(cam, 4);
rootNodeRenderPass.add(rootNode);
pManager.add(rootNodeRenderPass);
RenderPass mousePass = new RenderPass();
mousePass.add(losRattosTerribilos);
pManager.add(mousePass);
}
Render call
protected void simpleRender() {
// super.simpleRender();
// display.getRenderer().clearBuffers();
pManager.renderPasses(display.getRenderer());
// fenguiDisplay.display();
}