Get Texture Image from glb file

Hi all,

how can i extract texture image from glb file?

I’ve tried the method on this topic Get texture source from GLB files but still not working

this is my PG: https://playground.babylonjs.com/#HV2W7Y#3

thank you :slight_smile:

You’re very close, you can get the textures from the asset container like so assets.textures this will give you an array with all the textures in the .glb scene. Once you have them you can easily assign them to another material.

Here it is in the playground.
https://playground.babylonjs.com/#HV2W7Y#2

but I want the texture image to be used on the img.src element. is there a way to convert that texture into an image file?

finally I found the answer :grin:, I took the buffer from the texture then changed it to base64 and put it into the image element.

this is my PG : https://playground.babylonjs.com/#0AM2NX#10

2 Likes