()
| 44 | } |
| 45 | |
| 46 | load() { |
| 47 | |
| 48 | const assets = this.assets; |
| 49 | const loadingManager = this.loadingManager; |
| 50 | const smaaImageLoader = new SMAAImageLoader(loadingManager); |
| 51 | |
| 52 | const anisotropy = Math.min(this.composer.getRenderer() |
| 53 | .capabilities.getMaxAnisotropy(), 8); |
| 54 | |
| 55 | return new Promise((resolve, reject) => { |
| 56 | |
| 57 | if(assets.size === 0) { |
| 58 | |
| 59 | loadingManager.onLoad = () => setTimeout(resolve, 250); |
| 60 | loadingManager.onProgress = ProgressManager.updateProgress; |
| 61 | loadingManager.onError = url => console.error(`Failed to load ${url}`); |
| 62 | |
| 63 | Sponza.load(assets, loadingManager, anisotropy); |
| 64 | |
| 65 | smaaImageLoader.load(([search, area]) => { |
| 66 | |
| 67 | assets.set("smaa-search", search); |
| 68 | assets.set("smaa-area", area); |
| 69 | |
| 70 | }); |
| 71 | |
| 72 | } else { |
| 73 | |
| 74 | resolve(); |
| 75 | |
| 76 | } |
| 77 | |
| 78 | }); |
| 79 | |
| 80 | } |
| 81 | |
| 82 | /** |
| 83 | * Creates the scene. |
nothing calls this directly
no test coverage detected