@babylonjs/loaders 5.0.0-alpha.55 → 5.0.0-alpha.59
Sign up to get free protection for your applications and to get access to all the features.
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts +30 -0
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js +46 -0
- package/glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map +1 -0
- package/glTF/2.0/Extensions/index.d.ts +1 -0
- package/glTF/2.0/Extensions/index.js +1 -0
- package/glTF/2.0/Extensions/index.js.map +1 -1
- package/package.json +6 -3
@@ -0,0 +1,30 @@
|
|
1
|
+
import { Nullable } from "@babylonjs/core/types";
|
2
|
+
import { Material } from "@babylonjs/core/Materials/material";
|
3
|
+
import { IMaterial } from "../glTFLoaderInterfaces";
|
4
|
+
import { IGLTFLoaderExtension } from "../glTFLoaderExtension";
|
5
|
+
import { GLTFLoader } from "../glTFLoader";
|
6
|
+
/**
|
7
|
+
* [Experimental Spec](https://github.com/KhronosGroup/glTF/pull/1994)
|
8
|
+
*/
|
9
|
+
export declare class KHR_materials_emissive_strength implements IGLTFLoaderExtension {
|
10
|
+
/**
|
11
|
+
* The name of this extension.
|
12
|
+
*/
|
13
|
+
readonly name = "KHR_materials_emissive_strength";
|
14
|
+
/**
|
15
|
+
* Defines whether this extension is enabled.
|
16
|
+
*/
|
17
|
+
enabled: boolean;
|
18
|
+
/**
|
19
|
+
* Defines a number that determines the order the extensions are applied.
|
20
|
+
*/
|
21
|
+
order: number;
|
22
|
+
private _loader;
|
23
|
+
/** @hidden */
|
24
|
+
constructor(loader: GLTFLoader);
|
25
|
+
/** @hidden */
|
26
|
+
dispose(): void;
|
27
|
+
/** @hidden */
|
28
|
+
loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>>;
|
29
|
+
private _loadEmissiveProperties;
|
30
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
import { PBRMaterial } from "@babylonjs/core/Materials/PBR/pbrMaterial.js";
|
2
|
+
import { GLTFLoader } from "../glTFLoader.js";
|
3
|
+
var NAME = "KHR_materials_emissive_strength";
|
4
|
+
/**
|
5
|
+
* [Experimental Spec](https://github.com/KhronosGroup/glTF/pull/1994)
|
6
|
+
*/
|
7
|
+
var KHR_materials_emissive_strength = /** @class */ (function () {
|
8
|
+
/** @hidden */
|
9
|
+
function KHR_materials_emissive_strength(loader) {
|
10
|
+
/**
|
11
|
+
* The name of this extension.
|
12
|
+
*/
|
13
|
+
this.name = NAME;
|
14
|
+
/**
|
15
|
+
* Defines a number that determines the order the extensions are applied.
|
16
|
+
*/
|
17
|
+
this.order = 170;
|
18
|
+
this._loader = loader;
|
19
|
+
this.enabled = this._loader.isExtensionUsed(NAME);
|
20
|
+
}
|
21
|
+
/** @hidden */
|
22
|
+
KHR_materials_emissive_strength.prototype.dispose = function () {
|
23
|
+
this._loader = null;
|
24
|
+
};
|
25
|
+
/** @hidden */
|
26
|
+
KHR_materials_emissive_strength.prototype.loadMaterialPropertiesAsync = function (context, material, babylonMaterial) {
|
27
|
+
var _this = this;
|
28
|
+
return GLTFLoader.LoadExtensionAsync(context, material, this.name, function (extensionContext, extension) {
|
29
|
+
return _this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial).then(function () {
|
30
|
+
_this._loadEmissiveProperties(extensionContext, extension, babylonMaterial);
|
31
|
+
});
|
32
|
+
});
|
33
|
+
};
|
34
|
+
KHR_materials_emissive_strength.prototype._loadEmissiveProperties = function (context, properties, babylonMaterial) {
|
35
|
+
if (!(babylonMaterial instanceof PBRMaterial)) {
|
36
|
+
throw new Error(context + ": Material type not supported");
|
37
|
+
}
|
38
|
+
if (properties.emissiveStrength !== undefined) {
|
39
|
+
babylonMaterial.emissiveColor.scaleToRef(properties.emissiveStrength, babylonMaterial.emissiveColor);
|
40
|
+
}
|
41
|
+
};
|
42
|
+
return KHR_materials_emissive_strength;
|
43
|
+
}());
|
44
|
+
export { KHR_materials_emissive_strength };
|
45
|
+
GLTFLoader.RegisterExtension(NAME, function (loader) { return new KHR_materials_emissive_strength(loader); });
|
46
|
+
//# sourceMappingURL=KHR_materials_emissive_strength.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"KHR_materials_emissive_strength.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/KHR_materials_emissive_strength.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,2CAA2C,CAAC;AAKxE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,IAAM,IAAI,GAAG,iCAAiC,CAAC;AAE/C;;GAEG;AACH;IAkBI,cAAc;IACd,yCAAY,MAAkB;QAlB9B;;WAEG;QACa,SAAI,GAAG,IAAI,CAAC;QAO5B;;WAEG;QACI,UAAK,GAAG,GAAG,CAAC;QAMf,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC;IAED,cAAc;IACP,iDAAO,GAAd;QACK,IAAI,CAAC,OAAe,GAAG,IAAI,CAAC;IACjC,CAAC;IAED,cAAc;IACP,qEAA2B,GAAlC,UAAmC,OAAe,EAAE,QAAmB,EAAE,eAAyB;QAAlG,iBAMC;QALG,OAAO,UAAU,CAAC,kBAAkB,CAAgC,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,UAAC,gBAAgB,EAAE,SAAS;YAC1H,OAAO,KAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC,OAAO,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC;gBACrF,KAAI,CAAC,uBAAuB,CAAC,gBAAgB,EAAE,SAAS,EAAE,eAAe,CAAC,CAAC;YAC/E,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,iEAAuB,GAA/B,UAAgC,OAAe,EAAE,UAAyC,EAAE,eAAyB;QACjH,IAAI,CAAC,CAAC,eAAe,YAAY,WAAW,CAAC,EAAE;YAC3C,MAAM,IAAI,KAAK,CAAI,OAAO,kCAA+B,CAAC,CAAC;SAC9D;QAED,IAAI,UAAU,CAAC,gBAAgB,KAAK,SAAS,EAAE;YAC3C,eAAe,CAAC,aAAa,CAAC,UAAU,CAAC,UAAU,CAAC,gBAAgB,EAAE,eAAe,CAAC,aAAa,CAAC,CAAC;SACxG;IACL,CAAC;IACL,sCAAC;AAAD,CAAC,AA/CD,IA+CC;;AAED,UAAU,CAAC,iBAAiB,CAAC,IAAI,EAAE,UAAC,MAAM,IAAK,OAAA,IAAI,+BAA+B,CAAC,MAAM,CAAC,EAA3C,CAA2C,CAAC,CAAC","sourcesContent":["import { Nullable } from \"@babylonjs/core/types\";\nimport { PBRMaterial } from \"@babylonjs/core/Materials/PBR/pbrMaterial\";\nimport { Material } from \"@babylonjs/core/Materials/material\";\n\nimport { IMaterial } from \"../glTFLoaderInterfaces\";\nimport { IGLTFLoaderExtension } from \"../glTFLoaderExtension\";\nimport { GLTFLoader } from \"../glTFLoader\";\nimport { IKHRMaterialsEmissiveStrength } from 'babylonjs-gltf2interface';\n\nconst NAME = \"KHR_materials_emissive_strength\";\n\n/**\n * [Experimental Spec](https://github.com/KhronosGroup/glTF/pull/1994)\n */\nexport class KHR_materials_emissive_strength implements IGLTFLoaderExtension {\n /**\n * The name of this extension.\n */\n public readonly name = NAME;\n\n /**\n * Defines whether this extension is enabled.\n */\n public enabled: boolean;\n\n /**\n * Defines a number that determines the order the extensions are applied.\n */\n public order = 170;\n\n private _loader: GLTFLoader;\n\n /** @hidden */\n constructor(loader: GLTFLoader) {\n this._loader = loader;\n this.enabled = this._loader.isExtensionUsed(NAME);\n }\n\n /** @hidden */\n public dispose() {\n (this._loader as any) = null;\n }\n\n /** @hidden */\n public loadMaterialPropertiesAsync(context: string, material: IMaterial, babylonMaterial: Material): Nullable<Promise<void>> {\n return GLTFLoader.LoadExtensionAsync<IKHRMaterialsEmissiveStrength>(context, material, this.name, (extensionContext, extension) => {\n return this._loader.loadMaterialPropertiesAsync(context, material, babylonMaterial).then(() => {\n this._loadEmissiveProperties(extensionContext, extension, babylonMaterial);\n });\n });\n }\n\n private _loadEmissiveProperties(context: string, properties: IKHRMaterialsEmissiveStrength, babylonMaterial: Material): void {\n if (!(babylonMaterial instanceof PBRMaterial)) {\n throw new Error(`${context}: Material type not supported`);\n }\n\n if (properties.emissiveStrength !== undefined) {\n babylonMaterial.emissiveColor.scaleToRef(properties.emissiveStrength, babylonMaterial.emissiveColor);\n }\n }\n}\n\nGLTFLoader.RegisterExtension(NAME, (loader) => new KHR_materials_emissive_strength(loader));"]}
|
@@ -7,6 +7,7 @@ export * from "./KHR_lights_punctual";
|
|
7
7
|
export * from "./KHR_materials_pbrSpecularGlossiness";
|
8
8
|
export * from "./KHR_materials_unlit";
|
9
9
|
export * from "./KHR_materials_clearcoat";
|
10
|
+
export * from "./KHR_materials_emissive_strength";
|
10
11
|
export * from "./KHR_materials_sheen";
|
11
12
|
export * from "./KHR_materials_specular";
|
12
13
|
export * from "./KHR_materials_ior";
|
@@ -7,6 +7,7 @@ export * from "./KHR_lights_punctual.js";
|
|
7
7
|
export * from "./KHR_materials_pbrSpecularGlossiness.js";
|
8
8
|
export * from "./KHR_materials_unlit.js";
|
9
9
|
export * from "./KHR_materials_clearcoat.js";
|
10
|
+
export * from "./KHR_materials_emissive_strength.js";
|
10
11
|
export * from "./KHR_materials_sheen.js";
|
11
12
|
export * from "./KHR_materials_specular.js";
|
12
13
|
export * from "./KHR_materials_ior.js";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uCAAuC,CAAC;AACtD,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./EXT_lights_image_based\";\r\nexport * from \"./EXT_mesh_gpu_instancing\";\r\nexport * from \"./EXT_meshopt_compression\";\r\nexport * from \"./EXT_texture_webp\";\r\nexport * from \"./KHR_draco_mesh_compression\";\r\nexport * from \"./KHR_lights_punctual\";\r\nexport * from \"./KHR_materials_pbrSpecularGlossiness\";\r\nexport * from \"./KHR_materials_unlit\";\r\nexport * from \"./KHR_materials_clearcoat\";\r\nexport * from \"./KHR_materials_sheen\";\r\nexport * from \"./KHR_materials_specular\";\r\nexport * from \"./KHR_materials_ior\";\r\nexport * from \"./KHR_materials_variants\";\r\nexport * from \"./KHR_materials_transmission\";\r\nexport * from \"./KHR_materials_translucency\";\r\nexport * from \"./KHR_materials_volume\";\r\nexport * from \"./KHR_mesh_quantization\";\r\nexport * from \"./KHR_texture_basisu\";\r\nexport * from \"./KHR_texture_transform\";\r\nexport * from \"./KHR_xmp_json_ld\";\r\nexport * from \"./MSFT_audio_emitter\";\r\nexport * from \"./MSFT_lod\";\r\nexport * from \"./MSFT_minecraftMesh\";\r\nexport * from \"./MSFT_sRGBFactors\";\r\nexport * from \"./ExtrasAsMetadata\";\r\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../sourceES6/loaders/src/glTF/2.0/Extensions/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uCAAuC,CAAC;AACtD,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC","sourcesContent":["export * from \"./EXT_lights_image_based\";\r\nexport * from \"./EXT_mesh_gpu_instancing\";\r\nexport * from \"./EXT_meshopt_compression\";\r\nexport * from \"./EXT_texture_webp\";\r\nexport * from \"./KHR_draco_mesh_compression\";\r\nexport * from \"./KHR_lights_punctual\";\r\nexport * from \"./KHR_materials_pbrSpecularGlossiness\";\r\nexport * from \"./KHR_materials_unlit\";\r\nexport * from \"./KHR_materials_clearcoat\";\r\nexport * from \"./KHR_materials_emissive_strength\";\r\nexport * from \"./KHR_materials_sheen\";\r\nexport * from \"./KHR_materials_specular\";\r\nexport * from \"./KHR_materials_ior\";\r\nexport * from \"./KHR_materials_variants\";\r\nexport * from \"./KHR_materials_transmission\";\r\nexport * from \"./KHR_materials_translucency\";\r\nexport * from \"./KHR_materials_volume\";\r\nexport * from \"./KHR_mesh_quantization\";\r\nexport * from \"./KHR_texture_basisu\";\r\nexport * from \"./KHR_texture_transform\";\r\nexport * from \"./KHR_xmp_json_ld\";\r\nexport * from \"./MSFT_audio_emitter\";\r\nexport * from \"./MSFT_lod\";\r\nexport * from \"./MSFT_minecraftMesh\";\r\nexport * from \"./MSFT_sRGBFactors\";\r\nexport * from \"./ExtrasAsMetadata\";\r\n"]}
|
package/package.json
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
},
|
5
5
|
"name": "@babylonjs/loaders",
|
6
6
|
"description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
|
7
|
-
"version": "5.0.0-alpha.
|
7
|
+
"version": "5.0.0-alpha.59",
|
8
8
|
"repository": {
|
9
9
|
"type": "git",
|
10
10
|
"url": "https://github.com/BabylonJS/Babylon.js.git"
|
@@ -56,6 +56,9 @@
|
|
56
56
|
"glTF/2.0/Extensions/KHR_materials_clearcoat.d.ts",
|
57
57
|
"glTF/2.0/Extensions/KHR_materials_clearcoat.js",
|
58
58
|
"glTF/2.0/Extensions/KHR_materials_clearcoat.js.map",
|
59
|
+
"glTF/2.0/Extensions/KHR_materials_emissive_strength.d.ts",
|
60
|
+
"glTF/2.0/Extensions/KHR_materials_emissive_strength.js",
|
61
|
+
"glTF/2.0/Extensions/KHR_materials_emissive_strength.js.map",
|
59
62
|
"glTF/2.0/Extensions/KHR_materials_ior.d.ts",
|
60
63
|
"glTF/2.0/Extensions/KHR_materials_ior.js",
|
61
64
|
"glTF/2.0/Extensions/KHR_materials_ior.js.map",
|
@@ -191,8 +194,8 @@
|
|
191
194
|
],
|
192
195
|
"license": "Apache-2.0",
|
193
196
|
"dependencies": {
|
194
|
-
"babylonjs-gltf2interface": "5.0.0-alpha.
|
195
|
-
"@babylonjs/core": "5.0.0-alpha.
|
197
|
+
"babylonjs-gltf2interface": "5.0.0-alpha.59",
|
198
|
+
"@babylonjs/core": "5.0.0-alpha.59",
|
196
199
|
"tslib": "^2.3.1"
|
197
200
|
},
|
198
201
|
"engines": {
|