Hi, I am trying to load base64 data from canvas and assign it to glb object mesh, all worked but the texture shows only white color instead colorful image.
I checked by downloading that image data it shows colorful image that is assigning.
Aslo when I am creating texture from giving direct url saved from downloaded image it shows colors.
here is my sample code
const image = new Image();
image.onload = () => {
console.log("Image onload fired....");
const texture = new THREE.Texture(image);
texture.encoding = THREE.sRGBEncoding // added later to check
texture.needsUpdate = true; // Indicate that the texture needs to be updated
if (callback) {
console.log("Texure call back fired...");
callback(texture);
}
};
image.src = iconData;
Can any one guide what am I missing or have proper way to achieve?