()
| 122 | } |
| 123 | |
| 124 | load() { |
| 125 | |
| 126 | const luts = this.luts; |
| 127 | const assets = this.assets; |
| 128 | const loadingManager = this.loadingManager; |
| 129 | const textureLoader = new TextureLoader(loadingManager); |
| 130 | const lut3dlLoader = new LUT3dlLoader(loadingManager); |
| 131 | const lutCubeLoader = new LUTCubeLoader(loadingManager); |
| 132 | const smaaImageLoader = new SMAAImageLoader(loadingManager); |
| 133 | |
| 134 | const anisotropy = Math.min(this.composer.getRenderer() |
| 135 | .capabilities.getMaxAnisotropy(), 8); |
| 136 | |
| 137 | return new Promise((resolve, reject) => { |
| 138 | |
| 139 | if(assets.size === 0) { |
| 140 | |
| 141 | loadingManager.onLoad = () => setTimeout(resolve, 250); |
| 142 | loadingManager.onProgress = ProgressManager.updateProgress; |
| 143 | loadingManager.onError = url => console.error(`Failed to load ${url}`); |
| 144 | |
| 145 | Sponza.load(assets, loadingManager, anisotropy); |
| 146 | |
| 147 | for(const entry of luts) { |
| 148 | |
| 149 | if(entry[1] === null) { |
| 150 | |
| 151 | continue; |
| 152 | |
| 153 | } |
| 154 | |
| 155 | if(/.3dl$/im.test(entry[1])) { |
| 156 | |
| 157 | lut3dlLoader.load(`textures/lut/${entry[1]}`, (t) => { |
| 158 | |
| 159 | t.name = entry[0]; |
| 160 | assets.set(entry[0], t); |
| 161 | |
| 162 | }); |
| 163 | |
| 164 | } else if(/.cube$/im.test(entry[1])) { |
| 165 | |
| 166 | lutCubeLoader.load(`textures/lut/${entry[1]}`, (t) => { |
| 167 | |
| 168 | t.name = entry[0]; |
| 169 | assets.set(entry[0], t); |
| 170 | |
| 171 | }); |
| 172 | |
| 173 | } else { |
| 174 | |
| 175 | textureLoader.load(`textures/lut/${entry[1]}`, (t) => { |
| 176 | |
| 177 | t.name = entry[0]; |
| 178 | t.generateMipmaps = false; |
| 179 | t.minFilter = LinearFilter; |
| 180 | t.magFilter = LinearFilter; |
| 181 | t.wrapS = ClampToEdgeWrapping; |
nothing calls this directly
no test coverage detected