Capítulo 204 de 859

Chapter 204: TextureLoader

Core Idea

Class for loading textures. Images are internally loaded via ImageLoader.

Please note that TextureLoader has dropped support for progress events in r84. For a TextureLoader that supports progress events, see this thread.

Code Examples

const loader = new THREE.TextureLoader();
const texture = await loader.loadAsync( 'textures/land_ocean_ice_cloud_2048.jpg' );
const material = new THREE.MeshBasicMaterial( { map:texture } );
  • What it demonstrates: Typical usage of TextureLoader.

Reference Tables

Constructor

Signature
new TextureLoader( manager : LoadingManager )

Methods

MethodDescription
.load( url : string, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback ) : TextureStarts loading from the given URL and pass the fully loaded texture to the onLoad() callback. The method also returns a new texture object which can directly be used for material creation. If you d…

Key Takeaways

  1. TextureLoader extends: Loader
  2. Key methods: load.

Connects To