Capítulo 170 de 859

Chapter 170: HDRCubeTextureLoader

Core Idea

A loader for loading HDR cube textures.

Key Concepts

  • hdrLoader : HDRLoader: The internal HDR loader that loads the individual textures for each cube face.
  • type : HalfFloatType | FloatType: The texture type.

Code Examples

const loader = new HDRCubeTextureLoader();
loader.setPath( 'textures/cube/pisaHDR/' );
const cubeTexture = await loader.loadAsync( [ 'px.hdr', 'nx.hdr', 'py.hdr', 'ny.hdr', 'pz.hdr', 'nz.hdr' ] );
scene.background = cubeTexture;
scene.environment = cubeTexture;
  • What it demonstrates: Typical usage of HDRCubeTextureLoader.

Reference Tables

Constructor

Signature
new HDRCubeTextureLoader( manager : LoadingManager )

Properties

PropertyDescription
.hdrLoader : HDRLoaderThe internal HDR loader that loads the individual textures for each cube face.
`.type : HalfFloatTypeFloatType`

Methods

MethodDescription
.load( urls : Array.<string>, onLoad : function, onProgress : onProgressCallback, onError : onErrorCallback ) : CubeTextureStarts loading from the given URLs and passes the loaded HDR cube texture to the onLoad() callback.
`.setDataType( value : HalfFloatTypeFloatType ) : HDRCubeTextureLoader`

Key Takeaways

  1. HDRCubeTextureLoader extends: Loader
  2. Most relevant properties: hdrLoader, type.
  3. Key methods: load, setDataType.

Connects To