private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + NORMAL_FILE_SUFFIX + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }
private static void handleTexture(Mesh mesh, MD5Mesh md5Mesh, Vector4f defaultColour) throws Exception { String texturePath = md5Mesh.getTexture(); if (texturePath != null && texturePath.length() > 0) { Texture texture = new Texture(texturePath); Material material = new Material(texture); // Handle normal Maps; int pos = texturePath.lastIndexOf("."); if (pos > 0) { String basePath = texturePath.substring(0, pos); String extension = texturePath.substring(pos, texturePath.length()); String normalMapFileName = basePath + "_local" + extension; if (Utils.existsResourceFile(normalMapFileName)) { Texture normalMap = new Texture(normalMapFileName); material.setNormalMap(normalMap); } } mesh.setMaterial(material); } else { mesh.setMaterial(new Material(defaultColour, 1)); } } }