Using base 64 string as a normal map

Hello, im trying to use a base 64 string as a normal map on one of my models, following some online examples has not yielded any results.

var curObj = mesh.getObjectByName(object + "_low")
var image = new Image()
var texture = new THREE.Texture(image)
image.src = reader.result
curObj.material.normalMap = image
image.onload = function() { texture.needsUpdate = true }

object is a string with the models name, reader.result is the base 64 string.

Hey @Mal0n1 ,

curObj.material.normalMap requires a texture instead of an image.

Also, it might be good to define image.onload before image.src = .... Sometimes the browser cache may be instant. But thats an old man habits.


Hopefully you are now able to resume your journey of building amazing threejs stuff !