diff --git a/docs/examples/en/loaders/GLTFLoader.html b/docs/examples/en/loaders/GLTFLoader.html index e10a8f5f3956e1..45bea43b29e645 100644 --- a/docs/examples/en/loaders/GLTFLoader.html +++ b/docs/examples/en/loaders/GLTFLoader.html @@ -38,7 +38,6 @@

Extensions

  • KHR_texture_transform2
  • EXT_texture_webp
  • EXT_meshopt_compression
  • -
  • MSFT_texture_dds
  • @@ -205,12 +204,6 @@

    [method:null setDRACOLoader]( [param:DRACOLoader dracoLoader] )

    Refer to this [link:https://github.com/mrdoob/three.js/tree/dev/examples/js/libs/draco#readme readme] for the details of Draco and its decoder.

    - -

    [method:null setDDSLoader]( [param:DDSLoader ddsLoader] )

    -

    - [page:DDSLoader ddsLoader] — Instance of THREE.DDSLoader, to be used for loading compressed textures with the MSFT_TEXTURE_DDS extension. -

    -

    [method:null setKTX2Loader]( [param:KTX2Loader ktx2Loader] )

    [page:KTX2Loader ktx2Loader] — Instance of THREE.KTX2Loader, to be used for loading KTX2 compressed textures. diff --git a/docs/examples/zh/loaders/GLTFLoader.html b/docs/examples/zh/loaders/GLTFLoader.html index f169132f112aa1..eca40899a09780 100644 --- a/docs/examples/zh/loaders/GLTFLoader.html +++ b/docs/examples/zh/loaders/GLTFLoader.html @@ -36,7 +36,6 @@

    扩展

  • KHR_texture_transform2
  • EXT_texture_webp
  • EXT_meshopt_compression
  • -
  • MSFT_texture_dds
  • @@ -188,11 +187,6 @@

    [method:null setDRACOLoader]( [param:DRACOLoader dracoLoader] )

    请参阅[link:https://github.com/mrdoob/three.js/tree/dev/examples/js/libs/draco#readme readme]来了解Draco及其解码器的详细信息。

    -

    [method:null setDDSLoader]( [param:DDSLoader ddsLoader] )

    -

    - [page:DDSLoader ddsLoader] — THREE.DDSLoader的实例,用于加载使用MSFT_TEXTURE_DDS扩展压缩过的纹理。 -

    -

    [method:null parse]( [param:ArrayBuffer data], [param:String path], [param:Function onLoad], [param:Function onError] )

    [page:ArrayBuffer data] — 需要解析的glTF文件,值为一个ArrayBuffer或JSON字符串。
    diff --git a/examples/js/loaders/GLTFLoader.js b/examples/js/loaders/GLTFLoader.js index d22d93eef966f8..4aa56e187fbdd7 100644 --- a/examples/js/loaders/GLTFLoader.js +++ b/examples/js/loaders/GLTFLoader.js @@ -5,7 +5,6 @@ THREE.GLTFLoader = ( function () { THREE.Loader.call( this, manager ); this.dracoLoader = null; - this.ddsLoader = null; this.ktx2Loader = null; this.meshoptDecoder = null; @@ -131,10 +130,13 @@ THREE.GLTFLoader = ( function () { }, - setDDSLoader: function ( ddsLoader ) { + setDDSLoader: function () { - this.ddsLoader = ddsLoader; - return this; + throw new Error( + + 'THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".' + + ); }, @@ -268,10 +270,6 @@ THREE.GLTFLoader = ( function () { extensions[ extensionName ] = new GLTFDracoMeshCompressionExtension( json, this.dracoLoader ); break; - case EXTENSIONS.MSFT_TEXTURE_DDS: - extensions[ extensionName ] = new GLTFTextureDDSExtension( this.ddsLoader ); - break; - case EXTENSIONS.KHR_TEXTURE_TRANSFORM: extensions[ extensionName ] = new GLTFTextureTransformExtension(); break; @@ -354,29 +352,9 @@ THREE.GLTFLoader = ( function () { KHR_TEXTURE_TRANSFORM: 'KHR_texture_transform', KHR_MESH_QUANTIZATION: 'KHR_mesh_quantization', EXT_TEXTURE_WEBP: 'EXT_texture_webp', - EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression', - MSFT_TEXTURE_DDS: 'MSFT_texture_dds' + EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression' }; - /** - * DDS Texture Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_texture_dds - * - */ - function GLTFTextureDDSExtension( ddsLoader ) { - - if ( ! ddsLoader ) { - - throw new Error( 'THREE.GLTFLoader: Attempting to load .dds texture without importing THREE.DDSLoader' ); - - } - - this.name = EXTENSIONS.MSFT_TEXTURE_DDS; - this.ddsLoader = ddsLoader; - - } - /** * Punctual Lights Extension * @@ -2387,15 +2365,7 @@ THREE.GLTFLoader = ( function () { var source; - if ( textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ] ) { - - source = json.images[ textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ].source ]; - - } else { - - source = json.images[ textureDef.source ]; - - } + source = json.images[ textureDef.source ]; var loader; @@ -2407,9 +2377,7 @@ THREE.GLTFLoader = ( function () { if ( ! loader ) { - loader = textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ] - ? parser.extensions[ EXTENSIONS.MSFT_TEXTURE_DDS ].ddsLoader - : this.textureLoader; + loader = this.textureLoader; } diff --git a/examples/jsm/loaders/GLTFLoader.js b/examples/jsm/loaders/GLTFLoader.js index 72bd9bd68fc222..1bc1d5e6b4b790 100644 --- a/examples/jsm/loaders/GLTFLoader.js +++ b/examples/jsm/loaders/GLTFLoader.js @@ -70,7 +70,6 @@ var GLTFLoader = ( function () { Loader.call( this, manager ); this.dracoLoader = null; - this.ddsLoader = null; this.ktx2Loader = null; this.meshoptDecoder = null; @@ -196,10 +195,13 @@ var GLTFLoader = ( function () { }, - setDDSLoader: function ( ddsLoader ) { + setDDSLoader: function () { - this.ddsLoader = ddsLoader; - return this; + throw new Error( + + 'THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".' + + ); }, @@ -333,10 +335,6 @@ var GLTFLoader = ( function () { extensions[ extensionName ] = new GLTFDracoMeshCompressionExtension( json, this.dracoLoader ); break; - case EXTENSIONS.MSFT_TEXTURE_DDS: - extensions[ extensionName ] = new GLTFTextureDDSExtension( this.ddsLoader ); - break; - case EXTENSIONS.KHR_TEXTURE_TRANSFORM: extensions[ extensionName ] = new GLTFTextureTransformExtension(); break; @@ -419,29 +417,9 @@ var GLTFLoader = ( function () { KHR_TEXTURE_TRANSFORM: 'KHR_texture_transform', KHR_MESH_QUANTIZATION: 'KHR_mesh_quantization', EXT_TEXTURE_WEBP: 'EXT_texture_webp', - EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression', - MSFT_TEXTURE_DDS: 'MSFT_texture_dds' + EXT_MESHOPT_COMPRESSION: 'EXT_meshopt_compression' }; - /** - * DDS Texture Extension - * - * Specification: https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Vendor/MSFT_texture_dds - * - */ - function GLTFTextureDDSExtension( ddsLoader ) { - - if ( ! ddsLoader ) { - - throw new Error( 'THREE.GLTFLoader: Attempting to load .dds texture without importing DDSLoader' ); - - } - - this.name = EXTENSIONS.MSFT_TEXTURE_DDS; - this.ddsLoader = ddsLoader; - - } - /** * Punctual Lights Extension * @@ -2452,15 +2430,7 @@ var GLTFLoader = ( function () { var source; - if ( textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ] ) { - - source = json.images[ textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ].source ]; - - } else { - - source = json.images[ textureDef.source ]; - - } + source = json.images[ textureDef.source ]; var loader; @@ -2472,9 +2442,7 @@ var GLTFLoader = ( function () { if ( ! loader ) { - loader = textureExtensions[ EXTENSIONS.MSFT_TEXTURE_DDS ] - ? parser.extensions[ EXTENSIONS.MSFT_TEXTURE_DDS ].ddsLoader - : this.textureLoader; + loader = this.textureLoader; } @@ -2631,7 +2599,7 @@ var GLTFLoader = ( function () { * Assigns final material to a Mesh, Line, or Points instance. The instance * already has a material (generated from the glTF material options alone) * but reuse of the same glTF material may require multiple threejs materials - * to accomodate different primitive types, defines, etc. New materials will + * to accommodate different primitive types, defines, etc. New materials will * be created if necessary, and reused from a cache. * @param {Object3D} mesh Mesh, Line, or Points instance. */ diff --git a/examples/models/gltf/BoomBox/glTF-dds/BoomBox.bin b/examples/models/gltf/BoomBox/glTF-dds/BoomBox.bin deleted file mode 100644 index 6e4c9026b1c50f..00000000000000 Binary files a/examples/models/gltf/BoomBox/glTF-dds/BoomBox.bin and /dev/null differ diff --git a/examples/models/gltf/BoomBox/glTF-dds/BoomBox.gltf b/examples/models/gltf/BoomBox/glTF-dds/BoomBox.gltf deleted file mode 100644 index 32b3ddd4fb116a..00000000000000 --- a/examples/models/gltf/BoomBox/glTF-dds/BoomBox.gltf +++ /dev/null @@ -1,237 +0,0 @@ -{ - "accessors": [ - { - "bufferView": 0, - "componentType": 5126, - "count": 3575, - "type": "VEC2", - "max": [ - 0.9999003, - -0.0221377648 - ], - "min": [ - 0.0006585993, - -0.996773958 - ] - }, - { - "bufferView": 1, - "componentType": 5126, - "count": 3575, - "type": "VEC3", - "max": [ - 1.0, - 1.0, - 0.9999782 - ], - "min": [ - -1.0, - -1.0, - -0.9980823 - ] - }, - { - "bufferView": 2, - "componentType": 5126, - "count": 3575, - "type": "VEC4", - "max": [ - 1.0, - 0.9999976, - 1.0, - 1.0 - ], - "min": [ - -0.9991289, - -0.999907851, - -1.0, - 1.0 - ] - }, - { - "bufferView": 3, - "componentType": 5126, - "count": 3575, - "type": "VEC3", - "max": [ - 0.009921154, - 0.00977163, - 0.0100762453 - ], - "min": [ - -0.009921154, - -0.00977163, - -0.0100762453 - ] - }, - { - "bufferView": 4, - "componentType": 5123, - "count": 18108, - "type": "SCALAR", - "max": [ - 3574 - ], - "min": [ - 0 - ] - } - ], - "asset": { - "generator": "glTF Tools for Unity", - "version": "2.0" - }, - "bufferViews": [ - { - "buffer": 0, - "byteLength": 28600 - }, - { - "buffer": 0, - "byteOffset": 28600, - "byteLength": 42900 - }, - { - "buffer": 0, - "byteOffset": 71500, - "byteLength": 57200 - }, - { - "buffer": 0, - "byteOffset": 128700, - "byteLength": 42900 - }, - { - "buffer": 0, - "byteOffset": 171600, - "byteLength": 36216 - } - ], - "buffers": [ - { - "uri": "BoomBox.bin", - "byteLength": 207816 - } - ], - "images": [ - { - "uri": "BoomBox_baseColor.png" - }, - { - "uri": "BoomBox_occlusionRoughnessMetallic.png" - }, - { - "uri": "BoomBox_normal.png" - }, - { - "uri": "BoomBox_emissive.png" - }, - { - "uri": "BoomBox_baseColor.dds" - }, - { - "uri": "BoomBox_occlusionRoughnessMetallic.dds" - }, - { - "uri": "BoomBox_normal.dds" - }, - { - "uri": "BoomBox_emissive.dds" - } - ], - "meshes": [ - { - "primitives": [ - { - "attributes": { - "TEXCOORD_0": 0, - "NORMAL": 1, - "TANGENT": 2, - "POSITION": 3 - }, - "indices": 4, - "material": 0 - } - ], - "name": "BoomBox" - } - ], - "materials": [ - { - "pbrMetallicRoughness": { - "baseColorTexture": { - "index": 0 - }, - "metallicRoughnessTexture": { - "index": 1 - } - }, - "normalTexture": { - "index": 2 - }, - "occlusionTexture": { - "index": 1 - }, - "emissiveFactor": [ - 1.0, - 1.0, - 1.0 - ], - "emissiveTexture": { - "index": 3 - }, - "name": "BoomBox_Mat" - } - ], - "nodes": [ - { - "mesh": 0, - "name": "BoomBox" - } - ], - "scene": 0, - "scenes": [ - { - "nodes": [ - 0 - ] - } - ], - "textures": [ - { - "source": 0, - "extensions": { - "MSFT_texture_dds": { - "source": 4 - } - } - }, - { - "source": 1, - "extensions": { - "MSFT_texture_dds": { - "source": 5 - } - } - }, - { - "source": 2, - "extensions": { - "MSFT_texture_dds": { - "source": 6 - } - } - }, - { - "source": 3, - "extensions": { - "MSFT_texture_dds": { - "source": 7 - } - } - } - ], - "extensionsUsed": [ - "MSFT_texture_dds" - ] -} \ No newline at end of file diff --git a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_baseColor.dds b/examples/models/gltf/BoomBox/glTF-dds/BoomBox_baseColor.dds deleted file mode 100644 index 04fa19296c4f13..00000000000000 Binary files a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_baseColor.dds and /dev/null differ diff --git a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_baseColor.png b/examples/models/gltf/BoomBox/glTF-dds/BoomBox_baseColor.png deleted file mode 100644 index 992429df5b1808..00000000000000 Binary files a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_baseColor.png and /dev/null differ diff --git a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_emissive.dds b/examples/models/gltf/BoomBox/glTF-dds/BoomBox_emissive.dds deleted file mode 100644 index 03879f1c3d2b9b..00000000000000 Binary files a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_emissive.dds and /dev/null differ diff --git a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_emissive.png b/examples/models/gltf/BoomBox/glTF-dds/BoomBox_emissive.png deleted file mode 100644 index 315a499403951d..00000000000000 Binary files a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_emissive.png and /dev/null differ diff --git a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_normal.dds b/examples/models/gltf/BoomBox/glTF-dds/BoomBox_normal.dds deleted file mode 100644 index b41819977688cd..00000000000000 Binary files a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_normal.dds and /dev/null differ diff --git a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_normal.png b/examples/models/gltf/BoomBox/glTF-dds/BoomBox_normal.png deleted file mode 100644 index 19d7afbe7fffa4..00000000000000 Binary files a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_normal.png and /dev/null differ diff --git a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_occlusionRoughnessMetallic.dds b/examples/models/gltf/BoomBox/glTF-dds/BoomBox_occlusionRoughnessMetallic.dds deleted file mode 100644 index 678c8c09edb779..00000000000000 Binary files a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_occlusionRoughnessMetallic.dds and /dev/null differ diff --git a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_occlusionRoughnessMetallic.png b/examples/models/gltf/BoomBox/glTF-dds/BoomBox_occlusionRoughnessMetallic.png deleted file mode 100644 index 25b5b9504379e8..00000000000000 Binary files a/examples/models/gltf/BoomBox/glTF-dds/BoomBox_occlusionRoughnessMetallic.png and /dev/null differ diff --git a/examples/webgl_loader_gltf_extensions.html b/examples/webgl_loader_gltf_extensions.html index d926f62716b7f3..a3be495d8f0be1 100644 --- a/examples/webgl_loader_gltf_extensions.html +++ b/examples/webgl_loader_gltf_extensions.html @@ -21,7 +21,6 @@ import { GUI } from './jsm/libs/dat.gui.module.js'; import { OrbitControls } from './jsm/controls/OrbitControls.js'; import { GLTFLoader } from './jsm/loaders/GLTFLoader.js'; - import { DDSLoader } from './jsm/loaders/DDSLoader.js'; import { DRACOLoader } from './jsm/loaders/DRACOLoader.js'; import { RGBELoader } from './jsm/loaders/RGBELoader.js'; @@ -39,7 +38,7 @@ authorURL: 'https://www.microsoft.com/', cameraPos: new THREE.Vector3( 0.02, 0.01, 0.03 ), objectRotation: new THREE.Euler( 0, Math.PI, 0 ), - extensions: [ 'glTF', 'glTF-pbrSpecularGlossiness', 'glTF-Binary', 'glTF-dds' ], + extensions: [ 'glTF', 'glTF-pbrSpecularGlossiness', 'glTF-Binary' ], addEnvMap: true }, 'Bot Skinned': { @@ -267,8 +266,6 @@ dracoLoader.setDecoderPath( 'js/libs/draco/gltf/' ); loader.setDRACOLoader( dracoLoader ); - loader.setDDSLoader( new DDSLoader() ); - let url = sceneInfo.url.replace( /%s/g, state.extension ); if ( state.extension === 'glTF-Binary' ) {