Closed Noobulater closed 1 week ago
Failing in the detectSupport
method in GLTFLoader
I Also believe its broken for GLTFTextureAVIFExtension but I don't use that.
But a png and/or jpg works?
@mrdoob Yes, because detectSupport()
is only used in context of the WebP and AVIF glTF extension. The detectSupport()
implementations have a dependency to Image
which is not available in a web worker.
I wonder if detectSupport()
of GLTFTextureWebPExtension
and GLTFTextureAVIFExtension
can be rewritten based on ImageBitmap
which should solve the issue.
Small PRs fixing issues with using GLTFLoader in Web Workers, Node.js, or Deno are welcome. Some complex adaptations to other runtime environments might be out of scope for three.js, and would need to be handled at the application level, or by forking the loader. I'm happy to review PRs, but unless someone has bandwidth to work on support for these environments (I do not) I'd prefer to close the issue.
Description
A GLTFLoader created in a webworker can't load webp files. The issue stems from attempting to use
Image
in a webworker, which doesn't exist.Reproduction steps
Version
r167