Skip to content
Advertisement

Load textures from Base64 in Three.js

I am currently loading textures from URLs but since my back-end code is generating planets I need them to be displayed using Base64.

(I’m playing around with procedural generation so I’d prefer not to save the image and then load it via URL)

Here’s the code;

JavaScript

I have tried;

JavaScript

But it doesn’t seem to be working correctly.

Any help would be greatly appreciated, thanks.

Advertisement

Answer

Turns out I had to do;

JavaScript

Instead of;

JavaScript

new event listener;

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement