Permalink
* WebGLRenderer: Make use of SRGB8_ALPHA8. * Update screenshots. * Updated builds. * Revert "Update screenshots." This reverts commit 9f7c6cb. * Update screenshots. * Examples: Let SSRPass and SSRrPass work in linear space. * Examples: Clean up. * PMREMGenerator: Avoid inline decode/encode when using SRGB8_ALPHA8. * Updated builds. * Update screenshots. * Revert "Updated builds." This reverts commit 0fd81f8. * Revert "Updated builds." This reverts commit 447e88a.
41 lines (23 sloc)
679 Bytes
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
| import { ImageLoader } from './ImageLoader.js'; | |
| import { Texture } from '../textures/Texture.js'; | |
| import { Loader } from './Loader.js'; | |
| class TextureLoader extends Loader { | |
| constructor( manager ) { | |
| super( manager ); | |
| } | |
| load( url, onLoad, onProgress, onError ) { | |
| const texture = new Texture(); | |
| const loader = new ImageLoader( this.manager ); | |
| loader.setCrossOrigin( this.crossOrigin ); | |
| loader.setPath( this.path ); | |
| loader.load( url, function ( image ) { | |
| texture.image = image; | |
| texture.needsUpdate = true; | |
| if ( onLoad !== undefined ) { | |
| onLoad( texture ); | |
| } | |
| }, onProgress, onError ); | |
| return texture; | |
| } | |
| } | |
| export { TextureLoader }; |