Question about loading .exr files

I’m trying to borrow speckle’s rendering engine to add a 360 viewer feature, and I’m having a problem when I introduce .exr files, I’ve processed the .exr files with the same methods and ideas I used to introduce the .png files, and I’ve never been able to introduce the files correctly.
Also, I saw that there is ‘getTexture’ function in the Assets.ts file to load the exr file directly, so am I getting the ask through this function if the introduction of the resource is successful?
Thanks for your reply!

Hi @zm1072223921

You can indeed load textures, including .exr formats through Assets like so:

const exrTexture = await Assets.getTexture({
  id: 'userDefinedId',
  src: 'textureURL',
  type: AssetType.TEXTURE_EXR
})

Alternatively you can just load them using three.js directly.

After loading them, you will have a three.js Texture which will work behave just like any other texture

Cheers

In fact, my problem is that I can’t reference resources correctly.For example, when I use the 'improt xxx from ‘./xxx.exr’ file, the compiler will report errors, and the same method will not reference .png files

That’s something that has to do with the project build setup and/or bundler and the things you need to do will vary from framework to framework. It’s not speckle viewer related.

In our sandbox we decided to keep things simple, and we just have .exr (or any format for that matter) as .png files which vite seems to handle by default with no need for extra configuration or plugins.