/** * Loads a texture. * * @param name * @param generateMipmaps Enable if applying texture to 3D objects, disable * for GUI/HUD elements. * @return */ public Texture loadTexture(String name, boolean generateMipmaps){ TextureKey key = new TextureKey(name, true); key.setGenerateMips(generateMipmaps); key.setAsCube(false); return loadTexture(key); }
key.setAsCube(type == VarType.TextureCubeMap); key.setGenerateMips(true);
public static Spatial createSky(AssetManager assetManager, String textureName, boolean sphereMap) { TextureKey key = new TextureKey(textureName, true); key.setGenerateMips(true); key.setAsCube(!sphereMap); Texture tex = assetManager.loadTexture(key); return createSky(assetManager, tex, sphereMap); } }
public Texture loadTexture(String name, boolean generateMipmaps, boolean flipY, boolean asCube, int aniso){ TextureKey key = new TextureKey(name, flipY); key.setGenerateMips(generateMipmaps); key.setAsCube(asCube); key.setAnisotropy(aniso); return loadTexture(key); }
texKey.setAsCube(cubic);
private void readExtendingMaterialStatement(Statement statement) throws IOException { if (statement.getLine().startsWith("set_texture_alias")){ String[] split = statement.getLine().split(" ", 3); String aliasName = split[1]; String texturePath = split[2]; String jmeParamName = matExt.getTextureMapping(aliasName); TextureKey texKey = new TextureKey(texturePath, false); texKey.setGenerateMips(true); texKey.setAsCube(false); Texture tex; try { tex = assetManager.loadTexture(texKey); tex.setWrap(WrapMode.Repeat); } catch (AssetNotFoundException ex){ logger.log(Level.WARNING, "Cannot locate {0} for material {1}", new Object[]{texKey, key}); tex = new Texture2D( PlaceholderAssets.getPlaceholderImage() ); tex.setWrap(WrapMode.Repeat); tex.setKey(texKey); } material.setTexture(jmeParamName, tex); } }
private void readExtendingMaterialStatement(Statement statement) throws IOException { if (statement.getLine().startsWith("set_texture_alias")){ String[] split = statement.getLine().split(" ", 3); String aliasName = split[1]; String texturePath = split[2]; String jmeParamName = matExt.getTextureMapping(aliasName); TextureKey texKey = new TextureKey(texturePath, false); texKey.setGenerateMips(true); texKey.setAsCube(false); Texture tex; try { tex = assetManager.loadTexture(texKey); tex.setWrap(WrapMode.Repeat); } catch (AssetNotFoundException ex){ logger.log(Level.WARNING, "Cannot locate {0} for material {1}", new Object[]{texKey, key}); tex = new Texture2D( PlaceholderAssets.getPlaceholderImage() ); tex.setWrap(WrapMode.Repeat); tex.setKey(texKey); } material.setTexture(jmeParamName, tex); } }