if (fileName.toLowerCase().endsWith(".pfm")) {
return new PFMTexture(textureFile);
} else if (fileName.toLowerCase().endsWith(".hdr")) {
return new HDRTexture(textureFile);
} else {
return new SkymapTexture(ImageIO.read(textureFile));
}
} catch (IOException e) {
logger.warn("Could not load skymap: " + fileName);
} catch (Throwable e) {
logger.error("Unexpected exception ocurred!", e);