Background -> scene -> fengui -> mouse

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();
  }


1 screen shot ?

Sorry, but I'm not supposed to reveal what I'm working on because its commercial project.


    zs.setFunction(ZBufferState.CF_NEVER);


Should actually be:


    zs.setFunction(ZBufferState.CF_ALWAYS);



To reset the OpenGL states before drawing FengGUI:


  protected void simpleRender() {
    pManager.renderPasses(display.getRenderer());
    DisplaySystem.getDisplaySystem().getCurrentContext().invalidateStates();
    for (int i = 0; i < RenderState.RS_MAX_STATE; i++) {
        Renderer.defaultStateList[i].apply();
    }
    fenguiDisplay.display();
  }


For more information and an additional workaround to prevent FengGUI from inheriting texture transforms, see
http://www.jmonkeyengine.com/jmeforum/index.php?topic=6481.0

havent yet encountered these issues…



I just add fengui to a pass manager



RenderPass fenPass = new RenderPass();
fenPass.add( fenDisplay);
pManager.add( fenPass );



Maybe i will have the trouble ahead, maybe not