FengGUI Icons Showing on Water Pass

The picture illustrates it best:









GameStates are initialized in the main class like this:



                        // contains 3d scene and content
                        SceneGameState sceneGameState = new SceneGameState("sceneGameState", center, city, betavillePrefs);
GameStateManager.getInstance().attachChild(sceneGameState);
sceneGameState.setActive(true);

SoundGameState soundGameState = new SoundGameState("soundGameState", center);
GameStateManager.getInstance().attachChild(soundGameState);
soundGameState.setActive(true);

// water render pass
WaterGameState waterGameState = new WaterGameState("waterGameState");
GameStateManager.getInstance().attachChild(waterGameState);
waterGameState.setActive(true);

                        // FengGUI
GUIGameState guiGameState = new GUIGameState("guiGameState");
GameStateManager.getInstance().attachChild(guiGameState);
guiGameState.setActive(true);



This problem goes away if I create the FengGUI gamestate first, but then the gui gets lost behind the water (in parts of the scene where the water is visible)

Do you render fenggui in its own renderpass?

Core-Dump said:

Do you render fenggui in its own renderpass?


I tried doing this a week or so back using the clever method that you posted on the wiki but I was confused about how the whole thing then interacts with the GameStateManager..

Do all the GameStates need to be on a render pass or just the fenggui state?

A GameState is like it’s own version of SimpleGame.



Each GameState uses it’s constructor as an init() method and has update(…) and render() methods. The order in which you add these to the GameStateManager is the order in which they will be executed. So, to answer your question, you can mix pass rendering and regular rendering with them.



GameState Wiki

Thanks for the reply,



I was previously using pass & regular rendering in conjunction with each other, but FengGUI has upset the apple cart.



One strange thing I've noticed is that the problem pictured in the OP only appears if I set up a gui theme, otherwise it looks fine.



I now have the gui as well as water effects encapsulated in their own pass states and have left my GameState for content with regular rendering.



It now crashes somewhere between the content finishing it's loading and the GUI being displayed.  I'll try to get an exact point where it's hanging and go from there.



P.S:  That's a nice wiki entry on GameStates, though the zip link is broken… shoot me a message if you'd like me to upload it with the static wiki content :slight_smile:

sbook said:

P.S:  That's a nice wiki entry on GameStates, though the zip link is broken.. shoot me a message if you'd like me to upload it with the static wiki content :)


Oh, thanks. I've actually imaged my computer since then, and then forgot to backup all of the crap on that website before I shut it down. If you want to c/p the code into an IDE and produce a demo, that'd be fine with me.