Skip to content

Commit e86d107

Browse files
authored
Remove unneeded crossOrigin configuration for THREE loaders (#5416)
Co-authored-by: Noeri Huisman <mrxz@users.noreply.github.com>
1 parent c6962ad commit e86d107

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

src/lib/three.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,8 @@
11
var THREE = require('./three.module.js').default;
22

3-
// Allow cross-origin images to be loaded.
4-
5-
// This should not be on `THREE.Loader` nor `THREE.ImageUtils`.
6-
// Must be on `THREE.TextureLoader`.
7-
if (THREE.TextureLoader) {
8-
THREE.TextureLoader.prototype.crossOrigin = 'anonymous';
9-
}
10-
11-
// This is for images loaded from the model loaders.
12-
if (THREE.ImageLoader) {
13-
THREE.ImageLoader.prototype.crossOrigin = 'anonymous';
14-
}
15-
163
// In-memory caching for XHRs (for images, audio files, textures, etc.).
174
if (THREE.Cache) {
185
THREE.Cache.enabled = true;
196
}
207

21-
THREE.DRACOLoader.prototype.crossOrigin = 'anonymous';
22-
THREE.GLTFLoader.prototype.crossOrigin = 'anonymous';
23-
THREE.KTX2Loader.prototype.crossOrigin = 'anonymous';
24-
THREE.MTLLoader.prototype.crossOrigin = 'anonymous';
25-
THREE.OBJLoader.prototype.crossOrigin = 'anonymous';
26-
278
module.exports = THREE;

src/lib/three.module.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import { MTLLoader } from 'super-three/examples/jsm/loaders/MTLLoader';
88
import * as BufferGeometryUtils from 'super-three/examples/jsm/utils/BufferGeometryUtils';
99
import { LightProbeGenerator } from 'super-three/examples/jsm/lights/LightProbeGenerator';
1010

11-
var objectAssign = require('object-assign');
12-
var THREE = window.THREE = objectAssign({}, SUPER_THREE);
11+
var THREE = window.THREE = SUPER_THREE;
1312

1413
// TODO: Eventually include these only if they are needed by a component.
1514
require('../../vendor/DeviceOrientationControls'); // THREE.DeviceOrientationControls

0 commit comments

Comments
 (0)