diff --git a/examples/jsm/loaders/RGBMLoader.d.ts b/examples/jsm/loaders/RGBMLoader.d.ts index aff39a61011011..02e34e2e7cea61 100644 --- a/examples/jsm/loaders/RGBMLoader.d.ts +++ b/examples/jsm/loaders/RGBMLoader.d.ts @@ -3,7 +3,8 @@ import { LoadingManager, DataTextureLoader, PixelFormat, - TextureDataType + TextureDataType, + TextureEncoding } from '../../../src/Three'; export interface RGBM { @@ -13,6 +14,8 @@ export interface RGBM { header: string; format: PixelFormat; type: TextureDataType; + flipY: boolean; + encoding: TextureEncoding; } export class RGBMLoader extends DataTextureLoader { diff --git a/examples/jsm/loaders/RGBMLoader.js b/examples/jsm/loaders/RGBMLoader.js index 54119c9ef959e5..a81e2c98b62d66 100644 --- a/examples/jsm/loaders/RGBMLoader.js +++ b/examples/jsm/loaders/RGBMLoader.js @@ -3,7 +3,8 @@ import { UnsignedByteType, RGBAFormat, LinearFilter, - CubeTexture + CubeTexture, + RGBM7Encoding } from '../../../build/three.module.js'; class RGBMLoader extends DataTextureLoader { @@ -61,7 +62,8 @@ class RGBMLoader extends DataTextureLoader { data: new Uint8Array( rgba ), format: RGBAFormat, type: UnsignedByteType, - flipY: true + flipY: true, + encoding: RGBM7Encoding }; } diff --git a/src/loaders/DataTextureLoader.js b/src/loaders/DataTextureLoader.js index 97e2ca663fbffd..96c82b558925c2 100644 --- a/src/loaders/DataTextureLoader.js +++ b/src/loaders/DataTextureLoader.js @@ -56,6 +56,12 @@ DataTextureLoader.prototype = Object.assign( Object.create( Loader.prototype ), texture.anisotropy = texData.anisotropy !== undefined ? texData.anisotropy : 1; + if ( texData.encoding !== undefined ) { + + texture.encoding = texData.encoding; + + } + if ( texData.flipY !== undefined ) { texture.flipY = texData.flipY;