Black screen (except gui)

Hi all, tried out jMonkey a few months back, wrote a test app, worked great on both my macs and PC.

I’ve now come up with an idea for a game, so downloaded the latest nightly build (for use in Eclipse).

Started writing the game on my mac mini (openGL1.4), the test game works fine within Eclipse and as a compiled Jar + library folder.

If I run it on my macbook or windows PC, I see the GUI text elements I added, but none of the 3D is rendering at all, complete blackness.



I use:

settings.setRenderer(AppSettings.LWJGL_OPENGL_ANY);



so that it runs on openGL1 on my old mac mini and openGL2 on my macbook and PC, also tried specifying openGL1 so it runs at openGL1 on all machines. So, I’m stuck, the engine seems to work fine on the lowest powered computer and I’m reluctant to carry on writing the game with this engine if it’s not going to work.



I get no exceptions in the terminal when running it, the stats show it showing 10000+ triangles, 30+ objects etc, but I see nothing (on 2 out of 3 computers). I get a warning on the macbook to say OpenAL can’t use audio effects, but that’s no problem.



***UPDATE: gone back to basics, single cube, which works on all computers. Clearly something I added that causing it to fail on the other 2 computers. Will carry on adding more code until it breaks again.

if you’re using shaded material (lighting or terrainLighting ) make sure you have a light in your scene.

Found the problem.

I’d been playing around with the frustum settings. I had left the ‘far’ setting set to Float.MAX_VALUE, I just reduced it to 1000000000 and it now displays fine on all computers.

wow…well with this kind of values you gonna have serious z fighting issues

Read this http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html



If you are planning to make your game run on low hardware that have a 16 bit or even 8 bit z buffer you can’t keep that value.



Btw why do you need such a high value?

1 Like

What do you need this Large number for?

1.000.000.000 … 1 milliard Meters? Who can look so far? :smiley:

1 Like

That’s ok, I’ve reduced it to a sensible value, just wanted to play around with the settings to see what they do and how things work.



Just had a thought though, what if you wanted to do a space based game, and for instance the player/camera is at pluto, the sun is visible even though it’s 5,906,376,272 km away, so if the scale is in metres, wouldn’t the ‘far’ setting need to be 5,906,376,272,000 Or would you just use a different scale Eg. 1000KMs ? What would be the best approach?

Theres a lot of discussion about space games and scale around.



http://hub.jmonkeyengine.org/groups/general-2/forum/topic/the-design-of-a-large-scale-space-sim/