@babylonjs/loaders 5.0.0-rc.5 → 5.0.0-rc.9
Sign up to get free protection for your applications and to get access to all the features.
- package/OBJ/index.d.ts +4 -4
- package/OBJ/index.js +4 -4
- package/OBJ/mtlFileLoader.d.ts +41 -41
- package/OBJ/mtlFileLoader.js +232 -232
- package/OBJ/objFileLoader.d.ts +126 -126
- package/OBJ/objFileLoader.js +296 -296
- package/OBJ/objLoadingOptions.d.ts +43 -43
- package/OBJ/objLoadingOptions.js +1 -1
- package/OBJ/solidParser.d.ts +154 -154
- package/OBJ/solidParser.js +693 -693
- package/STL/index.d.ts +1 -1
- package/STL/index.js +1 -1
- package/STL/stlFileLoader.d.ts +64 -64
- package/STL/stlFileLoader.js +233 -233
- package/glTF/1.0/glTFBinaryExtension.d.ts +13 -13
- package/glTF/1.0/glTFBinaryExtension.js +60 -60
- package/glTF/1.0/glTFLoader.d.ts +136 -136
- package/glTF/1.0/glTFLoader.js +1815 -1815
- package/glTF/1.0/glTFLoaderInterfaces.d.ts +412 -412
- package/glTF/1.0/glTFLoaderInterfaces.js +95 -95
- package/glTF/1.0/glTFLoaderUtils.d.ts +62 -62
- package/glTF/1.0/glTFLoaderUtils.js +250 -250
- package/glTF/1.0/glTFMaterialsCommonExtension.d.ts +10 -10
- package/glTF/1.0/glTFMaterialsCommonExtension.js +129 -129
- package/glTF/1.0/index.d.ts +5 -5
- package/glTF/1.0/index.js +5 -5
- package/glTF/2.0/Extensions/EXT_lights_image_based.d.ts +43 -43
- package/glTF/2.0/Extensions/EXT_lights_image_based.js +117 -117
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.d.ts +36 -36
- package/glTF/2.0/Extensions/EXT_mesh_gpu_instancing.js +88 -88
- package/glTF/2.0/Extensions/EXT_meshopt_compression.d.ts +34 -34
- package/glTF/2.0/Extensions/EXT_meshopt_compression.js +49 -49
- package/glTF/2.0/Extensions/EXT_texture_webp.d.ts +29 -29
- package/glTF/2.0/Extensions/EXT_texture_webp.js +40 -40
- package/glTF/2.0/Extensions/ExtrasAsMetadata.d.ts +50 -50
- package/glTF/2.0/Extensions/ExtrasAsMetadata.js +73 -73
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_draco_mesh_compression.js +112 -112
- package/glTF/2.0/Extensions/KHR_lights_punctual.d.ts +36 -36
- package/glTF/2.0/Extensions/KHR_lights_punctual.js +89 -89
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_materials_clearcoat.js +94 -94
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +53 -53
- package/glTF/2.0/Extensions/KHR_materials_ior.d.ts +42 -42
- package/glTF/2.0/Extensions/KHR_materials_ior.js +62 -62
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_pbrSpecularGlossiness.js +80 -80
- package/glTF/2.0/Extensions/KHR_materials_sheen.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_materials_sheen.js +84 -84
- package/glTF/2.0/Extensions/KHR_materials_specular.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_specular.js +74 -74
- package/glTF/2.0/Extensions/KHR_materials_translucency.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_materials_translucency.js +83 -83
- package/glTF/2.0/Extensions/KHR_materials_transmission.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_transmission.js +288 -288
- package/glTF/2.0/Extensions/KHR_materials_unlit.d.ts +38 -38
- package/glTF/2.0/Extensions/KHR_materials_unlit.js +73 -73
- package/glTF/2.0/Extensions/KHR_materials_variants.d.ts +87 -87
- package/glTF/2.0/Extensions/KHR_materials_variants.js +254 -254
- package/glTF/2.0/Extensions/KHR_materials_volume.d.ts +39 -39
- package/glTF/2.0/Extensions/KHR_materials_volume.js +85 -85
- package/glTF/2.0/Extensions/KHR_mesh_quantization.d.ts +22 -22
- package/glTF/2.0/Extensions/KHR_mesh_quantization.js +23 -23
- package/glTF/2.0/Extensions/KHR_texture_basisu.d.ts +29 -29
- package/glTF/2.0/Extensions/KHR_texture_basisu.js +40 -40
- package/glTF/2.0/Extensions/KHR_texture_transform.d.ts +33 -33
- package/glTF/2.0/Extensions/KHR_texture_transform.js +61 -61
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.d.ts +32 -32
- package/glTF/2.0/Extensions/KHR_xmp_json_ld.js +49 -49
- package/glTF/2.0/Extensions/MSFT_audio_emitter.d.ts +54 -54
- package/glTF/2.0/Extensions/MSFT_audio_emitter.js +240 -240
- package/glTF/2.0/Extensions/MSFT_lod.d.ts +109 -109
- package/glTF/2.0/Extensions/MSFT_lod.js +369 -369
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.d.ts +14 -14
- package/glTF/2.0/Extensions/MSFT_minecraftMesh.js +36 -36
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.d.ts +14 -14
- package/glTF/2.0/Extensions/MSFT_sRGBFactors.js +36 -36
- package/glTF/2.0/Extensions/index.d.ts +26 -26
- package/glTF/2.0/Extensions/index.js +26 -26
- package/glTF/2.0/glTFLoader.d.ts +405 -405
- package/glTF/2.0/glTFLoader.js +2366 -2366
- package/glTF/2.0/glTFLoaderExtension.d.ts +152 -152
- package/glTF/2.0/glTFLoaderExtension.js +1 -1
- package/glTF/2.0/glTFLoaderInterfaces.d.ts +211 -211
- package/glTF/2.0/glTFLoaderInterfaces.js +1 -1
- package/glTF/2.0/index.d.ts +4 -4
- package/glTF/2.0/index.js +4 -4
- package/glTF/glTFFileLoader.d.ts +433 -433
- package/glTF/glTFFileLoader.js +927 -927
- package/glTF/glTFValidation.d.ts +29 -29
- package/glTF/glTFValidation.js +123 -123
- package/glTF/index.d.ts +5 -5
- package/glTF/index.js +5 -5
- package/index.d.ts +3 -3
- package/index.js +3 -3
- package/legacy/legacy-glTF.d.ts +2 -2
- package/legacy/legacy-glTF.js +18 -18
- package/legacy/legacy-glTF1.d.ts +2 -2
- package/legacy/legacy-glTF1.js +14 -14
- package/legacy/legacy-glTF1FileLoader.d.ts +2 -2
- package/legacy/legacy-glTF1FileLoader.js +3 -3
- package/legacy/legacy-glTF2.d.ts +2 -2
- package/legacy/legacy-glTF2.js +32 -32
- package/legacy/legacy-glTF2FileLoader.d.ts +2 -2
- package/legacy/legacy-glTF2FileLoader.js +3 -3
- package/legacy/legacy-glTFFileLoader.d.ts +3 -3
- package/legacy/legacy-glTFFileLoader.js +4 -4
- package/legacy/legacy-objFileLoader.d.ts +1 -1
- package/legacy/legacy-objFileLoader.js +12 -12
- package/legacy/legacy-stlFileLoader.d.ts +1 -1
- package/legacy/legacy-stlFileLoader.js +12 -12
- package/legacy/legacy.d.ts +6 -6
- package/legacy/legacy.js +7 -7
- package/package.json +3 -3
@@ -1,86 +1,86 @@
|
|
1
|
-
import { PBRMaterial } from "@babylonjs/core/Materials/PBR/pbrMaterial.js";
|
2
|
-
import { GLTFLoader } from "../glTFLoader
|
3
|
-
var NAME = "KHR_materials_volume";
|
4
|
-
/**
|
5
|
-
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume)
|
6
|
-
* @since 5.0.0
|
7
|
-
*/
|
8
|
-
var KHR_materials_volume = /** @class */ (function () {
|
9
|
-
/**
|
10
|
-
* @param loader
|
11
|
-
* @hidden
|
12
|
-
*/
|
13
|
-
function KHR_materials_volume(loader) {
|
14
|
-
/**
|
15
|
-
* The name of this extension.
|
16
|
-
*/
|
17
|
-
this.name = NAME;
|
18
|
-
/**
|
19
|
-
* Defines a number that determines the order the extensions are applied.
|
20
|
-
*/
|
21
|
-
this.order = 173;
|
22
|
-
this._loader = loader;
|
23
|
-
this.enabled = this._loader.isExtensionUsed(NAME);
|
24
|
-
if (this.enabled) {
|
25
|
-
// We need to disable instance usage because the attenuation factor depends on the node scale of each individual mesh
|
26
|
-
this._loader._disableInstancedMesh++;
|
27
|
-
}
|
28
|
-
}
|
29
|
-
/** @hidden */
|
30
|
-
KHR_materials_volume.prototype.dispose = function () {
|
31
|
-
if (this.enabled) {
|
32
|
-
this._loader._disableInstancedMesh--;
|
33
|
-
}
|
34
|
-
this._loader = null;
|
35
|
-
};
|
36
|
-
/**
|
37
|
-
* @param context
|
38
|
-
* @param material
|
39
|
-
* @param babylonMaterial
|
40
|
-
* @hidden
|
41
|
-
*/
|
42
|
-
KHR_materials_volume.prototype.loadMaterialPropertiesAsync = function (context, material, babylonMaterial) {
|
43
|
-
var _this = this;
|
44
|
-
return GLTFLoader.LoadExtensionAsync(context, material, this.name, function (extensionContext, extension) {
|
45
|
-
var promises = new Array();
|
46
|
-
promises.push(_this._loader.loadMaterialBasePropertiesAsync(context, material, babylonMaterial));
|
47
|
-
promises.push(_this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));
|
48
|
-
promises.push(_this._loadVolumePropertiesAsync(extensionContext, material, babylonMaterial, extension));
|
49
|
-
return Promise.all(promises).then(function () { });
|
50
|
-
});
|
51
|
-
};
|
52
|
-
KHR_materials_volume.prototype._loadVolumePropertiesAsync = function (context, material, babylonMaterial, extension) {
|
53
|
-
if (!(babylonMaterial instanceof PBRMaterial)) {
|
54
|
-
throw new Error("".concat(context, ": Material type not supported"));
|
55
|
-
}
|
56
|
-
// If transparency isn't enabled already, this extension shouldn't do anything.
|
57
|
-
// i.e. it requires either the KHR_materials_transmission or KHR_materials_translucency extensions.
|
58
|
-
if ((!babylonMaterial.subSurface.isRefractionEnabled && !babylonMaterial.subSurface.isTranslucencyEnabled) || !extension.thicknessFactor) {
|
59
|
-
return Promise.resolve();
|
60
|
-
}
|
61
|
-
// IOR in this extension only affects interior.
|
62
|
-
babylonMaterial.subSurface.volumeIndexOfRefraction = babylonMaterial.indexOfRefraction;
|
63
|
-
var attenuationDistance = extension.attenuationDistance !== undefined ? extension.attenuationDistance : Number.MAX_VALUE;
|
64
|
-
babylonMaterial.subSurface.tintColorAtDistance = attenuationDistance;
|
65
|
-
if (extension.attenuationColor !== undefined && extension.attenuationColor.length == 3) {
|
66
|
-
babylonMaterial.subSurface.tintColor.copyFromFloats(extension.attenuationColor[0], extension.attenuationColor[1], extension.attenuationColor[2]);
|
67
|
-
}
|
68
|
-
babylonMaterial.subSurface.minimumThickness = 0.0;
|
69
|
-
babylonMaterial.subSurface.maximumThickness = extension.thicknessFactor;
|
70
|
-
babylonMaterial.subSurface.useThicknessAsDepth = true;
|
71
|
-
if (extension.thicknessTexture) {
|
72
|
-
extension.thicknessTexture.nonColorData = true;
|
73
|
-
return this._loader.loadTextureInfoAsync("".concat(context, "/thicknessTexture"), extension.thicknessTexture).then(function (texture) {
|
74
|
-
babylonMaterial.subSurface.thicknessTexture = texture;
|
75
|
-
babylonMaterial.subSurface.useGltfStyleTextures = true;
|
76
|
-
});
|
77
|
-
}
|
78
|
-
else {
|
79
|
-
return Promise.resolve();
|
80
|
-
}
|
81
|
-
};
|
82
|
-
return KHR_materials_volume;
|
83
|
-
}());
|
84
|
-
export { KHR_materials_volume };
|
85
|
-
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_materials_volume(loader); });
|
1
|
+
import { PBRMaterial } from "@babylonjs/core/Materials/PBR/pbrMaterial.js";
|
2
|
+
import { GLTFLoader } from "../glTFLoader";
|
3
|
+
var NAME = "KHR_materials_volume";
|
4
|
+
/**
|
5
|
+
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_volume)
|
6
|
+
* @since 5.0.0
|
7
|
+
*/
|
8
|
+
var KHR_materials_volume = /** @class */ (function () {
|
9
|
+
/**
|
10
|
+
* @param loader
|
11
|
+
* @hidden
|
12
|
+
*/
|
13
|
+
function KHR_materials_volume(loader) {
|
14
|
+
/**
|
15
|
+
* The name of this extension.
|
16
|
+
*/
|
17
|
+
this.name = NAME;
|
18
|
+
/**
|
19
|
+
* Defines a number that determines the order the extensions are applied.
|
20
|
+
*/
|
21
|
+
this.order = 173;
|
22
|
+
this._loader = loader;
|
23
|
+
this.enabled = this._loader.isExtensionUsed(NAME);
|
24
|
+
if (this.enabled) {
|
25
|
+
// We need to disable instance usage because the attenuation factor depends on the node scale of each individual mesh
|
26
|
+
this._loader._disableInstancedMesh++;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
/** @hidden */
|
30
|
+
KHR_materials_volume.prototype.dispose = function () {
|
31
|
+
if (this.enabled) {
|
32
|
+
this._loader._disableInstancedMesh--;
|
33
|
+
}
|
34
|
+
this._loader = null;
|
35
|
+
};
|
36
|
+
/**
|
37
|
+
* @param context
|
38
|
+
* @param material
|
39
|
+
* @param babylonMaterial
|
40
|
+
* @hidden
|
41
|
+
*/
|
42
|
+
KHR_materials_volume.prototype.loadMaterialPropertiesAsync = function (context, material, babylonMaterial) {
|
43
|
+
var _this = this;
|
44
|
+
return GLTFLoader.LoadExtensionAsync(context, material, this.name, function (extensionContext, extension) {
|
45
|
+
var promises = new Array();
|
46
|
+
promises.push(_this._loader.loadMaterialBasePropertiesAsync(context, material, babylonMaterial));
|
47
|
+
promises.push(_this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial));
|
48
|
+
promises.push(_this._loadVolumePropertiesAsync(extensionContext, material, babylonMaterial, extension));
|
49
|
+
return Promise.all(promises).then(function () { });
|
50
|
+
});
|
51
|
+
};
|
52
|
+
KHR_materials_volume.prototype._loadVolumePropertiesAsync = function (context, material, babylonMaterial, extension) {
|
53
|
+
if (!(babylonMaterial instanceof PBRMaterial)) {
|
54
|
+
throw new Error("".concat(context, ": Material type not supported"));
|
55
|
+
}
|
56
|
+
// If transparency isn't enabled already, this extension shouldn't do anything.
|
57
|
+
// i.e. it requires either the KHR_materials_transmission or KHR_materials_translucency extensions.
|
58
|
+
if ((!babylonMaterial.subSurface.isRefractionEnabled && !babylonMaterial.subSurface.isTranslucencyEnabled) || !extension.thicknessFactor) {
|
59
|
+
return Promise.resolve();
|
60
|
+
}
|
61
|
+
// IOR in this extension only affects interior.
|
62
|
+
babylonMaterial.subSurface.volumeIndexOfRefraction = babylonMaterial.indexOfRefraction;
|
63
|
+
var attenuationDistance = extension.attenuationDistance !== undefined ? extension.attenuationDistance : Number.MAX_VALUE;
|
64
|
+
babylonMaterial.subSurface.tintColorAtDistance = attenuationDistance;
|
65
|
+
if (extension.attenuationColor !== undefined && extension.attenuationColor.length == 3) {
|
66
|
+
babylonMaterial.subSurface.tintColor.copyFromFloats(extension.attenuationColor[0], extension.attenuationColor[1], extension.attenuationColor[2]);
|
67
|
+
}
|
68
|
+
babylonMaterial.subSurface.minimumThickness = 0.0;
|
69
|
+
babylonMaterial.subSurface.maximumThickness = extension.thicknessFactor;
|
70
|
+
babylonMaterial.subSurface.useThicknessAsDepth = true;
|
71
|
+
if (extension.thicknessTexture) {
|
72
|
+
extension.thicknessTexture.nonColorData = true;
|
73
|
+
return this._loader.loadTextureInfoAsync("".concat(context, "/thicknessTexture"), extension.thicknessTexture).then(function (texture) {
|
74
|
+
babylonMaterial.subSurface.thicknessTexture = texture;
|
75
|
+
babylonMaterial.subSurface.useGltfStyleTextures = true;
|
76
|
+
});
|
77
|
+
}
|
78
|
+
else {
|
79
|
+
return Promise.resolve();
|
80
|
+
}
|
81
|
+
};
|
82
|
+
return KHR_materials_volume;
|
83
|
+
}());
|
84
|
+
export { KHR_materials_volume };
|
85
|
+
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_materials_volume(loader); });
|
86
86
|
//# sourceMappingURL=KHR_materials_volume.js.map
|
@@ -1,22 +1,22 @@
|
|
1
|
-
import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
|
2
|
-
import { GLTFLoader } from "../glTFLoader";
|
3
|
-
/**
|
4
|
-
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization)
|
5
|
-
*/
|
6
|
-
export declare class KHR_mesh_quantization implements IGLTFLoaderExtension {
|
7
|
-
/**
|
8
|
-
* The name of this extension.
|
9
|
-
*/
|
10
|
-
readonly name = "KHR_mesh_quantization";
|
11
|
-
/**
|
12
|
-
* Defines whether this extension is enabled.
|
13
|
-
*/
|
14
|
-
enabled: boolean;
|
15
|
-
/**
|
16
|
-
* @param loader
|
17
|
-
* @hidden
|
18
|
-
*/
|
19
|
-
constructor(loader: GLTFLoader);
|
20
|
-
/** @hidden */
|
21
|
-
dispose(): void;
|
22
|
-
}
|
1
|
+
import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
|
2
|
+
import { GLTFLoader } from "../glTFLoader";
|
3
|
+
/**
|
4
|
+
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization)
|
5
|
+
*/
|
6
|
+
export declare class KHR_mesh_quantization implements IGLTFLoaderExtension {
|
7
|
+
/**
|
8
|
+
* The name of this extension.
|
9
|
+
*/
|
10
|
+
readonly name = "KHR_mesh_quantization";
|
11
|
+
/**
|
12
|
+
* Defines whether this extension is enabled.
|
13
|
+
*/
|
14
|
+
enabled: boolean;
|
15
|
+
/**
|
16
|
+
* @param loader
|
17
|
+
* @hidden
|
18
|
+
*/
|
19
|
+
constructor(loader: GLTFLoader);
|
20
|
+
/** @hidden */
|
21
|
+
dispose(): void;
|
22
|
+
}
|
@@ -1,24 +1,24 @@
|
|
1
|
-
import { GLTFLoader } from "../glTFLoader
|
2
|
-
var NAME = "KHR_mesh_quantization";
|
3
|
-
/**
|
4
|
-
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization)
|
5
|
-
*/
|
6
|
-
var KHR_mesh_quantization = /** @class */ (function () {
|
7
|
-
/**
|
8
|
-
* @param loader
|
9
|
-
* @hidden
|
10
|
-
*/
|
11
|
-
function KHR_mesh_quantization(loader) {
|
12
|
-
/**
|
13
|
-
* The name of this extension.
|
14
|
-
*/
|
15
|
-
this.name = NAME;
|
16
|
-
this.enabled = loader.isExtensionUsed(NAME);
|
17
|
-
}
|
18
|
-
/** @hidden */
|
19
|
-
KHR_mesh_quantization.prototype.dispose = function () { };
|
20
|
-
return KHR_mesh_quantization;
|
21
|
-
}());
|
22
|
-
export { KHR_mesh_quantization };
|
23
|
-
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_mesh_quantization(loader); });
|
1
|
+
import { GLTFLoader } from "../glTFLoader";
|
2
|
+
var NAME = "KHR_mesh_quantization";
|
3
|
+
/**
|
4
|
+
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_mesh_quantization)
|
5
|
+
*/
|
6
|
+
var KHR_mesh_quantization = /** @class */ (function () {
|
7
|
+
/**
|
8
|
+
* @param loader
|
9
|
+
* @hidden
|
10
|
+
*/
|
11
|
+
function KHR_mesh_quantization(loader) {
|
12
|
+
/**
|
13
|
+
* The name of this extension.
|
14
|
+
*/
|
15
|
+
this.name = NAME;
|
16
|
+
this.enabled = loader.isExtensionUsed(NAME);
|
17
|
+
}
|
18
|
+
/** @hidden */
|
19
|
+
KHR_mesh_quantization.prototype.dispose = function () { };
|
20
|
+
return KHR_mesh_quantization;
|
21
|
+
}());
|
22
|
+
export { KHR_mesh_quantization };
|
23
|
+
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_mesh_quantization(loader); });
|
24
24
|
//# sourceMappingURL=KHR_mesh_quantization.js.map
|
@@ -1,29 +1,29 @@
|
|
1
|
-
import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
|
2
|
-
import { GLTFLoader } from "../glTFLoader";
|
3
|
-
import { ITexture } from "../glTFLoaderInterfaces";
|
4
|
-
import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
|
5
|
-
import { Nullable } from "@babylonjs/core/types.js";
|
6
|
-
/**
|
7
|
-
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu)
|
8
|
-
*/
|
9
|
-
export declare class KHR_texture_basisu implements IGLTFLoaderExtension {
|
10
|
-
/** The name of this extension. */
|
11
|
-
readonly name = "KHR_texture_basisu";
|
12
|
-
/** Defines whether this extension is enabled. */
|
13
|
-
enabled: boolean;
|
14
|
-
private _loader;
|
15
|
-
/**
|
16
|
-
* @param loader
|
17
|
-
* @hidden
|
18
|
-
*/
|
19
|
-
constructor(loader: GLTFLoader);
|
20
|
-
/** @hidden */
|
21
|
-
dispose(): void;
|
22
|
-
/**
|
23
|
-
* @param context
|
24
|
-
* @param texture
|
25
|
-
* @param assign
|
26
|
-
* @hidden
|
27
|
-
*/
|
28
|
-
_loadTextureAsync(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
|
29
|
-
}
|
1
|
+
import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
|
2
|
+
import { GLTFLoader } from "../glTFLoader";
|
3
|
+
import { ITexture } from "../glTFLoaderInterfaces";
|
4
|
+
import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
|
5
|
+
import { Nullable } from "@babylonjs/core/types.js";
|
6
|
+
/**
|
7
|
+
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu)
|
8
|
+
*/
|
9
|
+
export declare class KHR_texture_basisu implements IGLTFLoaderExtension {
|
10
|
+
/** The name of this extension. */
|
11
|
+
readonly name = "KHR_texture_basisu";
|
12
|
+
/** Defines whether this extension is enabled. */
|
13
|
+
enabled: boolean;
|
14
|
+
private _loader;
|
15
|
+
/**
|
16
|
+
* @param loader
|
17
|
+
* @hidden
|
18
|
+
*/
|
19
|
+
constructor(loader: GLTFLoader);
|
20
|
+
/** @hidden */
|
21
|
+
dispose(): void;
|
22
|
+
/**
|
23
|
+
* @param context
|
24
|
+
* @param texture
|
25
|
+
* @param assign
|
26
|
+
* @hidden
|
27
|
+
*/
|
28
|
+
_loadTextureAsync(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
|
29
|
+
}
|
@@ -1,41 +1,41 @@
|
|
1
|
-
import { GLTFLoader, ArrayItem } from "../glTFLoader
|
2
|
-
var NAME = "KHR_texture_basisu";
|
3
|
-
/**
|
4
|
-
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu)
|
5
|
-
*/
|
6
|
-
var KHR_texture_basisu = /** @class */ (function () {
|
7
|
-
/**
|
8
|
-
* @param loader
|
9
|
-
* @hidden
|
10
|
-
*/
|
11
|
-
function KHR_texture_basisu(loader) {
|
12
|
-
/** The name of this extension. */
|
13
|
-
this.name = NAME;
|
14
|
-
this._loader = loader;
|
15
|
-
this.enabled = loader.isExtensionUsed(NAME);
|
16
|
-
}
|
17
|
-
/** @hidden */
|
18
|
-
KHR_texture_basisu.prototype.dispose = function () {
|
19
|
-
this._loader = null;
|
20
|
-
};
|
21
|
-
/**
|
22
|
-
* @param context
|
23
|
-
* @param texture
|
24
|
-
* @param assign
|
25
|
-
* @hidden
|
26
|
-
*/
|
27
|
-
KHR_texture_basisu.prototype._loadTextureAsync = function (context, texture, assign) {
|
28
|
-
var _this = this;
|
29
|
-
return GLTFLoader.LoadExtensionAsync(context, texture, this.name, function (extensionContext, extension) {
|
30
|
-
var sampler = texture.sampler == undefined ? GLTFLoader.DefaultSampler : ArrayItem.Get("".concat(context, "/sampler"), _this._loader.gltf.samplers, texture.sampler);
|
31
|
-
var image = ArrayItem.Get("".concat(extensionContext, "/source"), _this._loader.gltf.images, extension.source);
|
32
|
-
return _this._loader._createTextureAsync(context, sampler, image, function (babylonTexture) {
|
33
|
-
assign(babylonTexture);
|
34
|
-
}, texture._textureInfo.nonColorData ? { useRGBAIfASTCBC7NotAvailableWhenUASTC: true } : undefined, !texture._textureInfo.nonColorData);
|
35
|
-
});
|
36
|
-
};
|
37
|
-
return KHR_texture_basisu;
|
38
|
-
}());
|
39
|
-
export { KHR_texture_basisu };
|
40
|
-
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_texture_basisu(loader); });
|
1
|
+
import { GLTFLoader, ArrayItem } from "../glTFLoader";
|
2
|
+
var NAME = "KHR_texture_basisu";
|
3
|
+
/**
|
4
|
+
* [Specification](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_texture_basisu)
|
5
|
+
*/
|
6
|
+
var KHR_texture_basisu = /** @class */ (function () {
|
7
|
+
/**
|
8
|
+
* @param loader
|
9
|
+
* @hidden
|
10
|
+
*/
|
11
|
+
function KHR_texture_basisu(loader) {
|
12
|
+
/** The name of this extension. */
|
13
|
+
this.name = NAME;
|
14
|
+
this._loader = loader;
|
15
|
+
this.enabled = loader.isExtensionUsed(NAME);
|
16
|
+
}
|
17
|
+
/** @hidden */
|
18
|
+
KHR_texture_basisu.prototype.dispose = function () {
|
19
|
+
this._loader = null;
|
20
|
+
};
|
21
|
+
/**
|
22
|
+
* @param context
|
23
|
+
* @param texture
|
24
|
+
* @param assign
|
25
|
+
* @hidden
|
26
|
+
*/
|
27
|
+
KHR_texture_basisu.prototype._loadTextureAsync = function (context, texture, assign) {
|
28
|
+
var _this = this;
|
29
|
+
return GLTFLoader.LoadExtensionAsync(context, texture, this.name, function (extensionContext, extension) {
|
30
|
+
var sampler = texture.sampler == undefined ? GLTFLoader.DefaultSampler : ArrayItem.Get("".concat(context, "/sampler"), _this._loader.gltf.samplers, texture.sampler);
|
31
|
+
var image = ArrayItem.Get("".concat(extensionContext, "/source"), _this._loader.gltf.images, extension.source);
|
32
|
+
return _this._loader._createTextureAsync(context, sampler, image, function (babylonTexture) {
|
33
|
+
assign(babylonTexture);
|
34
|
+
}, texture._textureInfo.nonColorData ? { useRGBAIfASTCBC7NotAvailableWhenUASTC: true } : undefined, !texture._textureInfo.nonColorData);
|
35
|
+
});
|
36
|
+
};
|
37
|
+
return KHR_texture_basisu;
|
38
|
+
}());
|
39
|
+
export { KHR_texture_basisu };
|
40
|
+
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_texture_basisu(loader); });
|
41
41
|
//# sourceMappingURL=KHR_texture_basisu.js.map
|
@@ -1,33 +1,33 @@
|
|
1
|
-
import { Nullable } from "@babylonjs/core/types.js";
|
2
|
-
import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
|
3
|
-
import { ITextureInfo } from "../glTFLoaderInterfaces";
|
4
|
-
import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
|
5
|
-
import { GLTFLoader } from "../glTFLoader";
|
6
|
-
/**
|
7
|
-
* [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform)
|
8
|
-
*/
|
9
|
-
export declare class KHR_texture_transform implements IGLTFLoaderExtension {
|
10
|
-
/**
|
11
|
-
* The name of this extension.
|
12
|
-
*/
|
13
|
-
readonly name = "KHR_texture_transform";
|
14
|
-
/**
|
15
|
-
* Defines whether this extension is enabled.
|
16
|
-
*/
|
17
|
-
enabled: boolean;
|
18
|
-
private _loader;
|
19
|
-
/**
|
20
|
-
* @param loader
|
21
|
-
* @hidden
|
22
|
-
*/
|
23
|
-
constructor(loader: GLTFLoader);
|
24
|
-
/** @hidden */
|
25
|
-
dispose(): void;
|
26
|
-
/**
|
27
|
-
* @param context
|
28
|
-
* @param textureInfo
|
29
|
-
* @param assign
|
30
|
-
* @hidden
|
31
|
-
*/
|
32
|
-
loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
|
33
|
-
}
|
1
|
+
import { Nullable } from "@babylonjs/core/types.js";
|
2
|
+
import { BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
|
3
|
+
import { ITextureInfo } from "../glTFLoaderInterfaces";
|
4
|
+
import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
|
5
|
+
import { GLTFLoader } from "../glTFLoader";
|
6
|
+
/**
|
7
|
+
* [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform)
|
8
|
+
*/
|
9
|
+
export declare class KHR_texture_transform implements IGLTFLoaderExtension {
|
10
|
+
/**
|
11
|
+
* The name of this extension.
|
12
|
+
*/
|
13
|
+
readonly name = "KHR_texture_transform";
|
14
|
+
/**
|
15
|
+
* Defines whether this extension is enabled.
|
16
|
+
*/
|
17
|
+
enabled: boolean;
|
18
|
+
private _loader;
|
19
|
+
/**
|
20
|
+
* @param loader
|
21
|
+
* @hidden
|
22
|
+
*/
|
23
|
+
constructor(loader: GLTFLoader);
|
24
|
+
/** @hidden */
|
25
|
+
dispose(): void;
|
26
|
+
/**
|
27
|
+
* @param context
|
28
|
+
* @param textureInfo
|
29
|
+
* @param assign
|
30
|
+
* @hidden
|
31
|
+
*/
|
32
|
+
loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
|
33
|
+
}
|
@@ -1,62 +1,62 @@
|
|
1
|
-
import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
2
|
-
import { GLTFLoader } from "../glTFLoader
|
3
|
-
var NAME = "KHR_texture_transform";
|
4
|
-
/**
|
5
|
-
* [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform)
|
6
|
-
*/
|
7
|
-
var KHR_texture_transform = /** @class */ (function () {
|
8
|
-
/**
|
9
|
-
* @param loader
|
10
|
-
* @hidden
|
11
|
-
*/
|
12
|
-
function KHR_texture_transform(loader) {
|
13
|
-
/**
|
14
|
-
* The name of this extension.
|
15
|
-
*/
|
16
|
-
this.name = NAME;
|
17
|
-
this._loader = loader;
|
18
|
-
this.enabled = this._loader.isExtensionUsed(NAME);
|
19
|
-
}
|
20
|
-
/** @hidden */
|
21
|
-
KHR_texture_transform.prototype.dispose = function () {
|
22
|
-
this._loader = null;
|
23
|
-
};
|
24
|
-
/**
|
25
|
-
* @param context
|
26
|
-
* @param textureInfo
|
27
|
-
* @param assign
|
28
|
-
* @hidden
|
29
|
-
*/
|
30
|
-
KHR_texture_transform.prototype.loadTextureInfoAsync = function (context, textureInfo, assign) {
|
31
|
-
var _this = this;
|
32
|
-
return GLTFLoader.LoadExtensionAsync(context, textureInfo, this.name, function (extensionContext, extension) {
|
33
|
-
return _this._loader.loadTextureInfoAsync(context, textureInfo, function (babylonTexture) {
|
34
|
-
if (!(babylonTexture instanceof Texture)) {
|
35
|
-
throw new Error("".concat(extensionContext, ": Texture type not supported"));
|
36
|
-
}
|
37
|
-
if (extension.offset) {
|
38
|
-
babylonTexture.uOffset = extension.offset[0];
|
39
|
-
babylonTexture.vOffset = extension.offset[1];
|
40
|
-
}
|
41
|
-
// Always rotate around the origin.
|
42
|
-
babylonTexture.uRotationCenter = 0;
|
43
|
-
babylonTexture.vRotationCenter = 0;
|
44
|
-
if (extension.rotation) {
|
45
|
-
babylonTexture.wAng = -extension.rotation;
|
46
|
-
}
|
47
|
-
if (extension.scale) {
|
48
|
-
babylonTexture.uScale = extension.scale[0];
|
49
|
-
babylonTexture.vScale = extension.scale[1];
|
50
|
-
}
|
51
|
-
if (extension.texCoord != undefined) {
|
52
|
-
babylonTexture.coordinatesIndex = extension.texCoord;
|
53
|
-
}
|
54
|
-
assign(babylonTexture);
|
55
|
-
});
|
56
|
-
});
|
57
|
-
};
|
58
|
-
return KHR_texture_transform;
|
59
|
-
}());
|
60
|
-
export { KHR_texture_transform };
|
61
|
-
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_texture_transform(loader); });
|
1
|
+
import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
|
2
|
+
import { GLTFLoader } from "../glTFLoader";
|
3
|
+
var NAME = "KHR_texture_transform";
|
4
|
+
/**
|
5
|
+
* [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform)
|
6
|
+
*/
|
7
|
+
var KHR_texture_transform = /** @class */ (function () {
|
8
|
+
/**
|
9
|
+
* @param loader
|
10
|
+
* @hidden
|
11
|
+
*/
|
12
|
+
function KHR_texture_transform(loader) {
|
13
|
+
/**
|
14
|
+
* The name of this extension.
|
15
|
+
*/
|
16
|
+
this.name = NAME;
|
17
|
+
this._loader = loader;
|
18
|
+
this.enabled = this._loader.isExtensionUsed(NAME);
|
19
|
+
}
|
20
|
+
/** @hidden */
|
21
|
+
KHR_texture_transform.prototype.dispose = function () {
|
22
|
+
this._loader = null;
|
23
|
+
};
|
24
|
+
/**
|
25
|
+
* @param context
|
26
|
+
* @param textureInfo
|
27
|
+
* @param assign
|
28
|
+
* @hidden
|
29
|
+
*/
|
30
|
+
KHR_texture_transform.prototype.loadTextureInfoAsync = function (context, textureInfo, assign) {
|
31
|
+
var _this = this;
|
32
|
+
return GLTFLoader.LoadExtensionAsync(context, textureInfo, this.name, function (extensionContext, extension) {
|
33
|
+
return _this._loader.loadTextureInfoAsync(context, textureInfo, function (babylonTexture) {
|
34
|
+
if (!(babylonTexture instanceof Texture)) {
|
35
|
+
throw new Error("".concat(extensionContext, ": Texture type not supported"));
|
36
|
+
}
|
37
|
+
if (extension.offset) {
|
38
|
+
babylonTexture.uOffset = extension.offset[0];
|
39
|
+
babylonTexture.vOffset = extension.offset[1];
|
40
|
+
}
|
41
|
+
// Always rotate around the origin.
|
42
|
+
babylonTexture.uRotationCenter = 0;
|
43
|
+
babylonTexture.vRotationCenter = 0;
|
44
|
+
if (extension.rotation) {
|
45
|
+
babylonTexture.wAng = -extension.rotation;
|
46
|
+
}
|
47
|
+
if (extension.scale) {
|
48
|
+
babylonTexture.uScale = extension.scale[0];
|
49
|
+
babylonTexture.vScale = extension.scale[1];
|
50
|
+
}
|
51
|
+
if (extension.texCoord != undefined) {
|
52
|
+
babylonTexture.coordinatesIndex = extension.texCoord;
|
53
|
+
}
|
54
|
+
assign(babylonTexture);
|
55
|
+
});
|
56
|
+
});
|
57
|
+
};
|
58
|
+
return KHR_texture_transform;
|
59
|
+
}());
|
60
|
+
export { KHR_texture_transform };
|
61
|
+
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_texture_transform(loader); });
|
62
62
|
//# sourceMappingURL=KHR_texture_transform.js.map
|