[Solved] SimplePassGame - Display Question (and answer)

Hello again,



When using a class that extends SimplePassGame, I understand how to add scene objects, which have lighting, models, terrain, skyboxes, etc., to rootNode, which is placed into pManager, which can then perform render passes.  However, if I want to change which camera is being used to render a scene in this Game paradigm, how would I go about doing that, since the renderer required to set a camera to is not currently part of the scene?



I tried using display.getRenderer().setCamera(camera), but that did not work.  The code I tested does work as a BaseGame without render passes.



Any questions, suggestions, explanations, hints, or sample code are welcome!

Hey Readers,



I've managed to solve this problem on my own!  Basically I needed to add:


    @Override
    public void simpleRender() {
        display.getRenderer().clearBuffers();
        pManager.renderPasses(display.getRenderer());
    }



which I left out completely!  Without overriding the simpleRender() function, the display renderer can't clear its buffer and you can't specify which renderer should be used to render the passes in the argument.  Frankly, I'm surprised it was able to even render the GUI elements that I had in there.

Sounds like something else is wrong because SimplePassGame already clears the buffers and calls pManager.renderPasses(display.getRenderer()) before simpleRender is ever called.

It turned out I was passing the wrong renderer and happened to fix it at the same time I added the SimpleRender function.  Thanks for pointing that out; now I can remove that useless code.



Basically, the solution is that lots of scene elements require that you call display.getRenderer().create<Element>, where element is camera, lightstate, texturestate, and a bunch of other stuff.  I was using the wrong display, so the display that SimplePass uses to render the Nodes didn't have any of that information.