Capítulo 164 de 859

Chapter 164: EXRLoader

Core Idea

A loader for the OpenEXR texture format.

EXRLoader currently supports uncompressed, ZIP(S), RLE, PIZ, B44/A and DWA/B compression. Supports reading as UnsignedByte, HalfFloat and Float type data texture.

Key Concepts

  • outputFormat : RGBAFormat | RGFormat | RedFormat: Texture output format.
  • part : number: For multi-part EXR files, the index of the part to load.
  • type : HalfFloatType | FloatType: The texture type.

Code Examples

const loader = new EXRLoader();
const texture = await loader.loadAsync( 'textures/memorial.exr' );
  • What it demonstrates: Typical usage of EXRLoader.

Reference Tables

Constructor

Signature
new EXRLoader( manager : LoadingManager )

Properties

PropertyDescription
`.outputFormat : RGBAFormatRGFormat
.part : numberFor multi-part EXR files, the index of the part to load.
`.type : HalfFloatTypeFloatType`

Methods

MethodDescription
.parse( buffer : ArrayBuffer ) : DataTextureLoader~TexDataParses the given EXR texture data.
`.setDataType( value : HalfFloatTypeFloatType ) : EXRLoader`
`.setOutputFormat( value : RGBAFormatRGFormat
.setPart( value : number ) : EXRLoaderFor multi-part EXR files, sets which part to load.

Key Takeaways

  1. EXRLoader extends: Loader → DataTextureLoader
  2. Most relevant properties: outputFormat, part, type.
  3. Key methods: parse, setDataType, setOutputFormat, setPart.

Connects To