Three.js r72
I'm trying to use the same texture with different offsets and repeats, but after I clone the texture and apply needsUpdate I keep getting an error "Texture marked for update but image is undefined". I check the cloned texture and the image property is undefined. Shouldn't the clone method have referenced the source image from the texture in the textures Object.
var textures = {} var materials = {} textures.skin = THREE.ImageUtils.loadTexture('skin.png'); textures.skin.minFilter = THREE.NearestFilter; textures.skin.magFilter = THREE.NearestFilter; skin.map_data.forEach(function(item) { var mats = [] item.maps.forEach(function(item) { var tex = textures.skin.clone(); tex.needsUpdate = true; tex.offset.x = ((1 / skin.width) * item.offset_x) tex.offset.y = ((1 / skin.height) * item.offset_y) tex.repeat.x = ((1 / skin.width) * item.width); tex.repeat.y = ((1 / skin.height) * item.height); var mat = new THREE.MeshBasicMaterial({ map: tex }); mats.push(mat); }) materials[item.name] = new THREE.MeshFaceMaterial(mats) })