Browse Source

Rename RGBELoader to HDRLoader (#31604)

* Rename RGBELoader to HDRLoader across examples/jsm, update imports/usages/docs, and adjust HDRCubeTextureLoader to depend on HDRLoader

* Clean up.

* Clean up.

* Clean up.

* Clean up.
mrdoob 6 months ago
parent
commit
3ebc5c310c
58 changed files with 622 additions and 601 deletions
  1. 1 1
      docs/api/ar/loaders/DataTextureLoader.html
  2. 1 1
      docs/api/en/loaders/DataTextureLoader.html
  3. 1 1
      docs/api/it/loaders/DataTextureLoader.html
  4. 1 1
      docs/api/zh/loaders/DataTextureLoader.html
  5. 2 2
      editor/js/libs/ui.three.js
  6. 1 1
      editor/sw.js
  7. 1 0
      examples/jsm/Addons.js
  8. 5 5
      examples/jsm/loaders/HDRCubeTextureLoader.js
  9. 486 0
      examples/jsm/loaders/HDRLoader.js
  10. 9 475
      examples/jsm/loaders/RGBELoader.js
  11. 1 1
      examples/jsm/loaders/UltraHDRLoader.js
  12. 2 2
      examples/misc_controls_arcball.html
  13. 3 3
      examples/misc_exporter_exr.html
  14. 3 3
      examples/misc_exporter_ktx2.html
  15. 2 2
      examples/webgl_animation_walk.html
  16. 3 3
      examples/webgl_gpgpu_water.html
  17. 2 2
      examples/webgl_loader_gltf.html
  18. 3 3
      examples/webgl_loader_gltf_anisotropy.html
  19. 2 2
      examples/webgl_loader_gltf_instancing.html
  20. 3 3
      examples/webgl_loader_gltf_iridescence.html
  21. 2 2
      examples/webgl_loader_gltf_transmission.html
  22. 2 2
      examples/webgl_loader_gltf_variants.html
  23. 2 2
      examples/webgl_loader_texture_hdr.html
  24. 3 3
      examples/webgl_loader_usdz.html
  25. 2 2
      examples/webgl_materials_car.html
  26. 2 2
      examples/webgl_materials_cubemap_dynamic.html
  27. 2 2
      examples/webgl_materials_envmaps_groundprojected.html
  28. 2 2
      examples/webgl_materials_physical_transmission.html
  29. 2 2
      examples/webgl_materials_physical_transmission_alpha.html
  30. 2 2
      examples/webgl_performance.html
  31. 2 2
      examples/webgl_pmrem_test.html
  32. 2 2
      examples/webgl_postprocessing_3dlut.html
  33. 3 3
      examples/webgl_postprocessing_material_ao.html
  34. 2 2
      examples/webgl_random_uv.html
  35. 2 2
      examples/webgl_renderer_pathtracer.html
  36. 3 3
      examples/webgl_tonemapping.html
  37. 2 2
      examples/webgl_watch.html
  38. 3 3
      examples/webgpu_compute_cloth.html
  39. 3 3
      examples/webgpu_compute_particles_fluid.html
  40. 3 3
      examples/webgpu_compute_water.html
  41. 2 2
      examples/webgpu_custom_fog_background.html
  42. 2 2
      examples/webgpu_loader_gltf.html
  43. 3 3
      examples/webgpu_loader_gltf_anisotropy.html
  44. 5 5
      examples/webgpu_loader_gltf_dispersion.html
  45. 3 3
      examples/webgpu_loader_gltf_iridescence.html
  46. 2 2
      examples/webgpu_loader_gltf_sheen.html
  47. 2 2
      examples/webgpu_loader_gltf_transmission.html
  48. 2 2
      examples/webgpu_loader_materialx.html
  49. 2 2
      examples/webgpu_materials_transmission.html
  50. 2 2
      examples/webgpu_mrt.html
  51. 2 2
      examples/webgpu_performance.html
  52. 2 2
      examples/webgpu_pmrem_equirectangular.html
  53. 2 2
      examples/webgpu_postprocessing_bloom_emissive.html
  54. 3 3
      examples/webgpu_tonemapping.html
  55. 3 3
      examples/webgpu_tsl_angular_slicing.html
  56. 3 3
      examples/webgpu_tsl_procedural_terrain.html
  57. 2 2
      examples/webxr_ar_lighting.html
  58. 2 2
      examples/webxr_vr_sandbox.html

+ 1 - 1
docs/api/ar/loaders/DataTextureLoader.html

@@ -20,7 +20,7 @@
 		<h2>أمثلة (Examples)</h2>
 		<p>
 		انظر
-		[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/RGBELoader.js RGBELoader]
+		[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/HDRLoader.js HDRLoader]
 		لمثال على فئة مشتقة.
 		</p>
 		 

+ 1 - 1
docs/api/en/loaders/DataTextureLoader.html

@@ -20,7 +20,7 @@
 		<h2>Examples</h2>
 		<p>
 			See the
-			[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/RGBELoader.js RGBELoader] 
+			[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/HDRLoader.js HDRLoader] 
 			for an example of a derived class.
 		</p>
 

+ 1 - 1
docs/api/it/loaders/DataTextureLoader.html

@@ -19,7 +19,7 @@
 		<h2>Esempi</h2>
 
 		<p>
-			Vedi l'[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/RGBELoader.js RGBELoader]
+			Vedi l'[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/HDRLoader.js HDRLoader]
       per un esempio di una classe derivata.
 		</p>
 

+ 1 - 1
docs/api/zh/loaders/DataTextureLoader.html

@@ -20,7 +20,7 @@
 		<h2>例子</h2>
 
 		<p>
-			请参考[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/RGBELoader.js RGBELoader]
+			请参考[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/HDRLoader.js HDRLoader]
 			这个子类的例子。
 		</p>
 

+ 2 - 2
editor/js/libs/ui.three.js

@@ -67,9 +67,9 @@ class UITexture extends UISpan {
 
 					// assuming RGBE/Radiance HDR image format
 
-					const { RGBELoader } = await import( 'three/addons/loaders/RGBELoader.js' );
+					const { HDRLoader } = await import( 'three/addons/loaders/HDRLoader.js' );
 
-					const loader = new RGBELoader();
+					const loader = new HDRLoader();
 					loader.load( event.target.result, function ( hdrTexture ) {
 
 						hdrTexture.sourceFile = file.name;

+ 1 - 1
editor/sw.js

@@ -59,7 +59,7 @@ const assets = [
 
 	'../examples/jsm/loaders/EXRLoader.js',
 	'../examples/jsm/loaders/KTX2Loader.js',
-	'../examples/jsm/loaders/RGBELoader.js',
+	'../examples/jsm/loaders/HDRLoader.js',
 	'../examples/jsm/loaders/TGALoader.js',
 
 	'../examples/jsm/curves/NURBSCurve.js',

+ 1 - 0
examples/jsm/Addons.js

@@ -89,6 +89,7 @@ export * from './loaders/FBXLoader.js';
 export * from './loaders/FontLoader.js';
 export * from './loaders/GCodeLoader.js';
 export * from './loaders/GLTFLoader.js';
+export * from './loaders/HDRLoader.js';
 export * from './loaders/HDRCubeTextureLoader.js';
 export * from './loaders/IESLoader.js';
 export * from './loaders/KMZLoader.js';

+ 5 - 5
examples/jsm/loaders/HDRCubeTextureLoader.js

@@ -8,7 +8,7 @@ import {
 	LinearSRGBColorSpace,
 	Loader
 } from 'three';
-import { RGBELoader } from '../loaders/RGBELoader.js';
+import { HDRLoader } from '../loaders/HDRLoader.js';
 
 /**
  * A loader for loading HDR cube textures.
@@ -40,9 +40,9 @@ class HDRCubeTextureLoader extends Loader {
 		 * The internal HDR loader that loads the
 		 * individual textures for each cube face.
 		 *
-		 * @type {RGBELoader}
+         * @type {HDRLoader}
 		 */
-		this.hdrLoader = new RGBELoader();
+        this.hdrLoader = new HDRLoader();
 
 		/**
 		 * The texture type.
@@ -147,8 +147,8 @@ class HDRCubeTextureLoader extends Loader {
 	/**
 	 * Sets the texture type.
 	 *
-	 * @param {(HalfFloatType|FloatType)} value - The texture type to set.
-	 * @return {RGBELoader} A reference to this loader.
+     * @param {(HalfFloatType|FloatType)} value - The texture type to set.
+     * @return {HDRLoader} A reference to this loader.
 	 */
 	setDataType( value ) {
 

+ 486 - 0
examples/jsm/loaders/HDRLoader.js

@@ -0,0 +1,486 @@
+import {
+    DataTextureLoader,
+    DataUtils,
+    FloatType,
+    HalfFloatType,
+    LinearFilter,
+    LinearSRGBColorSpace
+} from 'three';
+
+/**
+ * A loader for the RGBE HDR texture format.
+ *
+ * ```js
+ * const loader = new HDRLoader();
+ * const envMap = await loader.loadAsync( 'textures/equirectangular/blouberg_sunrise_2_1k.hdr' );
+ * envMap.mapping = THREE.EquirectangularReflectionMapping;
+ *
+ * scene.environment = envMap;
+ * ```
+ *
+ * @augments DataTextureLoader
+ * @three_import import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
+ */
+class HDRLoader extends DataTextureLoader {
+
+    /**
+     * Constructs a new RGBE/HDR loader.
+     *
+     * @param {LoadingManager} [manager] - The loading manager.
+     */
+    constructor( manager ) {
+
+        super( manager );
+
+        /**
+         * The texture type.
+         *
+         * @type {(HalfFloatType|FloatType)}
+         * @default HalfFloatType
+         */
+        this.type = HalfFloatType;
+
+    }
+
+    /**
+     * Parses the given RGBE texture data.
+     *
+     * @param {ArrayBuffer} buffer - The raw texture data.
+     * @return {DataTextureLoader~TexData} An object representing the parsed texture data.
+     */
+    parse( buffer ) {
+
+        // adapted from http://www.graphics.cornell.edu/~bjw/rgbe.html
+
+        const
+            /* default error routine.  change this to change error handling */
+            rgbe_read_error = 1,
+            rgbe_write_error = 2,
+            rgbe_format_error = 3,
+            rgbe_memory_error = 4,
+            rgbe_error = function ( rgbe_error_code, msg ) {
+
+                switch ( rgbe_error_code ) {
+
+                    case rgbe_read_error: throw new Error( 'THREE.HDRLoader: Read Error: ' + ( msg || '' ) );
+                    case rgbe_write_error: throw new Error( 'THREE.HDRLoader: Write Error: ' + ( msg || '' ) );
+                    case rgbe_format_error: throw new Error( 'THREE.HDRLoader: Bad File Format: ' + ( msg || '' ) );
+                    default:
+                    case rgbe_memory_error: throw new Error( 'THREE.HDRLoader: Memory Error: ' + ( msg || '' ) );
+
+                }
+
+            },
+
+            /* offsets to red, green, and blue components in a data (float) pixel */
+            //RGBE_DATA_RED = 0,
+            //RGBE_DATA_GREEN = 1,
+            //RGBE_DATA_BLUE = 2,
+
+            /* number of floats per pixel, use 4 since stored in rgba image format */
+            //RGBE_DATA_SIZE = 4,
+
+            /* flags indicating which fields in an rgbe_header_info are valid */
+            RGBE_VALID_PROGRAMTYPE = 1,
+            RGBE_VALID_FORMAT = 2,
+            RGBE_VALID_DIMENSIONS = 4,
+
+            NEWLINE = '\n',
+
+            fgets = function ( buffer, lineLimit, consume ) {
+
+                const chunkSize = 128;
+
+                lineLimit = ! lineLimit ? 1024 : lineLimit;
+                let p = buffer.pos,
+                    i = - 1, len = 0, s = '',
+                    chunk = String.fromCharCode.apply( null, new Uint16Array( buffer.subarray( p, p + chunkSize ) ) );
+
+                while ( ( 0 > ( i = chunk.indexOf( NEWLINE ) ) ) && ( len < lineLimit ) && ( p < buffer.byteLength ) ) {
+
+                    s += chunk; len += chunk.length;
+                    p += chunkSize;
+                    chunk += String.fromCharCode.apply( null, new Uint16Array( buffer.subarray( p, p + chunkSize ) ) );
+
+                }
+
+                if ( - 1 < i ) {
+
+                    /*for (i=l-1; i>=0; i--) {
+                        byteCode = m.charCodeAt(i);
+                        if (byteCode > 0x7f && byteCode <= 0x7ff) byteLen++;
+                        else if (byteCode > 0x7ff && byteCode <= 0xffff) byteLen += 2;
+                        if (byteCode >= 0xDC00 && byteCode <= 0xDFFF) i--; //trail surrogate
+                    }*/
+                    if ( false !== consume ) buffer.pos += len + i + 1;
+                    return s + chunk.slice( 0, i );
+
+                }
+
+                return false;
+
+            },
+
+            /* minimal header reading.  modify if you want to parse more information */
+            RGBE_ReadHeader = function ( buffer ) {
+
+
+                // regexes to parse header info fields
+                const magic_token_re = /^#\?(\S+)/,
+                    gamma_re = /^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,
+                    exposure_re = /^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,
+                    format_re = /^\s*FORMAT=(\S+)\s*$/,
+                    dimensions_re = /^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,
+
+                    // RGBE format header struct
+                    header = {
+
+                        valid: 0, /* indicate which fields are valid */
+
+                        string: '', /* the actual header string */
+
+                        comments: '', /* comments found in header */
+
+                        programtype: 'RGBE', /* listed at beginning of file to identify it after "#?". defaults to "RGBE" */
+
+                        format: '', /* RGBE format, default 32-bit_rle_rgbe */
+
+                        gamma: 1.0, /* image has already been gamma corrected with given gamma. defaults to 1.0 (no correction) */
+
+                        exposure: 1.0, /* a value of 1.0 in an image corresponds to <exposure> watts/steradian/m^2. defaults to 1.0 */
+
+                        width: 0, height: 0 /* image dimensions, width/height */
+
+                    };
+
+                let line, match;
+
+                if ( buffer.pos >= buffer.byteLength || ! ( line = fgets( buffer ) ) ) {
+
+                    rgbe_error( rgbe_read_error, 'no header found' );
+
+                }
+
+                /* if you want to require the magic token then uncomment the next line */
+                if ( ! ( match = line.match( magic_token_re ) ) ) {
+
+                    rgbe_error( rgbe_format_error, 'bad initial token' );
+
+                }
+
+                header.valid |= RGBE_VALID_PROGRAMTYPE;
+                header.programtype = match[ 1 ];
+                header.string += line + '\n';
+
+                while ( true ) {
+
+                    line = fgets( buffer );
+                    if ( false === line ) break;
+                    header.string += line + '\n';
+
+                    if ( '#' === line.charAt( 0 ) ) {
+
+                        header.comments += line + '\n';
+                        continue; // comment line
+
+                    }
+
+                    if ( match = line.match( gamma_re ) ) {
+
+                        header.gamma = parseFloat( match[ 1 ] );
+
+                    }
+
+                    if ( match = line.match( exposure_re ) ) {
+
+                        header.exposure = parseFloat( match[ 1 ] );
+
+                    }
+
+                    if ( match = line.match( format_re ) ) {
+
+                        header.valid |= RGBE_VALID_FORMAT;
+                        header.format = match[ 1 ];//'32-bit_rle_rgbe';
+
+                    }
+
+                    if ( match = line.match( dimensions_re ) ) {
+
+                        header.valid |= RGBE_VALID_DIMENSIONS;
+                        header.height = parseInt( match[ 1 ], 10 );
+                        header.width = parseInt( match[ 2 ], 10 );
+
+                    }
+
+                    if ( ( header.valid & RGBE_VALID_FORMAT ) && ( header.valid & RGBE_VALID_DIMENSIONS ) ) break;
+
+                }
+
+                if ( ! ( header.valid & RGBE_VALID_FORMAT ) ) {
+
+                    rgbe_error( rgbe_format_error, 'missing format specifier' );
+
+                }
+
+                if ( ! ( header.valid & RGBE_VALID_DIMENSIONS ) ) {
+
+                    rgbe_error( rgbe_format_error, 'missing image size specifier' );
+
+                }
+
+                return header;
+
+            },
+
+            RGBE_ReadPixels_RLE = function ( buffer, w, h ) {
+
+                const scanline_width = w;
+
+                if (
+                    // run length encoding is not allowed so read flat
+                    ( ( scanline_width < 8 ) || ( scanline_width > 0x7fff ) ) ||
+                    // this file is not run length encoded
+                    ( ( 2 !== buffer[ 0 ] ) || ( 2 !== buffer[ 1 ] ) || ( buffer[ 2 ] & 0x80 ) )
+                ) {
+
+                    // return the flat buffer
+                    return new Uint8Array( buffer );
+
+                }
+
+                if ( scanline_width !== ( ( buffer[ 2 ] << 8 ) | buffer[ 3 ] ) ) {
+
+                    rgbe_error( rgbe_format_error, 'wrong scanline width' );
+
+                }
+
+                const data_rgba = new Uint8Array( 4 * w * h );
+
+                if ( ! data_rgba.length ) {
+
+                    rgbe_error( rgbe_memory_error, 'unable to allocate buffer space' );
+
+                }
+
+                let offset = 0, pos = 0;
+
+                const ptr_end = 4 * scanline_width;
+                const rgbeStart = new Uint8Array( 4 );
+                const scanline_buffer = new Uint8Array( ptr_end );
+                let num_scanlines = h;
+
+                // read in each successive scanline
+                while ( ( num_scanlines > 0 ) && ( pos < buffer.byteLength ) ) {
+
+                    if ( pos + 4 > buffer.byteLength ) {
+
+                        rgbe_error( rgbe_read_error );
+
+                    }
+
+                    rgbeStart[ 0 ] = buffer[ pos ++ ];
+                    rgbeStart[ 1 ] = buffer[ pos ++ ];
+                    rgbeStart[ 2 ] = buffer[ pos ++ ];
+                    rgbeStart[ 3 ] = buffer[ pos ++ ];
+
+                    if ( ( 2 != rgbeStart[ 0 ] ) || ( 2 != rgbeStart[ 1 ] ) || ( ( ( rgbeStart[ 2 ] << 8 ) | rgbeStart[ 3 ] ) != scanline_width ) ) {
+
+                        rgbe_error( rgbe_format_error, 'bad rgbe scanline format' );
+
+                    }
+
+                    // read each of the four channels for the scanline into the buffer
+                    // first red, then green, then blue, then exponent
+                    let ptr = 0, count;
+
+                    while ( ( ptr < ptr_end ) && ( pos < buffer.byteLength ) ) {
+
+                        count = buffer[ pos ++ ];
+                        const isEncodedRun = count > 128;
+                        if ( isEncodedRun ) count -= 128;
+
+                        if ( ( 0 === count ) || ( ptr + count > ptr_end ) ) {
+
+                            rgbe_error( rgbe_format_error, 'bad scanline data' );
+
+                        }
+
+                        if ( isEncodedRun ) {
+
+                            // a (encoded) run of the same value
+                            const byteValue = buffer[ pos ++ ];
+                            for ( let i = 0; i < count; i ++ ) {
+
+                                scanline_buffer[ ptr ++ ] = byteValue;
+
+                            }
+                            //ptr += count;
+
+                        } else {
+
+                            // a literal-run
+                            scanline_buffer.set( buffer.subarray( pos, pos + count ), ptr );
+                            ptr += count; pos += count;
+
+                        }
+
+                    }
+
+
+                    // now convert data from buffer into rgba
+                    // first red, then green, then blue, then exponent (alpha)
+                    const l = scanline_width; //scanline_buffer.byteLength;
+                    for ( let i = 0; i < l; i ++ ) {
+
+                        let off = 0;
+                        data_rgba[ offset ] = scanline_buffer[ i + off ];
+                        off += scanline_width; //1;
+                        data_rgba[ offset + 1 ] = scanline_buffer[ i + off ];
+                        off += scanline_width; //1;
+                        data_rgba[ offset + 2 ] = scanline_buffer[ i + off ];
+                        off += scanline_width; //1;
+                        data_rgba[ offset + 3 ] = scanline_buffer[ i + off ];
+                        offset += 4;
+
+                    }
+
+                    num_scanlines --;
+
+                }
+
+                return data_rgba;
+
+            };
+
+        const RGBEByteToRGBFloat = function ( sourceArray, sourceOffset, destArray, destOffset ) {
+
+            const e = sourceArray[ sourceOffset + 3 ];
+            const scale = Math.pow( 2.0, e - 128.0 ) / 255.0;
+
+            destArray[ destOffset + 0 ] = sourceArray[ sourceOffset + 0 ] * scale;
+            destArray[ destOffset + 1 ] = sourceArray[ sourceOffset + 1 ] * scale;
+            destArray[ destOffset + 2 ] = sourceArray[ sourceOffset + 2 ] * scale;
+            destArray[ destOffset + 3 ] = 1;
+
+        };
+
+        const RGBEByteToRGBHalf = function ( sourceArray, sourceOffset, destArray, destOffset ) {
+
+            const e = sourceArray[ sourceOffset + 3 ];
+            const scale = Math.pow( 2.0, e - 128.0 ) / 255.0;
+
+            // clamping to 65504, the maximum representable value in float16
+            destArray[ destOffset + 0 ] = DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 0 ] * scale, 65504 ) );
+            destArray[ destOffset + 1 ] = DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 1 ] * scale, 65504 ) );
+            destArray[ destOffset + 2 ] = DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 2 ] * scale, 65504 ) );
+            destArray[ destOffset + 3 ] = DataUtils.toHalfFloat( 1 );
+
+        };
+
+        const byteArray = new Uint8Array( buffer );
+        byteArray.pos = 0;
+        const rgbe_header_info = RGBE_ReadHeader( byteArray );
+
+        const w = rgbe_header_info.width,
+            h = rgbe_header_info.height,
+            image_rgba_data = RGBE_ReadPixels_RLE( byteArray.subarray( byteArray.pos ), w, h );
+
+
+        let data, type;
+        let numElements;
+
+        switch ( this.type ) {
+
+            case FloatType:
+
+                numElements = image_rgba_data.length / 4;
+                const floatArray = new Float32Array( numElements * 4 );
+
+                for ( let j = 0; j < numElements; j ++ ) {
+
+                    RGBEByteToRGBFloat( image_rgba_data, j * 4, floatArray, j * 4 );
+
+                }
+
+                data = floatArray;
+                type = FloatType;
+                break;
+
+            case HalfFloatType:
+
+                numElements = image_rgba_data.length / 4;
+                const halfArray = new Uint16Array( numElements * 4 );
+
+                for ( let j = 0; j < numElements; j ++ ) {
+
+                    RGBEByteToRGBHalf( image_rgba_data, j * 4, halfArray, j * 4 );
+
+                }
+
+                data = halfArray;
+                type = HalfFloatType;
+                break;
+
+            default:
+
+                throw new Error( 'THREE.HDRLoader: Unsupported type: ' + this.type );
+                break;
+
+        }
+
+        return {
+            width: w, height: h,
+            data: data,
+            header: rgbe_header_info.string,
+            gamma: rgbe_header_info.gamma,
+            exposure: rgbe_header_info.exposure,
+            type: type
+        };
+
+    }
+
+    /**
+     * Sets the texture type.
+     *
+     * @param {(HalfFloatType|FloatType)} value - The texture type to set.
+     * @return {HDRLoader} A reference to this loader.
+     */
+    setDataType( value ) {
+
+        this.type = value;
+        return this;
+
+    }
+
+    load( url, onLoad, onProgress, onError ) {
+
+        function onLoadCallback( texture, texData ) {
+
+            switch ( texture.type ) {
+
+                case FloatType:
+                case HalfFloatType:
+
+                    texture.colorSpace = LinearSRGBColorSpace;
+                    texture.minFilter = LinearFilter;
+                    texture.magFilter = LinearFilter;
+                    texture.generateMipmaps = false;
+                    texture.flipY = true;
+
+                    break;
+
+            }
+
+            if ( onLoad ) onLoad( texture, texData );
+
+        }
+
+        return super.load( url, onLoadCallback, onProgress, onError );
+
+    }
+
+}
+
+export { HDRLoader };
+
+

+ 9 - 475
examples/jsm/loaders/RGBELoader.js

@@ -1,484 +1,18 @@
-import {
-	DataTextureLoader,
-	DataUtils,
-	FloatType,
-	HalfFloatType,
-	LinearFilter,
-	LinearSRGBColorSpace
-} from 'three';
+import { HDRLoader } from './HDRLoader.js';
 
-/**
- * A loader for the RGBE HDR texture format.
- *
- * ```js
- * const loader = new RGBELoader();
- * const envMap = await loader.loadAsync( 'textures/equirectangular/blouberg_sunrise_2_1k.hdr' );
- * envMap.mapping = THREE.EquirectangularReflectionMapping;
- *
- * scene.environment = envMap;
- * ```
- *
- * @augments DataTextureLoader
- * @three_import import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
- */
-class RGBELoader extends DataTextureLoader {
+// @deprecated, r180
 
-	/**
-	 * Constructs a new RGBE loader.
-	 *
-	 * @param {LoadingManager} [manager] - The loading manager.
-	 */
-	constructor( manager ) {
+class RGBELoader extends HDRLoader {
 
-		super( manager );
+    constructor( manager ) {
 
-		/**
-		 * The texture type.
-		 *
-		 * @type {(HalfFloatType|FloatType)}
-		 * @default HalfFloatType
-		 */
-		this.type = HalfFloatType;
+        console.warn( 'RGBELoader has been deprecated. Please use HDRLoader instead.' );
+        super( manager );
 
-	}
-
-	/**
-	 * Parses the given RGBE texture data.
-	 *
-	 * @param {ArrayBuffer} buffer - The raw texture data.
-	 * @return {DataTextureLoader~TexData} An object representing the parsed texture data.
-	 */
-	parse( buffer ) {
-
-		// adapted from http://www.graphics.cornell.edu/~bjw/rgbe.html
-
-		const
-			/* default error routine.  change this to change error handling */
-			rgbe_read_error = 1,
-			rgbe_write_error = 2,
-			rgbe_format_error = 3,
-			rgbe_memory_error = 4,
-			rgbe_error = function ( rgbe_error_code, msg ) {
-
-				switch ( rgbe_error_code ) {
-
-					case rgbe_read_error: throw new Error( 'THREE.RGBELoader: Read Error: ' + ( msg || '' ) );
-					case rgbe_write_error: throw new Error( 'THREE.RGBELoader: Write Error: ' + ( msg || '' ) );
-					case rgbe_format_error: throw new Error( 'THREE.RGBELoader: Bad File Format: ' + ( msg || '' ) );
-					default:
-					case rgbe_memory_error: throw new Error( 'THREE.RGBELoader: Memory Error: ' + ( msg || '' ) );
-
-				}
-
-			},
-
-			/* offsets to red, green, and blue components in a data (float) pixel */
-			//RGBE_DATA_RED = 0,
-			//RGBE_DATA_GREEN = 1,
-			//RGBE_DATA_BLUE = 2,
-
-			/* number of floats per pixel, use 4 since stored in rgba image format */
-			//RGBE_DATA_SIZE = 4,
-
-			/* flags indicating which fields in an rgbe_header_info are valid */
-			RGBE_VALID_PROGRAMTYPE = 1,
-			RGBE_VALID_FORMAT = 2,
-			RGBE_VALID_DIMENSIONS = 4,
-
-			NEWLINE = '\n',
-
-			fgets = function ( buffer, lineLimit, consume ) {
-
-				const chunkSize = 128;
-
-				lineLimit = ! lineLimit ? 1024 : lineLimit;
-				let p = buffer.pos,
-					i = - 1, len = 0, s = '',
-					chunk = String.fromCharCode.apply( null, new Uint16Array( buffer.subarray( p, p + chunkSize ) ) );
-
-				while ( ( 0 > ( i = chunk.indexOf( NEWLINE ) ) ) && ( len < lineLimit ) && ( p < buffer.byteLength ) ) {
-
-					s += chunk; len += chunk.length;
-					p += chunkSize;
-					chunk += String.fromCharCode.apply( null, new Uint16Array( buffer.subarray( p, p + chunkSize ) ) );
-
-				}
-
-				if ( - 1 < i ) {
-
-					/*for (i=l-1; i>=0; i--) {
-						byteCode = m.charCodeAt(i);
-						if (byteCode > 0x7f && byteCode <= 0x7ff) byteLen++;
-						else if (byteCode > 0x7ff && byteCode <= 0xffff) byteLen += 2;
-						if (byteCode >= 0xDC00 && byteCode <= 0xDFFF) i--; //trail surrogate
-					}*/
-					if ( false !== consume ) buffer.pos += len + i + 1;
-					return s + chunk.slice( 0, i );
-
-				}
-
-				return false;
-
-			},
-
-			/* minimal header reading.  modify if you want to parse more information */
-			RGBE_ReadHeader = function ( buffer ) {
-
-
-				// regexes to parse header info fields
-				const magic_token_re = /^#\?(\S+)/,
-					gamma_re = /^\s*GAMMA\s*=\s*(\d+(\.\d+)?)\s*$/,
-					exposure_re = /^\s*EXPOSURE\s*=\s*(\d+(\.\d+)?)\s*$/,
-					format_re = /^\s*FORMAT=(\S+)\s*$/,
-					dimensions_re = /^\s*\-Y\s+(\d+)\s+\+X\s+(\d+)\s*$/,
-
-					// RGBE format header struct
-					header = {
-
-						valid: 0, /* indicate which fields are valid */
-
-						string: '', /* the actual header string */
-
-						comments: '', /* comments found in header */
-
-						programtype: 'RGBE', /* listed at beginning of file to identify it after "#?". defaults to "RGBE" */
-
-						format: '', /* RGBE format, default 32-bit_rle_rgbe */
-
-						gamma: 1.0, /* image has already been gamma corrected with given gamma. defaults to 1.0 (no correction) */
-
-						exposure: 1.0, /* a value of 1.0 in an image corresponds to <exposure> watts/steradian/m^2. defaults to 1.0 */
-
-						width: 0, height: 0 /* image dimensions, width/height */
-
-					};
-
-				let line, match;
-
-				if ( buffer.pos >= buffer.byteLength || ! ( line = fgets( buffer ) ) ) {
-
-					rgbe_error( rgbe_read_error, 'no header found' );
-
-				}
-
-				/* if you want to require the magic token then uncomment the next line */
-				if ( ! ( match = line.match( magic_token_re ) ) ) {
-
-					rgbe_error( rgbe_format_error, 'bad initial token' );
-
-				}
-
-				header.valid |= RGBE_VALID_PROGRAMTYPE;
-				header.programtype = match[ 1 ];
-				header.string += line + '\n';
-
-				while ( true ) {
-
-					line = fgets( buffer );
-					if ( false === line ) break;
-					header.string += line + '\n';
-
-					if ( '#' === line.charAt( 0 ) ) {
-
-						header.comments += line + '\n';
-						continue; // comment line
-
-					}
-
-					if ( match = line.match( gamma_re ) ) {
-
-						header.gamma = parseFloat( match[ 1 ] );
-
-					}
-
-					if ( match = line.match( exposure_re ) ) {
-
-						header.exposure = parseFloat( match[ 1 ] );
-
-					}
-
-					if ( match = line.match( format_re ) ) {
-
-						header.valid |= RGBE_VALID_FORMAT;
-						header.format = match[ 1 ];//'32-bit_rle_rgbe';
-
-					}
-
-					if ( match = line.match( dimensions_re ) ) {
-
-						header.valid |= RGBE_VALID_DIMENSIONS;
-						header.height = parseInt( match[ 1 ], 10 );
-						header.width = parseInt( match[ 2 ], 10 );
-
-					}
-
-					if ( ( header.valid & RGBE_VALID_FORMAT ) && ( header.valid & RGBE_VALID_DIMENSIONS ) ) break;
-
-				}
-
-				if ( ! ( header.valid & RGBE_VALID_FORMAT ) ) {
-
-					rgbe_error( rgbe_format_error, 'missing format specifier' );
-
-				}
-
-				if ( ! ( header.valid & RGBE_VALID_DIMENSIONS ) ) {
-
-					rgbe_error( rgbe_format_error, 'missing image size specifier' );
-
-				}
-
-				return header;
-
-			},
-
-			RGBE_ReadPixels_RLE = function ( buffer, w, h ) {
-
-				const scanline_width = w;
-
-				if (
-					// run length encoding is not allowed so read flat
-					( ( scanline_width < 8 ) || ( scanline_width > 0x7fff ) ) ||
-					// this file is not run length encoded
-					( ( 2 !== buffer[ 0 ] ) || ( 2 !== buffer[ 1 ] ) || ( buffer[ 2 ] & 0x80 ) )
-				) {
-
-					// return the flat buffer
-					return new Uint8Array( buffer );
-
-				}
-
-				if ( scanline_width !== ( ( buffer[ 2 ] << 8 ) | buffer[ 3 ] ) ) {
-
-					rgbe_error( rgbe_format_error, 'wrong scanline width' );
-
-				}
-
-				const data_rgba = new Uint8Array( 4 * w * h );
-
-				if ( ! data_rgba.length ) {
-
-					rgbe_error( rgbe_memory_error, 'unable to allocate buffer space' );
-
-				}
-
-				let offset = 0, pos = 0;
-
-				const ptr_end = 4 * scanline_width;
-				const rgbeStart = new Uint8Array( 4 );
-				const scanline_buffer = new Uint8Array( ptr_end );
-				let num_scanlines = h;
-
-				// read in each successive scanline
-				while ( ( num_scanlines > 0 ) && ( pos < buffer.byteLength ) ) {
-
-					if ( pos + 4 > buffer.byteLength ) {
-
-						rgbe_error( rgbe_read_error );
-
-					}
-
-					rgbeStart[ 0 ] = buffer[ pos ++ ];
-					rgbeStart[ 1 ] = buffer[ pos ++ ];
-					rgbeStart[ 2 ] = buffer[ pos ++ ];
-					rgbeStart[ 3 ] = buffer[ pos ++ ];
-
-					if ( ( 2 != rgbeStart[ 0 ] ) || ( 2 != rgbeStart[ 1 ] ) || ( ( ( rgbeStart[ 2 ] << 8 ) | rgbeStart[ 3 ] ) != scanline_width ) ) {
-
-						rgbe_error( rgbe_format_error, 'bad rgbe scanline format' );
-
-					}
-
-					// read each of the four channels for the scanline into the buffer
-					// first red, then green, then blue, then exponent
-					let ptr = 0, count;
-
-					while ( ( ptr < ptr_end ) && ( pos < buffer.byteLength ) ) {
-
-						count = buffer[ pos ++ ];
-						const isEncodedRun = count > 128;
-						if ( isEncodedRun ) count -= 128;
-
-						if ( ( 0 === count ) || ( ptr + count > ptr_end ) ) {
-
-							rgbe_error( rgbe_format_error, 'bad scanline data' );
-
-						}
-
-						if ( isEncodedRun ) {
-
-							// a (encoded) run of the same value
-							const byteValue = buffer[ pos ++ ];
-							for ( let i = 0; i < count; i ++ ) {
-
-								scanline_buffer[ ptr ++ ] = byteValue;
-
-							}
-							//ptr += count;
-
-						} else {
-
-							// a literal-run
-							scanline_buffer.set( buffer.subarray( pos, pos + count ), ptr );
-							ptr += count; pos += count;
-
-						}
-
-					}
-
-
-					// now convert data from buffer into rgba
-					// first red, then green, then blue, then exponent (alpha)
-					const l = scanline_width; //scanline_buffer.byteLength;
-					for ( let i = 0; i < l; i ++ ) {
-
-						let off = 0;
-						data_rgba[ offset ] = scanline_buffer[ i + off ];
-						off += scanline_width; //1;
-						data_rgba[ offset + 1 ] = scanline_buffer[ i + off ];
-						off += scanline_width; //1;
-						data_rgba[ offset + 2 ] = scanline_buffer[ i + off ];
-						off += scanline_width; //1;
-						data_rgba[ offset + 3 ] = scanline_buffer[ i + off ];
-						offset += 4;
-
-					}
-
-					num_scanlines --;
-
-				}
-
-				return data_rgba;
-
-			};
-
-		const RGBEByteToRGBFloat = function ( sourceArray, sourceOffset, destArray, destOffset ) {
-
-			const e = sourceArray[ sourceOffset + 3 ];
-			const scale = Math.pow( 2.0, e - 128.0 ) / 255.0;
-
-			destArray[ destOffset + 0 ] = sourceArray[ sourceOffset + 0 ] * scale;
-			destArray[ destOffset + 1 ] = sourceArray[ sourceOffset + 1 ] * scale;
-			destArray[ destOffset + 2 ] = sourceArray[ sourceOffset + 2 ] * scale;
-			destArray[ destOffset + 3 ] = 1;
-
-		};
-
-		const RGBEByteToRGBHalf = function ( sourceArray, sourceOffset, destArray, destOffset ) {
-
-			const e = sourceArray[ sourceOffset + 3 ];
-			const scale = Math.pow( 2.0, e - 128.0 ) / 255.0;
-
-			// clamping to 65504, the maximum representable value in float16
-			destArray[ destOffset + 0 ] = DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 0 ] * scale, 65504 ) );
-			destArray[ destOffset + 1 ] = DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 1 ] * scale, 65504 ) );
-			destArray[ destOffset + 2 ] = DataUtils.toHalfFloat( Math.min( sourceArray[ sourceOffset + 2 ] * scale, 65504 ) );
-			destArray[ destOffset + 3 ] = DataUtils.toHalfFloat( 1 );
-
-		};
-
-		const byteArray = new Uint8Array( buffer );
-		byteArray.pos = 0;
-		const rgbe_header_info = RGBE_ReadHeader( byteArray );
-
-		const w = rgbe_header_info.width,
-			h = rgbe_header_info.height,
-			image_rgba_data = RGBE_ReadPixels_RLE( byteArray.subarray( byteArray.pos ), w, h );
-
-
-		let data, type;
-		let numElements;
-
-		switch ( this.type ) {
-
-			case FloatType:
-
-				numElements = image_rgba_data.length / 4;
-				const floatArray = new Float32Array( numElements * 4 );
-
-				for ( let j = 0; j < numElements; j ++ ) {
-
-					RGBEByteToRGBFloat( image_rgba_data, j * 4, floatArray, j * 4 );
-
-				}
-
-				data = floatArray;
-				type = FloatType;
-				break;
-
-			case HalfFloatType:
-
-				numElements = image_rgba_data.length / 4;
-				const halfArray = new Uint16Array( numElements * 4 );
-
-				for ( let j = 0; j < numElements; j ++ ) {
-
-					RGBEByteToRGBHalf( image_rgba_data, j * 4, halfArray, j * 4 );
-
-				}
-
-				data = halfArray;
-				type = HalfFloatType;
-				break;
-
-			default:
-
-				throw new Error( 'THREE.RGBELoader: Unsupported type: ' + this.type );
-				break;
-
-		}
-
-		return {
-			width: w, height: h,
-			data: data,
-			header: rgbe_header_info.string,
-			gamma: rgbe_header_info.gamma,
-			exposure: rgbe_header_info.exposure,
-			type: type
-		};
-
-	}
-
-	/**
-	 * Sets the texture type.
-	 *
-	 * @param {(HalfFloatType|FloatType)} value - The texture type to set.
-	 * @return {RGBELoader} A reference to this loader.
-	 */
-	setDataType( value ) {
-
-		this.type = value;
-		return this;
-
-	}
-
-	load( url, onLoad, onProgress, onError ) {
-
-		function onLoadCallback( texture, texData ) {
-
-			switch ( texture.type ) {
-
-				case FloatType:
-				case HalfFloatType:
-
-					texture.colorSpace = LinearSRGBColorSpace;
-					texture.minFilter = LinearFilter;
-					texture.magFilter = LinearFilter;
-					texture.generateMipmaps = false;
-					texture.flipY = true;
-
-					break;
-
-			}
-
-			if ( onLoad ) onLoad( texture, texData );
-
-		}
-
-		return super.load( url, onLoadCallback, onProgress, onError );
-
-	}
+    }
 
 }
 
 export { RGBELoader };
+
+

+ 1 - 1
examples/jsm/loaders/UltraHDRLoader.js

@@ -89,7 +89,7 @@ class UltraHDRLoader extends Loader {
 	 * Sets the texture type.
 	 *
 	 * @param {(HalfFloatType|FloatType)} value - The texture type to set.
-	 * @return {RGBELoader} A reference to this loader.
+	 * @return {UltraHDRLoader} A reference to this loader.
 	 */
 	setDataType( value ) {
 

+ 2 - 2
examples/misc_controls_arcball.html

@@ -31,7 +31,7 @@
 			import { ArcballControls } from 'three/addons/controls/ArcballControls.js';
 
 			import { OBJLoader } from 'three/addons/loaders/OBJLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			const cameras = [ 'Orthographic', 'Perspective' ];
 			const cameraType = { type: 'Perspective' };
@@ -149,7 +149,7 @@
 						scene.add( group );
 						render();
 
-						new RGBELoader()
+						new HDRLoader()
 							.setPath( 'textures/equirectangular/' )
 							.load( 'venice_sunset_1k.hdr', function ( hdrEquirect ) {
 

+ 3 - 3
examples/misc_exporter_exr.html

@@ -26,7 +26,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { EXRExporter, ZIP_COMPRESSION, ZIPS_COMPRESSION, NO_COMPRESSION } from 'three/addons/exporters/EXRExporter.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
 			let scene, camera, renderer, exporter, mesh, controls, renderTarget, dataTexture;
@@ -56,14 +56,14 @@
 				scene = new THREE.Scene();
 
 				exporter = new EXRExporter();
-				const rgbeloader = new RGBELoader();
+				const hdrLoader = new HDRLoader();
 
 				//
 
 				const pmremGenerator = new THREE.PMREMGenerator( renderer );
 				pmremGenerator.compileEquirectangularShader();
 
-				rgbeloader.load( 'textures/equirectangular/san_giuseppe_bridge_2k.hdr', function ( texture ) {
+				hdrLoader.load( 'textures/equirectangular/san_giuseppe_bridge_2k.hdr', function ( texture ) {
 
 					texture.mapping = THREE.EquirectangularReflectionMapping;
 

+ 3 - 3
examples/misc_exporter_ktx2.html

@@ -26,7 +26,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { KTX2Exporter } from 'three/addons/exporters/KTX2Exporter.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
 			let scene, camera, renderer, exporter, mesh, controls, renderTarget, dataTexture;
@@ -55,14 +55,14 @@
 				scene = new THREE.Scene();
 
 				exporter = new KTX2Exporter();
-				const rgbeloader = new RGBELoader();
+				const hdrLoader = new HDRLoader();
 
 				//
 
 				const pmremGenerator = new THREE.PMREMGenerator( renderer );
 				pmremGenerator.compileEquirectangularShader();
 
-				rgbeloader.load( 'textures/equirectangular/venice_sunset_1k.hdr', function ( texture ) {
+				hdrLoader.load( 'textures/equirectangular/venice_sunset_1k.hdr', function ( texture ) {
 
 					texture.mapping = THREE.EquirectangularReflectionMapping;
 

+ 2 - 2
examples/webgl_animation_walk.html

@@ -36,7 +36,7 @@
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let scene, renderer, camera, floor, orbitControls;
 			let group, followGroup, model, skeleton, mixer, clock;
@@ -129,7 +129,7 @@
 
 				// DEMO
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'lobe.hdr', function ( texture ) {
 

+ 3 - 3
examples/webgl_gpgpu_water.html

@@ -146,7 +146,7 @@
 			import { GPUComputationRenderer } from 'three/addons/misc/GPUComputationRenderer.js';
 			import { SimplexNoise } from 'three/addons/math/SimplexNoise.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
 
 			// Texture width for simulation
@@ -236,11 +236,11 @@
 				window.addEventListener( 'resize', onWindowResize );
 
 
-				const rgbeLoader = new RGBELoader().setPath( './textures/equirectangular/' );
+				const hdrLoader = new HDRLoader().setPath( './textures/equirectangular/' );
 				const glbloader = new GLTFLoader().setPath( 'models/gltf/' );
 				glbloader.setDRACOLoader( new DRACOLoader().setDecoderPath( 'jsm/libs/draco/gltf/' ) );
 
-				const [ env, model ] = await Promise.all( [ rgbeLoader.loadAsync( 'blouberg_sunrise_2_1k.hdr' ), glbloader.loadAsync( 'duck.glb' ) ] );
+				const [ env, model ] = await Promise.all( [ hdrLoader.loadAsync( 'blouberg_sunrise_2_1k.hdr' ), glbloader.loadAsync( 'duck.glb' ) ] );
 				env.mapping = THREE.EquirectangularReflectionMapping;
 				scene.environment = env;
 				scene.background = env;

+ 2 - 2
examples/webgl_loader_gltf.html

@@ -30,7 +30,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let camera, scene, renderer;
 
@@ -46,7 +46,7 @@
 
 				scene = new THREE.Scene();
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'royal_esplanade_1k.hdr', function ( texture ) {
 

+ 3 - 3
examples/webgl_loader_gltf_anisotropy.html

@@ -29,7 +29,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let renderer, scene, camera, controls;
 
@@ -56,11 +56,11 @@
 				controls.addEventListener( 'change', render );
 				controls.update();
 
-				const rgbeLoader = new RGBELoader().setPath( 'textures/equirectangular/' );
+				const hdrLoader = new HDRLoader().setPath( 'textures/equirectangular/' );
 				const gltfLoader = new GLTFLoader().setPath( 'models/gltf/' );
 
 				const [ texture, gltf ] = await Promise.all( [
-					rgbeLoader.loadAsync( 'royal_esplanade_1k.hdr' ),
+					hdrLoader.loadAsync( 'royal_esplanade_1k.hdr' ),
 					gltfLoader.loadAsync( 'AnisotropyBarnLamp.glb' ),
 				] );
 

+ 2 - 2
examples/webgl_loader_gltf_instancing.html

@@ -30,7 +30,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let camera, scene, renderer;
 
@@ -47,7 +47,7 @@
 
 				scene = new THREE.Scene();
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'royal_esplanade_1k.hdr', function ( texture ) {
 

+ 3 - 3
examples/webgl_loader_gltf_iridescence.html

@@ -29,7 +29,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let renderer, scene, camera, controls;
 
@@ -59,13 +59,13 @@
 				controls.target.set( 0, 0.2, 0 );
 				controls.update();
 
-				const rgbeLoader = new RGBELoader()
+				const hdrLoader = new HDRLoader()
 					.setPath( 'textures/equirectangular/' );
 
 				const gltfLoader = new GLTFLoader().setPath( 'models/gltf/' );
 
 				const [ texture, gltf ] = await Promise.all( [
-					rgbeLoader.loadAsync( 'venice_sunset_1k.hdr' ),
+					hdrLoader.loadAsync( 'venice_sunset_1k.hdr' ),
 					gltfLoader.loadAsync( 'IridescenceLamp.glb' ),
 				] );
 

+ 2 - 2
examples/webgl_loader_gltf_transmission.html

@@ -29,7 +29,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
 
@@ -49,7 +49,7 @@
 
 				scene = new THREE.Scene();
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'royal_esplanade_1k.hdr', function ( texture ) {
 

+ 2 - 2
examples/webgl_loader_gltf_variants.html

@@ -31,7 +31,7 @@
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let camera, scene, renderer;
 			let gui;
@@ -51,7 +51,7 @@
 
 				scene = new THREE.Scene();
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'quarry_01_1k.hdr', function ( texture ) {
 

+ 2 - 2
examples/webgl_loader_texture_hdr.html

@@ -28,7 +28,7 @@
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			const params = {
 				exposure: 2.0
@@ -55,7 +55,7 @@
 
 				camera = new THREE.OrthographicCamera( - aspect, aspect, 1, - 1, 0, 1 );
 
-				new RGBELoader()
+				new HDRLoader()
 					.load( 'textures/memorial.hdr', function ( texture, textureData ) {
 
 						//console.log( textureData );

+ 3 - 3
examples/webgl_loader_usdz.html

@@ -34,7 +34,7 @@
 			import * as THREE from 'three';
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { USDLoader } from 'three/addons/loaders/USDLoader.js';
 
 			let camera, scene, renderer;
@@ -48,14 +48,14 @@
 
 				scene = new THREE.Scene();
 
-				const rgbeLoader = new RGBELoader()
+				const hdrLoader = new HDRLoader()
 					.setPath( 'textures/equirectangular/' );
 
 				const usdzLoader = new USDLoader()
 					.setPath( 'models/usdz/' );
 
 				const [ texture, model ] = await Promise.all( [
-					rgbeLoader.loadAsync( 'venice_sunset_1k.hdr' ),
+					hdrLoader.loadAsync( 'venice_sunset_1k.hdr' ),
 					usdzLoader.loadAsync( 'saeukkang.usdz' ),
 				] );
 

+ 2 - 2
examples/webgl_materials_car.html

@@ -51,7 +51,7 @@
 
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let camera, scene, renderer;
 			let stats;
@@ -91,7 +91,7 @@
 
 				scene = new THREE.Scene();
 				scene.background = new THREE.Color( 0x333333 );
-				scene.environment = new RGBELoader().load( 'textures/equirectangular/venice_sunset_1k.hdr' );
+				scene.environment = new HDRLoader().load( 'textures/equirectangular/venice_sunset_1k.hdr' );
 				scene.environment.mapping = THREE.EquirectangularReflectionMapping;
 				scene.fog = new THREE.Fog( 0x333333, 10, 15 );
 

+ 2 - 2
examples/webgl_materials_cubemap_dynamic.html

@@ -29,7 +29,7 @@
 			import * as THREE from 'three';
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import Stats from 'three/addons/libs/stats.module.js';
@@ -63,7 +63,7 @@
 				scene = new THREE.Scene();
 				scene.rotation.y = 0.5; // avoid flying objects occluding the sun
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'quarry_01_1k.hdr', function ( texture ) {
 

+ 2 - 2
examples/webgl_materials_envmaps_groundprojected.html

@@ -36,7 +36,7 @@
 			import { GroundedSkybox } from 'three/addons/objects/GroundedSkybox.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			const params = {
 				height: 15,
@@ -61,7 +61,7 @@
 
 				scene = new THREE.Scene();
 
-				const hdrLoader = new RGBELoader();
+				const hdrLoader = new HDRLoader();
 				const envMap = await hdrLoader.loadAsync( 'textures/equirectangular/blouberg_sunrise_2_1k.hdr' );
 				envMap.mapping = THREE.EquirectangularReflectionMapping;
 

+ 2 - 2
examples/webgl_materials_physical_transmission.html

@@ -26,7 +26,7 @@
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			const params = {
 				color: 0xffffff,
@@ -48,7 +48,7 @@
 
 			let mesh;
 
-			const hdrEquirect = new RGBELoader()
+			const hdrEquirect = new HDRLoader()
 				.setPath( 'textures/equirectangular/' )
 				.load( 'royal_esplanade_1k.hdr', function () {
 

+ 2 - 2
examples/webgl_materials_physical_transmission_alpha.html

@@ -65,7 +65,7 @@
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 
 			const params = {
@@ -89,7 +89,7 @@
 
 			let mesh, material;
 
-			const hdrEquirect = new RGBELoader()
+			const hdrEquirect = new HDRLoader()
 				.setPath( 'textures/equirectangular/' )
 				.load( 'royal_esplanade_1k.hdr', function () {
 

+ 2 - 2
examples/webgl_performance.html

@@ -32,7 +32,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let camera, scene, renderer, stats;
 
@@ -63,7 +63,7 @@
 				stats = new Stats();
 				document.body.appendChild( stats.dom );
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'royal_esplanade_1k.hdr', function ( texture ) {
 

+ 2 - 2
examples/webgl_pmrem_test.html

@@ -33,7 +33,7 @@
 			import * as THREE from 'three';
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
@@ -120,7 +120,7 @@
 			function createObjects() {
 
 				let radianceMap = null;
-				new RGBELoader()
+				new HDRLoader()
 					// .setDataType( THREE.FloatType )
 					.setPath( 'textures/equirectangular/' )
 					.load( 'spot1Lux.hdr', function ( texture ) {

+ 2 - 2
examples/webgl_postprocessing_3dlut.html

@@ -30,7 +30,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
 			import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
 			import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
@@ -74,7 +74,7 @@
 
 				scene = new THREE.Scene();
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'royal_esplanade_1k.hdr', function ( texture ) {
 

+ 3 - 3
examples/webgl_postprocessing_material_ao.html

@@ -36,7 +36,7 @@
 			import Stats from 'three/addons/libs/stats.module.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { PLYLoader } from 'three/addons/loaders/PLYLoader.js';
 			import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
 			import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
@@ -78,7 +78,7 @@
 				renderer.shadowMap.enabled = sceneParameters.shadow;
 
 				const plyLoader = new PLYLoader();
-				const rgbeloader = new RGBELoader();
+				const hdrLoader = new HDRLoader();
 
 				camera = new THREE.PerspectiveCamera( 40, window.innerWidth / window.innerHeight, 1, 50 );
 				camera.position.set( 0, 3, 5 );
@@ -103,7 +103,7 @@
 				composer.addPass( renderPasse );
 				composer.addPass( outputPass );
 
-				rgbeloader.load( 'textures/equirectangular/royal_esplanade_1k.hdr', function ( texture ) {
+				hdrLoader.load( 'textures/equirectangular/royal_esplanade_1k.hdr', function ( texture ) {
 
 					texture.mapping = THREE.EquirectangularReflectionMapping;
 					scene.environment = texture;

+ 2 - 2
examples/webgl_random_uv.html

@@ -28,7 +28,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
@@ -93,7 +93,7 @@
 
 				const noise = new THREE.TextureLoader().load( 'textures/noise.png' );
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'lobe.hdr', function ( texture ) {
 

+ 2 - 2
examples/webgl_renderer_pathtracer.html

@@ -57,7 +57,7 @@
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { LDrawLoader } from 'three/addons/loaders/LDrawLoader.js';
 			import { LDrawUtils } from 'three/addons/utils/LDrawUtils.js';
 			import { LDrawConditionalLineMaterial } from 'three/addons/materials/LDrawConditionalLineMaterial.js';
@@ -210,7 +210,7 @@
 						.catch( onError );
 
 				const envMapPromise =
-					new RGBELoader()
+					new HDRLoader()
 						.setPath( 'textures/equirectangular/' )
 						.loadAsync( 'royal_esplanade_1k.hdr' )
 						.then( tex => {

+ 3 - 3
examples/webgl_tonemapping.html

@@ -32,7 +32,7 @@
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let renderer, scene, camera, controls;
 			let gui, guiExposure = null;
@@ -111,7 +111,7 @@
 				controls.target.set( 0, 0.03, 0 );
 				controls.update();
 
-				const rgbeLoader = new RGBELoader()
+				const hdrLoader = new HDRLoader()
 					.setPath( 'textures/equirectangular/' );
 
 				const dracoLoader = new DRACOLoader();
@@ -122,7 +122,7 @@
 				gltfLoader.setPath( 'models/gltf/' );
 
 				const [ texture, gltf ] = await Promise.all( [
-					rgbeLoader.loadAsync( 'venice_sunset_1k.hdr' ),
+					hdrLoader.loadAsync( 'venice_sunset_1k.hdr' ),
 					gltfLoader.loadAsync( 'venice_mask.glb' ),
 				] );
 

+ 2 - 2
examples/webgl_watch.html

@@ -30,7 +30,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
@@ -81,7 +81,7 @@
 				renderer.shadowMap.type = THREE.VSMShadowMap;
 				container.appendChild( renderer.domElement );
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'lobe.hdr', function ( texture ) {
 

+ 3 - 3
examples/webgpu_compute_cloth.html

@@ -31,7 +31,7 @@
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let renderer, scene, camera, controls;
 
@@ -89,9 +89,9 @@
 				controls.target.set( 0, - 0.1, 0 );
 				controls.update();
 
-				const rgbeLoader = new RGBELoader().setPath( 'textures/equirectangular/' );
+				const hdrLoader = new HDRLoader().setPath( 'textures/equirectangular/' );
 
-				const hdrTexture = await rgbeLoader.loadAsync( 'royal_esplanade_1k.hdr' );
+				const hdrTexture = await hdrLoader.loadAsync( 'royal_esplanade_1k.hdr' );
 				hdrTexture.mapping = THREE.EquirectangularReflectionMapping;
 				scene.background = hdrTexture;
 				scene.backgroundBlurriness = 0.5;

+ 3 - 3
examples/webgpu_compute_particles_fluid.html

@@ -32,7 +32,7 @@
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import * as BufferGeometryUtils from 'three/addons/utils/BufferGeometryUtils.js';
 			import WebGPU from 'three/addons/capabilities/WebGPU.js';
 
@@ -89,9 +89,9 @@
 				controls.maxPolarAngle = Math.PI * 0.35;
 				controls.touches = { TWO: THREE.TOUCH.DOLLY_ROTATE };
 
-				const rgbeLoader = new RGBELoader().setPath( 'textures/equirectangular/' );
+				const hdrLoader = new HDRLoader().setPath( 'textures/equirectangular/' );
 
-				const hdrTexture = await rgbeLoader.loadAsync( 'royal_esplanade_1k.hdr' );
+				const hdrTexture = await hdrLoader.loadAsync( 'royal_esplanade_1k.hdr' );
 				hdrTexture.mapping = THREE.EquirectangularReflectionMapping;
 				scene.background = hdrTexture;
 				scene.backgroundBlurriness = 0.5;

+ 3 - 3
examples/webgpu_compute_water.html

@@ -31,7 +31,7 @@
 
 			import { SimplexNoise } from 'three/addons/math/SimplexNoise.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
  			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 
@@ -391,11 +391,11 @@
 
 				// Models / Textures
 
-				const rgbeLoader = new RGBELoader().setPath( './textures/equirectangular/' );
+				const hdrLoader = new HDRLoader().setPath( './textures/equirectangular/' );
  				const glbloader = new GLTFLoader().setPath( 'models/gltf/' );
  				glbloader.setDRACOLoader( new DRACOLoader().setDecoderPath( 'jsm/libs/draco/gltf/' ) );
 
- 				const [ env, model ] = await Promise.all( [ rgbeLoader.loadAsync( 'blouberg_sunrise_2_1k.hdr' ), glbloader.loadAsync( 'duck.glb' ) ] );
+ 				const [ env, model ] = await Promise.all( [ hdrLoader.loadAsync( 'blouberg_sunrise_2_1k.hdr' ), glbloader.loadAsync( 'duck.glb' ) ] );
  				env.mapping = THREE.EquirectangularReflectionMapping;
  				scene.environment = env;
  				scene.background = env;

+ 2 - 2
examples/webgpu_custom_fog_background.html

@@ -38,7 +38,7 @@
 			import * as THREE from 'three/webgpu';
 			import { pass, color, rangeFogFactor } from 'three/tsl';
 
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
@@ -88,7 +88,7 @@
 
 				//
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'royal_esplanade_1k.hdr', function ( texture ) {
 

+ 2 - 2
examples/webgpu_loader_gltf.html

@@ -30,7 +30,7 @@
 
 			import * as THREE from 'three/webgpu';
 
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
@@ -50,7 +50,7 @@
 
 				scene = new THREE.Scene();
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'royal_esplanade_1k.hdr', function ( texture ) {
 

+ 3 - 3
examples/webgpu_loader_gltf_anisotropy.html

@@ -31,7 +31,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let renderer, scene, camera, controls;
 
@@ -59,11 +59,11 @@
 				controls.addEventListener( 'change', render );
 				controls.update();
 
-				const rgbeLoader = new RGBELoader().setPath( 'textures/equirectangular/' );
+				const hdrLoader = new HDRLoader().setPath( 'textures/equirectangular/' );
 				const gltfLoader = new GLTFLoader().setPath( 'models/gltf/' );
 
 				const [ texture, gltf ] = await Promise.all( [
-					rgbeLoader.loadAsync( 'royal_esplanade_1k.hdr' ),
+					hdrLoader.loadAsync( 'royal_esplanade_1k.hdr' ),
 					gltfLoader.loadAsync( 'AnisotropyBarnLamp.glb' ),
 				] );
 

+ 5 - 5
examples/webgpu_loader_gltf_dispersion.html

@@ -30,7 +30,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let camera, scene, renderer;
 
@@ -54,13 +54,13 @@
 				renderer.toneMappingExposure = 1;
 				container.appendChild( renderer.domElement );
 
-				const rgbeLoader = await new RGBELoader().setPath( 'textures/equirectangular/' ).loadAsync( 'pedestrian_overpass_1k.hdr' );
-				rgbeLoader.mapping = THREE.EquirectangularReflectionMapping;
+				const hdrTexture = await new HDRLoader().setPath( 'textures/equirectangular/' ).loadAsync( 'pedestrian_overpass_1k.hdr' );
+				hdrTexture.mapping = THREE.EquirectangularReflectionMapping;
 
 				scene = new THREE.Scene();
 				scene.backgroundBlurriness = 0.5;
-				scene.environment = rgbeLoader;
-				scene.background = rgbeLoader;
+				scene.environment = hdrTexture;
+				scene.background = hdrTexture;
 
 				const loader = new GLTFLoader();
 				const gltf = await loader.loadAsync( 'models/gltf/DispersionTest.glb' );

+ 3 - 3
examples/webgpu_loader_gltf_iridescence.html

@@ -31,7 +31,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let renderer, scene, camera, controls;
 
@@ -61,13 +61,13 @@
 				controls.target.set( 0, 0.2, 0 );
 				controls.update();
 
-				const rgbeLoader = new RGBELoader()
+				const hdrLoader = new HDRLoader()
 					.setPath( 'textures/equirectangular/' );
 
 				const gltfLoader = new GLTFLoader().setPath( 'models/gltf/' );
 
 				const [ texture, gltf ] = await Promise.all( [
-					rgbeLoader.loadAsync( 'venice_sunset_1k.hdr' ),
+					hdrLoader.loadAsync( 'venice_sunset_1k.hdr' ),
 					gltfLoader.loadAsync( 'IridescenceLamp.glb' ),
 				] );
 

+ 2 - 2
examples/webgpu_loader_gltf_sheen.html

@@ -35,7 +35,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
@@ -81,7 +81,7 @@
 
 				scene.background = new THREE.Color( 0xAAAAAA );
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'royal_esplanade_1k.hdr', function ( texture ) {
 

+ 2 - 2
examples/webgpu_loader_gltf_transmission.html

@@ -31,7 +31,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
 
@@ -51,7 +51,7 @@
 
 				scene = new THREE.Scene();
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'royal_esplanade_1k.hdr', function ( texture ) {
 

+ 2 - 2
examples/webgpu_loader_materialx.html

@@ -36,7 +36,7 @@
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 
 			import { MaterialXLoader } from 'three/addons/loaders/MaterialXLoader.js';
@@ -173,7 +173,7 @@
 
 				//
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'san_giuseppe_bridge_2k.hdr', async ( texture ) => {
 

+ 2 - 2
examples/webgpu_materials_transmission.html

@@ -28,7 +28,7 @@
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			const params = {
 				color: 0xffffff,
@@ -49,7 +49,7 @@
 
 			let mesh;
 
-			const hdrEquirect = new RGBELoader()
+			const hdrEquirect = new HDRLoader()
 				.setPath( 'textures/equirectangular/' )
 				.load( 'royal_esplanade_1k.hdr', function () {
 

+ 2 - 2
examples/webgpu_mrt.html

@@ -29,7 +29,7 @@
 			import * as THREE from 'three/webgpu';
 			import { output, normalView, pass, step, diffuseColor, emissive, directionToColor, screenUV, mix, mrt, Fn } from 'three/tsl';
 
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
@@ -51,7 +51,7 @@
 
 				scene = new THREE.Scene();
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'royal_esplanade_1k.hdr', function ( texture ) {
 

+ 2 - 2
examples/webgpu_performance.html

@@ -39,7 +39,7 @@
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
 
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let camera, scene, renderer, stats;
 			let model;
@@ -93,7 +93,7 @@
 
 				document.body.appendChild( stats.dom );
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'royal_esplanade_1k.hdr', function ( texture ) {
 

+ 2 - 2
examples/webgpu_pmrem_equirectangular.html

@@ -24,7 +24,7 @@
 			import * as THREE from 'three/webgpu';
 			import { normalWorldGeometry, uniform, normalView, positionViewDirection, cameraViewMatrix, pmremTexture } from 'three/tsl';
 
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 
@@ -61,7 +61,7 @@
 				controls.maxDistance = 10;
 				controls.update();
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'royal_esplanade_1k.hdr', function ( map ) {
 

+ 2 - 2
examples/webgpu_postprocessing_bloom_emissive.html

@@ -29,7 +29,7 @@
 			import { pass, mrt, output, emissive } from 'three/tsl';
 			import { bloom } from 'three/addons/tsl/display/BloomNode.js';
 
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
@@ -53,7 +53,7 @@
 
 				scene = new THREE.Scene();
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'moonless_golf_1k.hdr', function ( texture ) {
 

+ 3 - 3
examples/webgpu_tonemapping.html

@@ -34,7 +34,7 @@
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let renderer, scene, camera, controls;
 			let gui, guiExposure = null;
@@ -93,7 +93,7 @@
 				controls.target.set( 0, 0.03, 0 );
 				controls.update();
 
-				const rgbeLoader = new RGBELoader()
+				const hdrLoader = new HDRLoader()
 					.setPath( 'textures/equirectangular/' );
 
 				const dracoLoader = new DRACOLoader();
@@ -104,7 +104,7 @@
 				gltfLoader.setPath( 'models/gltf/' );
 
 				const [ texture, gltf ] = await Promise.all( [
-					rgbeLoader.loadAsync( 'venice_sunset_1k.hdr' ),
+					hdrLoader.loadAsync( 'venice_sunset_1k.hdr' ),
 					gltfLoader.loadAsync( 'venice_mask.glb' ),
 				] );
 

+ 3 - 3
examples/webgpu_tsl_angular_slicing.html

@@ -32,7 +32,7 @@
 
 			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
@@ -51,8 +51,8 @@
 
 				// environment
 
-				const rgbeLoader = new RGBELoader();
-				rgbeLoader.load( './textures/equirectangular/royal_esplanade_1k.hdr', ( environmentMap ) => {
+				const hdrLoader = new HDRLoader();
+				hdrLoader.load( './textures/equirectangular/royal_esplanade_1k.hdr', ( environmentMap ) => {
 
 					environmentMap.mapping = THREE.EquirectangularReflectionMapping;
 

+ 3 - 3
examples/webgpu_tsl_procedural_terrain.html

@@ -32,7 +32,7 @@
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 
 			let camera, scene, renderer, controls, drag;
 
@@ -50,8 +50,8 @@
 
 				// environment
 
-				const rgbeLoader = new RGBELoader();
-				rgbeLoader.load( './textures/equirectangular/pedestrian_overpass_1k.hdr', ( environmentMap ) => {
+				const hdrLoader = new HDRLoader();
+				hdrLoader.load( './textures/equirectangular/pedestrian_overpass_1k.hdr', ( environmentMap ) => {
 
 					environmentMap.mapping = THREE.EquirectangularReflectionMapping;
 

+ 2 - 2
examples/webxr_ar_lighting.html

@@ -24,7 +24,7 @@
 		<script type="module">
 
 			import * as THREE from 'three';
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { ARButton } from 'three/addons/webxr/ARButton.js';
 			import { XREstimatedLight } from 'three/addons/webxr/XREstimatedLight.js';
 
@@ -89,7 +89,7 @@
 
 				//
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'royal_esplanade_1k.hdr', function ( texture ) {
 

+ 2 - 2
examples/webxr_vr_sandbox.html

@@ -20,7 +20,7 @@
 
 			import * as THREE from 'three';
 
-			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
+			import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
 			import { Reflector } from 'three/addons/objects/Reflector.js';
 			import { VRButton } from 'three/addons/webxr/VRButton.js';
 
@@ -51,7 +51,7 @@
 
 				scene = new THREE.Scene();
 
-				new RGBELoader()
+				new HDRLoader()
 					.setPath( 'textures/equirectangular/' )
 					.load( 'moonless_golf_1k.hdr', function ( texture ) {
 

粤ICP备19079148号