Would it be possible to make the gl inject optional + an additional .setRenderer(gl) method on the loader (the LoaderBase class to be exact)? so that the end user can do:
const loader = new HDRJPGLoader()
loader.setRenderer(gl)
the THREE.Loader interface doesn't have a common interface because three lacks types, but it can generally be assumed that it is no parameters on the constructor + set functions, that's how most (all?) loaders worked. for instance:
const gltf = new GLTFLoader()
gltf.setDRACOLoader(new DRACOLoader())
this becomes important once you have loader managing layers that rely on uniform structure. one such example is react-three-fibers useLoader, but tresjs, threlte etc will run into the same problems.
we would like to add a shortcut/helper to drei but we can't rely on internals for that, it would be too risky. if we can rely on the api users would then be able to just do
Would it be possible to make the gl inject optional + an additional .setRenderer(gl) method on the loader (the LoaderBase class to be exact)? so that the end user can do:
the THREE.Loader interface doesn't have a common interface because three lacks types, but it can generally be assumed that it is no parameters on the constructor + set functions, that's how most (all?) loaders worked. for instance:
this becomes important once you have loader managing layers that rely on uniform structure. one such example is react-three-fibers useLoader, but tresjs, threlte etc will run into the same problems.
current workaround: https://codesandbox.io/p/sandbox/sleepy-jackson-hqct6n?file=%2Fsrc%2FApp.js%3A35%2C3-35%2C101
we would like to add a shortcut/helper to drei but we can't rely on internals for that, it would be too risky. if we can rely on the api users would then be able to just do