/** * Create a sky using the given cubemap or spheremap texture. * * @param assetManager from which to load materials * @param texture to use * @param envMapType see {@link EnvMapType} * @return a new spatial representing the sky, ready to be attached to the * scene graph */ public static Spatial createSky(AssetManager assetManager, Texture texture, EnvMapType envMapType) { return createSky(assetManager, texture, Vector3f.UNIT_XYZ, envMapType); }
/** * Create a cube-mapped sky using six textures. * * @param assetManager from which to load materials * @param west texture for the western face of the cube * @param east texture for the eastern face of the cube * @param north texture for the northern face of the cube * @param south texture for the southern face of the cube * @param up texture for the top face of the cube * @param down texture for the bottom face of the cube * * @return a new spatial representing the sky, ready to be attached to the * scene graph */ public static Spatial createSky(AssetManager assetManager, Texture west, Texture east, Texture north, Texture south, Texture up, Texture down) { return createSky(assetManager, west, east, north, south, up, down, Vector3f.UNIT_XYZ); } }
/** * Create a sky with radius=10 using the given cubemap or spheremap texture. * * For the sky to be visible, its radius must fall between the near and far * planes of the camera's frustum. * * @param assetManager from which to load materials * @param texture to use * @param normalScale The normal scale is multiplied by the 3D normal to get * a texture coordinate. Use Vector3f.UNIT_XYZ to not apply and * transformation to the normal. * @param envMapType see {@link EnvMapType} * @return a new spatial representing the sky, ready to be attached to the * scene graph */ public static Spatial createSky(AssetManager assetManager, Texture texture, Vector3f normalScale, EnvMapType envMapType) { return createSky(assetManager, texture, normalScale, envMapType, 10); } /**
/** * Create a cube-mapped sky with radius=10 using six textures. * * For the sky to be visible, its radius must fall between the near and far * planes of the camera's frustum. * * @param assetManager from which to load materials * @param west texture for the western face of the cube * @param east texture for the eastern face of the cube * @param north texture for the northern face of the cube * @param south texture for the southern face of the cube * @param up texture for the top face of the cube * @param down texture for the bottom face of the cube * @param normalScale The normal scale is multiplied by the 3D normal to get * a texture coordinate. Use Vector3f.UNIT_XYZ to not apply and * transformation to the normal. * @return a new spatial representing the sky, ready to be attached to the * scene graph */ public static Spatial createSky(AssetManager assetManager, Texture west, Texture east, Texture north, Texture south, Texture up, Texture down, Vector3f normalScale) { return createSky(assetManager, west, east, north, south, up, down, normalScale, 10); }
/** * Create a sky using the given cubemap or spheremap texture. * * @param assetManager from which to load materials * @param textureName the path to the texture asset to use * @param sphereMap determines how the texture is used:<br> * <ul> * <li>true: The texture is a Texture2D with the pixels arranged for * <a href="http://en.wikipedia.org/wiki/Sphere_mapping">sphere * mapping</a>.</li> * <li>false: The texture is either a TextureCubeMap or Texture2D. If it is * a Texture2D then the image is taken from it and is inserted into a * TextureCubeMap</li> * </ul> * @return a new spatial representing the sky, ready to be attached to the * scene graph * @deprecated use {@link SkyFactory#createSky(com.jme3.asset.AssetManager, java.lang.String, com.jme3.math.Vector3f, com.jme3.util.SkyFactory.EnvMapType)} */ @Deprecated public static Spatial createSky(AssetManager assetManager, String textureName, boolean sphereMap) { return createSky(assetManager, textureName, sphereMap?EnvMapType.SphereMap:EnvMapType.CubeMap); }
/** * Create a sky using the given cubemap or spheremap texture. * * @param assetManager from which to load materials * @param texture to use * * @param sphereMap determines how the texture is used:<br> * <ul> * <li>true: The texture is a Texture2D with the pixels arranged for * <a href="http://en.wikipedia.org/wiki/Sphere_mapping">sphere * mapping</a>.</li> * <li>false: The texture is either a TextureCubeMap or Texture2D. If it is * a Texture2D then the image is taken from it and is inserted into a * TextureCubeMap</li> * </ul> * @return a new spatial representing the sky, ready to be attached to the * scene graph * @deprecated use {@link SkyFactory#createSky(com.jme3.asset.AssetManager, com.jme3.texture.Texture, com.jme3.math.Vector3f, com.jme3.util.SkyFactory.EnvMapType)} */ @Deprecated public static Spatial createSky(AssetManager assetManager, Texture texture, boolean sphereMap) { return createSky(assetManager, texture, Vector3f.UNIT_XYZ, sphereMap?EnvMapType.SphereMap:EnvMapType.CubeMap); }
/** * Create a sky with radius=10 using the given cubemap or spheremap texture. * * For the sky to be visible, its radius must fall between the near and far * planes of the camera's frustum. * * @param assetManager from which to load materials * @param texture to use * @param normalScale The normal scale is multiplied by the 3D normal to get * a texture coordinate. Use Vector3f.UNIT_XYZ to not apply and * transformation to the normal. * @param sphereMap determines how the texture is used:<br> * <ul> * <li>true: The texture is a Texture2D with the pixels arranged for * <a href="http://en.wikipedia.org/wiki/Sphere_mapping">sphere * mapping</a>.</li> * <li>false: The texture is either a TextureCubeMap or Texture2D. If it is * a Texture2D then the image is taken from it and is inserted into a * TextureCubeMap</li> * </ul> * @return a new spatial representing the sky, ready to be attached to the * scene graph * @deprecated use {@link SkyFactory#createSky(com.jme3.asset.AssetManager, com.jme3.texture.Texture, com.jme3.math.Vector3f, com.jme3.util.SkyFactory.EnvMapType)} */ @Deprecated public static Spatial createSky(AssetManager assetManager, Texture texture, Vector3f normalScale, boolean sphereMap) { return createSky(assetManager, texture, normalScale, sphereMap, 10); }
private void createSky() { rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", SkyFactory.EnvMapType.CubeMap)); }
public void setupSkyBox() { rootNode.attachChild(SkyFactory.createSky(assetManager, "Scenes/Beach/FullskiesSunset0068.dds", SkyFactory.EnvMapType.CubeMap)); } DirectionalLight dl;
public void setupSkyBox() { rootNode.attachChild(SkyFactory.createSky(assetManager, "Scenes/Beach/FullskiesSunset0068.dds", SkyFactory.EnvMapType.CubeMap)); } DirectionalLight dl;
public void setupSkyBox() { Texture envMap; if (renderer.getCaps().contains(Caps.FloatTexture)) { envMap = assetManager.loadTexture("Textures/Sky/St Peters/StPeters.hdr"); } else { envMap = assetManager.loadTexture("Textures/Sky/St Peters/StPeters.jpg"); } Spatial sky = SkyFactory.createSky(assetManager, envMap, new Vector3f(-1f, -1f, -1f), EnvMapType.SphereMap); rootNode.attachChild(sky); }
public void setupSkyBox(){ Texture envMap; if (renderer.getCaps().contains(Caps.FloatTexture)){ envMap = assetManager.loadTexture("Textures/Sky/St Peters/StPeters.hdr"); }else{ envMap = assetManager.loadTexture("Textures/Sky/St Peters/StPeters.jpg"); } rootNode.attachChild(SkyFactory.createSky(assetManager, envMap, new Vector3f(-1,-1,-1), SkyFactory.EnvMapType.SphereMap)); }
/** * Create a sky using the given cubemap or spheremap texture. * * @param assetManager from which to load materials * @param textureName the path to the texture asset to use * @param envMapType see {@link EnvMapType} * @return a new spatial representing the sky, ready to be attached to the * scene graph */ public static Spatial createSky(AssetManager assetManager, String textureName, EnvMapType envMapType) { TextureKey key = new TextureKey(textureName, true); key.setGenerateMips(false); if (envMapType == EnvMapType.CubeMap) { key.setTextureTypeHint(Texture.Type.CubeMap); } Texture tex = assetManager.loadTexture(key); return createSky(assetManager, tex, envMapType); }
@Override public void simpleInitApp() { cam.setLocation(new Vector3f(3, 3, 3)); cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y); Texture offTex = setupOffscreenView(); Spatial sky = SkyFactory.createSky(assetManager, offTex, EnvMapType.CubeMap); rootNode.attachChild(sky); }
public void simpleInitApp() { Texture west = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_west.jpg"); Texture east = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_east.jpg"); Texture north = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_north.jpg"); Texture south = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_south.jpg"); Texture up = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_up.jpg"); Texture down = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_down.jpg"); Spatial sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down); rootNode.attachChild(sky); }
private void makeScene() { // load sky rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", SkyFactory.EnvMapType.CubeMap)); //assetManager.registerLocator("http://jmonkeyengine.googlecode.com/files/wildhouse.zip", HttpZipLocator.class); Spatial scene = assetManager.loadModel("Models/Test/CornellBox.j3o"); DirectionalLight sun = new DirectionalLight(); sun.setDirection(new Vector3f(-0.4790551f, -0.39247334f, -0.7851566f)); scene.addLight(sun); rootNode.attachChild(scene); } }
private void createSky() { Texture west = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_west.jpg"); Texture east = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_east.jpg"); Texture north = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_north.jpg"); Texture south = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_south.jpg"); Texture up = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_up.jpg"); Texture down = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_down.jpg"); Spatial sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down); rootNode.attachChild(sky); }
private void createSky() { Texture west = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_west.jpg"); Texture east = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_east.jpg"); Texture north = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_north.jpg"); Texture south = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_south.jpg"); Texture up = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_up.jpg"); Texture down = assetManager.loadTexture("Textures/Sky/Lagoon/lagoon_down.jpg"); Spatial sky = SkyFactory.createSky(assetManager, west, east, north, south, up, down); rootNode.attachChild(sky); }
rootNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", SkyFactory.EnvMapType.CubeMap));
private void initScene() { //init cam location cam.setLocation(new Vector3f(0, 10, 10)); cam.lookAt(Vector3f.ZERO, Vector3f.UNIT_Y); //init scene sceneNode = new Node("Scene"); mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); Box b = new Box(1, 1, 1); Geometry geom = new Geometry("Box", b); geom.setMaterial(mat); sceneNode.attachChild(geom); // load sky sceneNode.attachChild(SkyFactory.createSky(assetManager, "Textures/Sky/Bright/BrightSky.dds", SkyFactory.EnvMapType.CubeMap)); rootNode.attachChild(sceneNode); //add lightPos Geometry Sphere lite=new Sphere(8, 8, 3.0f); lightSphere=new Geometry("lightsphere", lite); lightSphere.setMaterial(mat); lightSphere.setLocalTranslation(lightPos); rootNode.attachChild(lightSphere); }