Here is an example for how you add a static horizon (a background landscape and a sky) to a scene. Having a discernable horizon with a suitable landscape (or space, or ocean, or whatever) in the background makes scenes look more realistic than just a single-colored "sky" background.
Adding a sky is extremely easy using the com.jme3.util.SkyFactory
.
rootNode.attachChild(SkyFactory.createSky( assetManager, "Textures/Sky/Bright/BrightSky.dds", false));
To add a sky you need to supply:
Internally, the SkyFactory calls the following methods:
sky.setQueueBucket(Bucket.Sky);
makes certain the sky is rendered in the right order, behind everything else.sky.setCullHint(Spatial.CullHint.Never);
makes certain that the sky is never culled.Sky.j3md
. This Material definition works with sphere and cube maps.As the sky texture we use the sample BrightSky.dds file from jme3test-test-data.
How to create a sky textures?
Box or Sphere?