Texture getting CORS error, but HTML img Element displays the image

I’m trying to load some textures from a server I don’t have acces to allow cross origin. The thing is when I’m trying to create the texture I get CORS error, but with the same Url I can display the image on other components. Is there an extra setting for Texture to load image the way HTML Elements do?

Thank you!

HTML elements don’t need CORS policy set in order to show an image. An HTML image tag loads the image as is, the problem starts when you use javascript to async-load the image from the server.

TL;dr - you need to set the server’s CORS policy to use images in babylon.js


Thanks a lot!

1 Like