()
| 51 | } |
| 52 | |
| 53 | load() { |
| 54 | |
| 55 | const assets = this.assets; |
| 56 | const loadingManager = this.loadingManager; |
| 57 | const textureLoader = new TextureLoader(loadingManager); |
| 58 | const smaaImageLoader = new SMAAImageLoader(loadingManager); |
| 59 | |
| 60 | const anisotropy = Math.min(this.composer.getRenderer() |
| 61 | .capabilities.getMaxAnisotropy(), 8); |
| 62 | |
| 63 | return new Promise((resolve, reject) => { |
| 64 | |
| 65 | if(assets.size === 0) { |
| 66 | |
| 67 | loadingManager.onLoad = () => setTimeout(resolve, 250); |
| 68 | loadingManager.onProgress = ProgressManager.updateProgress; |
| 69 | loadingManager.onError = url => console.error(`Failed to load ${url}`); |
| 70 | |
| 71 | Sponza.load(assets, loadingManager, anisotropy); |
| 72 | |
| 73 | textureLoader.load("textures/scratches.jpg", (t) => { |
| 74 | |
| 75 | t.colorSpace = SRGBColorSpace; |
| 76 | t.wrapS = t.wrapT = RepeatWrapping; |
| 77 | assets.set("scratches-color", t); |
| 78 | |
| 79 | }); |
| 80 | |
| 81 | smaaImageLoader.load(([search, area]) => { |
| 82 | |
| 83 | assets.set("smaa-search", search); |
| 84 | assets.set("smaa-area", area); |
| 85 | |
| 86 | }); |
| 87 | |
| 88 | } else { |
| 89 | |
| 90 | resolve(); |
| 91 | |
| 92 | } |
| 93 | |
| 94 | }); |
| 95 | |
| 96 | } |
| 97 | |
| 98 | initialize() { |
| 99 |
nothing calls this directly
no test coverage detected