Hi all, I was trying to follow the tutorial but using jME2, http://www.jmonkeyengine.com/wiki/doku.php?id=fenggui_jme_appl_using_standardgame
Following the jme to jme2 guide I had no problem adapting the code. The problem is textures are not working properly. Models are loaded and working and textures are loaded but I can't see them from regular distance. All I see are black models. If I move using WASD inside the cubes or near the terrain I can see the textures. The problem is distance, I have no idea were to begin looking to solve this.
I have jme2 and fenggui both from svn.
The problem is related to the FogState in IngameGameState initEnvironment().
Not sure exactly what the problem is, but you can remove the fogstate completely.
Also adding either fs.setDensityFunction(FogState.DensityFunction.Linear) or fs.setDensity(0.01f) to it hides the problem.
<<JOC>>
Awesome! Thanks a lot, it works now.
Could you post the updated code somewhere? I am also trying to get the tutorial to work but without success.
Hi Conzar,
I can't find the code I set up to try this, but as I remember it - it was pretty simple to patch. Assuming you have the classes exactly as they appear in the wiki tutorial, the only change to get it working is to modify or remove the fogstate from the IngameGameState class.
/**
* This GameStates shows a spinning Box, with the Monkey Texture
* which is scaled and being translated in the stateUpdate Method.
*
* Size and Color attributes are read from the FengGUI Gamestate.
*/
public class IngameGameState extends CameraGameStateDefaultCamera {
...
...
...
/**
* Set up a basic Light to Illuminate the Scene,
* a CullState to.
*
*/
private void initEnvironment() {
// JOC - comment this block out out to make the tutorial work
// // set up a FogState
// FogState fs = display.getRenderer().createFogState();
// fs.setStart(15);
// fs.setEnd(30);
// fs.setColor(ColorRGBA.black);
// rootNode.setRenderState(fs);
// JOC - END
// a light to illuminate the scene
PointLight light = new PointLight();
light.setDiffuse( new ColorRGBA( 0.75f, 0.75f, 0.75f, 1f ) );
light.setAmbient( new ColorRGBA( 0.5f, 0.5f, 0.5f, 1f ) );
...
...