Hi do I stop an EXRLoader to load, I could not find the documentation.
Thank you!
Hi do I stop an EXRLoader to load, I could not find the documentation.
Thank you!
Loaders do not have a cancellation API. You could implement it like this:
let isCancelled = false;
loader.load('texture.exr', (texture) => {
if (isCancelled) return;
// ...
});
setTimeout(() => (isCancelled = true), 1000);
This sucks.
What about some destroy method to completely destroy the loader?
three.js implements .dispose()
methods mainly for classes with GPU resources, and generally not for loaders.
If you’d like to make a PR adding support for the newer AbortController + AbortSignal APIs for fetch(), I think that feature would be welcomed. It would probably look something like this:
const controller = new AbortController();
const loader = new EXRLoader().setSignal( controller.signal );
loader.load( 'texture.exr', ( texture ) => { ... } );
controller.abort();
Thank you for your help, I guess I have to find some logic for this to make it work in my project.
I find it wired not to have a stop-loading method or something like that, very wired…
Related issue at GitHub:
Thank you for clarifying this!