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 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); }
private Image loadImageSafe(AssetManager assetManager, TextureKey texKey) { try { return assetManager.loadTexture(texKey).getImage(); } catch (AssetNotFoundException ex) { return null; } catch (AssetLoadException ex) { logger.log(Level.WARNING, "Error when loading image: " + texKey, ex); return null; } }
protected void loadTextures(AssetManager manager) { normalTexture = (Texture2D) manager.loadTexture("Common/MatDefs/Water/Textures/water_normalmap.png"); dudvTexture = (Texture2D) manager.loadTexture("Common/MatDefs/Water/Textures/dudv_map.jpg"); normalTexture.setWrap(WrapMode.Repeat); dudvTexture.setWrap(WrapMode.Repeat); }
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)); }
public static Material getPlaceholderMaterial(AssetManager assetManager){ Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); Texture tex = assetManager.loadTexture("Common/Textures/MissingMaterial.png"); tex.setWrap(Texture.WrapMode.Repeat); mat.setTexture("ColorMap", tex); return mat; }
private TextureKey setupMockForTexture(final String paramName, final String path, final boolean flipY, final Texture texture) { when(materialDef.getMaterialParam(paramName)).thenReturn(new MatParamTexture(VarType.Texture2D, paramName, texture, null)); final TextureKey textureKey = new TextureKey(path, flipY); textureKey.setGenerateMips(true); when(assetManager.loadTexture(textureKey)).thenReturn(texture); return textureKey; } }
public Geometry createHDRBox(){ Box boxMesh = new Box(1, 1, 1); Geometry box = new Geometry("Box", boxMesh); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Textures/HdrTest/Memorial.hdr")); box.setMaterial(mat); return box; }
@Override public void simpleInitApp() { Box b = new Box(1, 1, 1); Geometry geom = new Geometry("Box", b); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); geom.setMaterial(mat); rootNode.attachChild(geom); System.out.println("Attaching test state."); stateManager.attach(new TestState()); }
public static Spatial getPlaceholderModel(AssetManager assetManager){ // What should be the size? Nobody knows // the user's expected scale... Box box = new Box(1, 1, 1); Geometry geom = new Geometry("placeholder", box); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); Texture tex = assetManager.loadTexture("Common/Textures/MissingModel.png"); tex.setWrap(Texture.WrapMode.Repeat); mat.setTexture("ColorMap", tex); geom.setMaterial(mat); return geom; }
@Override public void simpleInitApp() { Box box = new Box(1, 1, 1); Geometry geom = new Geometry("Box", box); mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); geom.setMaterial(mat); rootNode.attachChild(geom); }
@Override public void simpleInitApp() { Box b = new Box(1, 1, 1); Geometry geom = new Geometry("Box", b); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); geom.setMaterial(mat); rootNode.attachChild(geom); }
@Override public Image loadImage(final String filename) { TextureKey key = new TextureKey(filename, false); key.setAnisotropy(0); key.setGenerateMips(false); Texture2D texture = (Texture2D) display.getAssetManager().loadTexture(key); return new ImageImpl(texture.getImage()); }
@Override public void simpleInitApp() { Box b = new Box(1, 1, 1); Geometry geom = new Geometry("Box", b); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); geom.setMaterial(mat); rootNode.attachChild(geom); }
@Override public void simpleInitApp() { flyCam.setDragToRotate(true); Box b = new Box(1, 1, 1); Geometry geom = new Geometry("Box", b); Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); geom.setMaterial(mat); rootNode.attachChild(geom); } }
@Override public void simpleInitApp() { Quad quadMesh = new Quad(512,512); Geometry quad = new Geometry("Quad", quadMesh); quad.setQueueBucket(Bucket.Gui); mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); mat.setTexture("ColorMap", assetManager.loadTexture("Textures/ColoredTex/Monkey.png")); quad.setMaterial(mat); guiNode.attachChildAt(quad, 0); nextColor = ColorRGBA.randomColor(); prevColor = ColorRGBA.Black; }
public RenderImageJme(String filename, boolean linear, NiftyJmeDisplay display){ TextureKey key = new TextureKey(filename, true); key.setAnisotropy(0); key.setGenerateMips(false); texture = (Texture2D) display.getAssetManager().loadTexture(key); texture.setMagFilter(linear ? MagFilter.Bilinear : MagFilter.Nearest); texture.setMinFilter(linear ? MinFilter.BilinearNoMipMaps : MinFilter.NearestNoMipMaps); image = texture.getImage(); width = image.getWidth(); height = image.getHeight(); }
private void setupPlanet() { Material material = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); material.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); //immovable sphere with mesh collision shape Sphere sphere = new Sphere(64, 64, 20); planet = new Geometry("Sphere", sphere); planet.setMaterial(material); planet.setLocalTranslation(30, -15, 30); planet.addControl(new RigidBodyControl(new MeshCollisionShape(sphere), 0)); rootNode.attachChild(planet); getPhysicsSpace().add(planet); }