-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove unneeded
crossOrigin
configuration for THREE loaders (#5416)
Co-authored-by: Noeri Huisman <[email protected]>
- Loading branch information
Showing
2 changed files
with
1 addition
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,8 @@ | ||
var THREE = require('./three.module.js').default; | ||
|
||
// Allow cross-origin images to be loaded. | ||
|
||
// This should not be on `THREE.Loader` nor `THREE.ImageUtils`. | ||
// Must be on `THREE.TextureLoader`. | ||
if (THREE.TextureLoader) { | ||
THREE.TextureLoader.prototype.crossOrigin = 'anonymous'; | ||
} | ||
|
||
// This is for images loaded from the model loaders. | ||
if (THREE.ImageLoader) { | ||
THREE.ImageLoader.prototype.crossOrigin = 'anonymous'; | ||
} | ||
|
||
// In-memory caching for XHRs (for images, audio files, textures, etc.). | ||
if (THREE.Cache) { | ||
THREE.Cache.enabled = true; | ||
} | ||
|
||
THREE.DRACOLoader.prototype.crossOrigin = 'anonymous'; | ||
THREE.GLTFLoader.prototype.crossOrigin = 'anonymous'; | ||
THREE.KTX2Loader.prototype.crossOrigin = 'anonymous'; | ||
THREE.MTLLoader.prototype.crossOrigin = 'anonymous'; | ||
THREE.OBJLoader.prototype.crossOrigin = 'anonymous'; | ||
|
||
module.exports = THREE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters