|
@@ -10897,6 +10897,16 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ Object.defineProperty(Engine, "TEXTUREFORMAT_RGBA32F", {
|
|
|
+ /**
|
|
|
+ * RGBA32F
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ return Engine._TEXTUREFORMAT_RGBA32F;
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
Object.defineProperty(Engine, "TEXTUREFORMAT_LUMINANCE_ALPHA", {
|
|
|
get: function () {
|
|
|
return Engine._TEXTUREFORMAT_LUMINANCE_ALPHA;
|
|
@@ -10962,7 +10972,7 @@ var BABYLON;
|
|
|
});
|
|
|
Object.defineProperty(Engine, "Version", {
|
|
|
get: function () {
|
|
|
- return "3.2.0-alpha7";
|
|
|
+ return "3.2.0-alpha8";
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -12994,6 +13004,7 @@ var BABYLON;
|
|
|
internalFormat = this._gl.RGB;
|
|
|
break;
|
|
|
case Engine.TEXTUREFORMAT_RGBA:
|
|
|
+ case Engine.TEXTUREFORMAT_RGBA32F:
|
|
|
internalFormat = this._gl.RGBA;
|
|
|
break;
|
|
|
case Engine.TEXTUREFORMAT_R32F:
|
|
@@ -15060,6 +15071,7 @@ var BABYLON;
|
|
|
Engine._TEXTUREFORMAT_R32F = 6;
|
|
|
Engine._TEXTUREFORMAT_RG32F = 7;
|
|
|
Engine._TEXTUREFORMAT_RGB32F = 8;
|
|
|
+ Engine._TEXTUREFORMAT_RGBA32F = 9;
|
|
|
Engine._TEXTURETYPE_UNSIGNED_INT = 0;
|
|
|
Engine._TEXTURETYPE_FLOAT = 1;
|
|
|
Engine._TEXTURETYPE_HALF_FLOAT = 2;
|
|
@@ -25724,10 +25736,6 @@ var BABYLON;
|
|
|
*/
|
|
|
VertexBuffer.DeduceStride = function (kind) {
|
|
|
switch (kind) {
|
|
|
- case VertexBuffer.PositionKind:
|
|
|
- return 3;
|
|
|
- case VertexBuffer.NormalKind:
|
|
|
- return 3;
|
|
|
case VertexBuffer.UVKind:
|
|
|
case VertexBuffer.UV2Kind:
|
|
|
case VertexBuffer.UV3Kind:
|
|
@@ -25735,14 +25743,15 @@ var BABYLON;
|
|
|
case VertexBuffer.UV5Kind:
|
|
|
case VertexBuffer.UV6Kind:
|
|
|
return 2;
|
|
|
- case VertexBuffer.TangentKind:
|
|
|
+ case VertexBuffer.NormalKind:
|
|
|
+ case VertexBuffer.PositionKind:
|
|
|
+ return 3;
|
|
|
case VertexBuffer.ColorKind:
|
|
|
- return 4;
|
|
|
case VertexBuffer.MatricesIndicesKind:
|
|
|
case VertexBuffer.MatricesIndicesExtraKind:
|
|
|
- return 4;
|
|
|
case VertexBuffer.MatricesWeightsKind:
|
|
|
case VertexBuffer.MatricesWeightsExtraKind:
|
|
|
+ case VertexBuffer.TangentKind:
|
|
|
return 4;
|
|
|
default:
|
|
|
throw new Error("Invalid kind '" + kind + "'");
|
|
@@ -27672,7 +27681,7 @@ var BABYLON;
|
|
|
weight = matricesWeightsData[matWeightIdx + inf];
|
|
|
if (weight <= 0)
|
|
|
break;
|
|
|
- BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[matWeightIdx + inf] * 16, weight, tempMatrix);
|
|
|
+ BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesData[matWeightIdx + inf] * 16), weight, tempMatrix);
|
|
|
finalMatrix.addToSelf(tempMatrix);
|
|
|
}
|
|
|
if (needExtras) {
|
|
@@ -27680,7 +27689,7 @@ var BABYLON;
|
|
|
weight = matricesWeightsExtraData[matWeightIdx + inf];
|
|
|
if (weight <= 0)
|
|
|
break;
|
|
|
- BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesExtraData[matWeightIdx + inf] * 16, weight, tempMatrix);
|
|
|
+ BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesExtraData[matWeightIdx + inf] * 16), weight, tempMatrix);
|
|
|
finalMatrix.addToSelf(tempMatrix);
|
|
|
}
|
|
|
}
|
|
@@ -29821,7 +29830,7 @@ var BABYLON;
|
|
|
for (inf = 0; inf < 4; inf++) {
|
|
|
weight = matricesWeightsData[matWeightIdx + inf];
|
|
|
if (weight > 0) {
|
|
|
- BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesData[matWeightIdx + inf] * 16, weight, tempMatrix);
|
|
|
+ BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesData[matWeightIdx + inf] * 16), weight, tempMatrix);
|
|
|
finalMatrix.addToSelf(tempMatrix);
|
|
|
}
|
|
|
else
|
|
@@ -29831,7 +29840,7 @@ var BABYLON;
|
|
|
for (inf = 0; inf < 4; inf++) {
|
|
|
weight = matricesWeightsExtraData[matWeightIdx + inf];
|
|
|
if (weight > 0) {
|
|
|
- BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, matricesIndicesExtraData[matWeightIdx + inf] * 16, weight, tempMatrix);
|
|
|
+ BABYLON.Matrix.FromFloat32ArrayToRefScaled(skeletonMatrices, Math.floor(matricesIndicesExtraData[matWeightIdx + inf] * 16), weight, tempMatrix);
|
|
|
finalMatrix.addToSelf(tempMatrix);
|
|
|
}
|
|
|
else
|
|
@@ -51347,8 +51356,6 @@ var BABYLON;
|
|
|
* It emits the particles randomly between 2 given directions.
|
|
|
*/
|
|
|
var BoxParticleEmitter = /** @class */ (function () {
|
|
|
- // to be updated like the rest of emitters when breaking changes.
|
|
|
- // all property should be come public variables and passed through constructor.
|
|
|
/**
|
|
|
* Creates a new instance of @see BoxParticleEmitter
|
|
|
*/
|
|
@@ -51409,6 +51416,17 @@ var BABYLON;
|
|
|
* @param effect defines the update shader
|
|
|
*/
|
|
|
BoxParticleEmitter.prototype.applyToShader = function (effect) {
|
|
|
+ effect.setVector3("direction1", this.direction1);
|
|
|
+ effect.setVector3("direction2", this.direction2);
|
|
|
+ effect.setVector3("minEmitBox", this.minEmitBox);
|
|
|
+ effect.setVector3("maxEmitBox", this.maxEmitBox);
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Returns a string to use to update the GPU particles update shader
|
|
|
+ * @returns a string containng the defines string
|
|
|
+ */
|
|
|
+ BoxParticleEmitter.prototype.getEffectDefines = function () {
|
|
|
+ return "#define BOXEMITTER";
|
|
|
};
|
|
|
return BoxParticleEmitter;
|
|
|
}());
|
|
@@ -51506,7 +51524,7 @@ var BABYLON;
|
|
|
radius = radius * h / this._height;
|
|
|
var randX = radius * Math.sin(s);
|
|
|
var randZ = radius * Math.cos(s);
|
|
|
- var randY = h;
|
|
|
+ var randY = h * this._height;
|
|
|
BABYLON.Vector3.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate);
|
|
|
};
|
|
|
/**
|
|
@@ -51523,6 +51541,17 @@ var BABYLON;
|
|
|
* @param effect defines the update shader
|
|
|
*/
|
|
|
ConeParticleEmitter.prototype.applyToShader = function (effect) {
|
|
|
+ effect.setFloat("radius", this.radius);
|
|
|
+ effect.setFloat("angle", this.angle);
|
|
|
+ effect.setFloat("height", this._height);
|
|
|
+ effect.setFloat("directionRandomizer", this.directionRandomizer);
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Returns a string to use to update the GPU particles update shader
|
|
|
+ * @returns a string containng the defines string
|
|
|
+ */
|
|
|
+ ConeParticleEmitter.prototype.getEffectDefines = function () {
|
|
|
+ return "#define CONEEMITTER";
|
|
|
};
|
|
|
return ConeParticleEmitter;
|
|
|
}());
|
|
@@ -51603,6 +51632,15 @@ var BABYLON;
|
|
|
* @param effect defines the update shader
|
|
|
*/
|
|
|
SphereParticleEmitter.prototype.applyToShader = function (effect) {
|
|
|
+ effect.setFloat("radius", this.radius);
|
|
|
+ effect.setFloat("directionRandomizer", this.directionRandomizer);
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Returns a string to use to update the GPU particles update shader
|
|
|
+ * @returns a string containng the defines string
|
|
|
+ */
|
|
|
+ SphereParticleEmitter.prototype.getEffectDefines = function () {
|
|
|
+ return "#define SPHEREEMITTER";
|
|
|
};
|
|
|
return SphereParticleEmitter;
|
|
|
}());
|
|
@@ -51660,6 +51698,16 @@ var BABYLON;
|
|
|
* @param effect defines the update shader
|
|
|
*/
|
|
|
SphereDirectedParticleEmitter.prototype.applyToShader = function (effect) {
|
|
|
+ effect.setFloat("radius", this.radius);
|
|
|
+ effect.setVector3("direction1", this.direction1);
|
|
|
+ effect.setVector3("direction2", this.direction2);
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Returns a string to use to update the GPU particles update shader
|
|
|
+ * @returns a string containng the defines string
|
|
|
+ */
|
|
|
+ SphereDirectedParticleEmitter.prototype.getEffectDefines = function () {
|
|
|
+ return "#define SPHEREEMITTER\n#define DIRECTEDSPHEREEMITTER";
|
|
|
};
|
|
|
return SphereDirectedParticleEmitter;
|
|
|
}(SphereParticleEmitter));
|
|
@@ -55526,6 +55574,110 @@ var BABYLON;
|
|
|
|
|
|
//# sourceMappingURL=babylon.meshBuilder.js.map
|
|
|
|
|
|
+/// <reference path="../../../dist/preview release/babylon.d.ts" />
|
|
|
+var BABYLON;
|
|
|
+(function (BABYLON) {
|
|
|
+ /**
|
|
|
+ * Draco compression (https://google.github.io/draco/)
|
|
|
+ */
|
|
|
+ var DracoCompression = /** @class */ (function () {
|
|
|
+ function DracoCompression() {
|
|
|
+ }
|
|
|
+ Object.defineProperty(DracoCompression, "IsSupported", {
|
|
|
+ /**
|
|
|
+ * Returns whether Draco compression is supported.
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ return !!window.DracoDecoderModule;
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
+ /**
|
|
|
+ * Decodes Draco compressed data to vertex data.
|
|
|
+ * @param data The array buffer view for the Draco compression data
|
|
|
+ * @param attributes A map of attributes from vertex buffer kinds to Draco unique ids
|
|
|
+ * @returns The decoded vertex data
|
|
|
+ */
|
|
|
+ DracoCompression.Decode = function (data, attributes) {
|
|
|
+ var dracoModule = new DracoDecoderModule();
|
|
|
+ var buffer = new dracoModule.DecoderBuffer();
|
|
|
+ buffer.Init(data, data.byteLength);
|
|
|
+ var decoder = new dracoModule.Decoder();
|
|
|
+ var geometry;
|
|
|
+ var status;
|
|
|
+ var vertexData = new BABYLON.VertexData();
|
|
|
+ try {
|
|
|
+ var type = decoder.GetEncodedGeometryType(buffer);
|
|
|
+ switch (type) {
|
|
|
+ case dracoModule.TRIANGULAR_MESH:
|
|
|
+ geometry = new dracoModule.Mesh();
|
|
|
+ status = decoder.DecodeBufferToMesh(buffer, geometry);
|
|
|
+ break;
|
|
|
+ case dracoModule.POINT_CLOUD:
|
|
|
+ geometry = new dracoModule.PointCloud();
|
|
|
+ status = decoder.DecodeBufferToPointCloud(buffer, geometry);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ throw new Error("Invalid geometry type " + type);
|
|
|
+ }
|
|
|
+ if (!status.ok() || !geometry.ptr) {
|
|
|
+ throw new Error(status.error_msg());
|
|
|
+ }
|
|
|
+ var numPoints = geometry.num_points();
|
|
|
+ if (type === dracoModule.TRIANGULAR_MESH) {
|
|
|
+ var numFaces = geometry.num_faces();
|
|
|
+ var faceIndices = new dracoModule.DracoInt32Array();
|
|
|
+ try {
|
|
|
+ vertexData.indices = new Uint32Array(numFaces * 3);
|
|
|
+ for (var i = 0; i < numFaces; i++) {
|
|
|
+ decoder.GetFaceFromMesh(geometry, i, faceIndices);
|
|
|
+ var offset = i * 3;
|
|
|
+ vertexData.indices[offset + 0] = faceIndices.GetValue(0);
|
|
|
+ vertexData.indices[offset + 1] = faceIndices.GetValue(1);
|
|
|
+ vertexData.indices[offset + 2] = faceIndices.GetValue(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ finally {
|
|
|
+ dracoModule.destroy(faceIndices);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (var kind in attributes) {
|
|
|
+ var uniqueId = attributes[kind];
|
|
|
+ var attribute = decoder.GetAttributeByUniqueId(geometry, uniqueId);
|
|
|
+ var dracoData = new dracoModule.DracoFloat32Array();
|
|
|
+ try {
|
|
|
+ if (attribute.num_components() !== BABYLON.VertexBuffer.DeduceStride(kind)) {
|
|
|
+ throw new Error("Unsupported number of components for " + kind);
|
|
|
+ }
|
|
|
+ decoder.GetAttributeFloatForAllPoints(geometry, attribute, dracoData);
|
|
|
+ var babylonData = new Float32Array(numPoints * attribute.num_components());
|
|
|
+ for (var i = 0; i < babylonData.length; i++) {
|
|
|
+ babylonData[i] = dracoData.GetValue(i);
|
|
|
+ }
|
|
|
+ vertexData.set(babylonData, kind);
|
|
|
+ }
|
|
|
+ finally {
|
|
|
+ dracoModule.destroy(dracoData);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ finally {
|
|
|
+ if (geometry) {
|
|
|
+ dracoModule.destroy(geometry);
|
|
|
+ }
|
|
|
+ dracoModule.destroy(decoder);
|
|
|
+ dracoModule.destroy(buffer);
|
|
|
+ }
|
|
|
+ return vertexData;
|
|
|
+ };
|
|
|
+ return DracoCompression;
|
|
|
+ }());
|
|
|
+ BABYLON.DracoCompression = DracoCompression;
|
|
|
+})(BABYLON || (BABYLON = {}));
|
|
|
+
|
|
|
+//# sourceMappingURL=babylon.dracoCompression.js.map
|
|
|
+
|
|
|
var BABYLON;
|
|
|
(function (BABYLON) {
|
|
|
var AudioEngine = /** @class */ (function () {
|
|
@@ -80251,7 +80403,6 @@ var BABYLON;
|
|
|
imageProcessingConfiguration.vignetteEnabled = true;
|
|
|
this._postProcessMove = new BABYLON.ImageProcessingPostProcess("postProcessMove", 1.0, this._webVRCamera, undefined, undefined, undefined, undefined, imageProcessingConfiguration);
|
|
|
this._webVRCamera.detachPostProcess(this._postProcessMove);
|
|
|
- this._passProcessMove = new BABYLON.PassPostProcess("pass", 1.0, this._webVRCamera);
|
|
|
this._teleportationInitialized = true;
|
|
|
if (this._isDefaultTeleportationTarget) {
|
|
|
this._createTeleportationCircles();
|
|
@@ -80620,6 +80771,7 @@ var BABYLON;
|
|
|
this._postProcessMove.animations.push(animationPP2);
|
|
|
this._postProcessMove.imageProcessingConfiguration.vignetteWeight = 0;
|
|
|
this._postProcessMove.imageProcessingConfiguration.vignetteStretch = 0;
|
|
|
+ this._postProcessMove.samples = 4;
|
|
|
this._webVRCamera.attachPostProcess(this._postProcessMove);
|
|
|
this._scene.beginAnimation(this._postProcessMove, 0, 6, false, 1, function () {
|
|
|
_this._webVRCamera.detachPostProcess(_this._postProcessMove);
|
|
@@ -80889,9 +81041,6 @@ var BABYLON;
|
|
|
if (this.isInVRMode) {
|
|
|
this.exitVR();
|
|
|
}
|
|
|
- if (this._passProcessMove) {
|
|
|
- this._passProcessMove.dispose();
|
|
|
- }
|
|
|
if (this._postProcessMove) {
|
|
|
this._postProcessMove.dispose();
|
|
|
}
|
|
@@ -92126,11 +92275,15 @@ var BABYLON;
|
|
|
};
|
|
|
GLTFLoader.prototype._loadVertexDataAsync = function (context, primitive, babylonMesh) {
|
|
|
var _this = this;
|
|
|
+ var promise = GLTF2.GLTFLoaderExtension._LoadVertexDataAsync(this, context, primitive, babylonMesh);
|
|
|
+ if (promise) {
|
|
|
+ return promise;
|
|
|
+ }
|
|
|
var attributes = primitive.attributes;
|
|
|
if (!attributes) {
|
|
|
throw new Error(context + ": Attributes are missing");
|
|
|
}
|
|
|
- if (primitive.mode && primitive.mode !== 4 /* TRIANGLES */) {
|
|
|
+ if (primitive.mode != undefined && primitive.mode !== 4 /* TRIANGLES */) {
|
|
|
// TODO: handle other primitive modes
|
|
|
throw new Error(context + ": Mode " + primitive.mode + " is not currently supported");
|
|
|
}
|
|
@@ -93114,6 +93267,8 @@ var BABYLON;
|
|
|
GLTFLoaderExtension.prototype._loadSceneAsync = function (context, node) { return null; };
|
|
|
/** Override this method to modify the default behavior for loading nodes. */
|
|
|
GLTFLoaderExtension.prototype._loadNodeAsync = function (context, node) { return null; };
|
|
|
+ /** Override this method to modify the default behavior for loading mesh primitive vertex data. */
|
|
|
+ GLTFLoaderExtension.prototype._loadVertexDataAsync = function (context, primitive, babylonMesh) { return null; };
|
|
|
/** Override this method to modify the default behavior for loading materials. */
|
|
|
GLTFLoaderExtension.prototype._loadMaterialAsync = function (context, material, babylonMesh) { return null; };
|
|
|
/** Override this method to modify the default behavior for loading uris. */
|
|
@@ -93121,7 +93276,6 @@ var BABYLON;
|
|
|
// #endregion
|
|
|
/** Helper method called by a loader extension to load an glTF extension. */
|
|
|
GLTFLoaderExtension.prototype._loadExtensionAsync = function (context, property, actionAsync) {
|
|
|
- var _this = this;
|
|
|
if (!property.extensions) {
|
|
|
return null;
|
|
|
}
|
|
@@ -93132,10 +93286,13 @@ var BABYLON;
|
|
|
}
|
|
|
// Clear out the extension before executing the action to avoid recursing into the same property.
|
|
|
delete extensions[this.name];
|
|
|
- return actionAsync(context + "/extensions/" + this.name, extension).then(function () {
|
|
|
- // Restore the extension after completing the action.
|
|
|
- extensions[_this.name] = extension;
|
|
|
- });
|
|
|
+ try {
|
|
|
+ return actionAsync(context + "/extensions/" + this.name, extension);
|
|
|
+ }
|
|
|
+ finally {
|
|
|
+ // Restore the extension after executing the action.
|
|
|
+ extensions[this.name] = extension;
|
|
|
+ }
|
|
|
};
|
|
|
/** Helper method called by the loader to allow extensions to override loading scenes. */
|
|
|
GLTFLoaderExtension._LoadSceneAsync = function (loader, context, scene) {
|
|
@@ -93145,6 +93302,10 @@ var BABYLON;
|
|
|
GLTFLoaderExtension._LoadNodeAsync = function (loader, context, node) {
|
|
|
return loader._applyExtensions(function (extension) { return extension._loadNodeAsync(context, node); });
|
|
|
};
|
|
|
+ /** Helper method called by the loader to allow extensions to override loading mesh primitive vertex data. */
|
|
|
+ GLTFLoaderExtension._LoadVertexDataAsync = function (loader, context, primitive, babylonMesh) {
|
|
|
+ return loader._applyExtensions(function (extension) { return extension._loadVertexDataAsync(context, primitive, babylonMesh); });
|
|
|
+ };
|
|
|
/** Helper method called by the loader to allow extensions to override loading materials. */
|
|
|
GLTFLoaderExtension._LoadMaterialAsync = function (loader, context, material, babylonMesh) {
|
|
|
return loader._applyExtensions(function (extension) { return extension._loadMaterialAsync(context, material, babylonMesh); });
|
|
@@ -93310,6 +93471,79 @@ var BABYLON;
|
|
|
(function (GLTF2) {
|
|
|
var Extensions;
|
|
|
(function (Extensions) {
|
|
|
+ // https://github.com/KhronosGroup/glTF/pull/874
|
|
|
+ var NAME = "KHR_draco_mesh_compression";
|
|
|
+ var KHR_draco_mesh_compression = /** @class */ (function (_super) {
|
|
|
+ __extends(KHR_draco_mesh_compression, _super);
|
|
|
+ function KHR_draco_mesh_compression() {
|
|
|
+ var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
|
+ _this.name = NAME;
|
|
|
+ return _this;
|
|
|
+ }
|
|
|
+ KHR_draco_mesh_compression.prototype._loadVertexDataAsync = function (context, primitive, babylonMesh) {
|
|
|
+ var _this = this;
|
|
|
+ return this._loadExtensionAsync(context, primitive, function (extensionContext, extension) {
|
|
|
+ if (primitive.mode != undefined) {
|
|
|
+ if (primitive.mode !== 5 /* TRIANGLE_STRIP */ &&
|
|
|
+ primitive.mode !== 4 /* TRIANGLES */) {
|
|
|
+ throw new Error(context + ": Unsupported mode " + primitive.mode);
|
|
|
+ }
|
|
|
+ // TODO: handle triangle strips
|
|
|
+ if (primitive.mode === 5 /* TRIANGLE_STRIP */) {
|
|
|
+ throw new Error(context + ": Mode " + primitive.mode + " is not currently supported");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ var attributes = {};
|
|
|
+ var loadAttribute = function (name, kind) {
|
|
|
+ var uniqueId = extension.attributes[name];
|
|
|
+ if (uniqueId == undefined) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ babylonMesh._delayInfo = babylonMesh._delayInfo || [];
|
|
|
+ if (babylonMesh._delayInfo.indexOf(kind) === -1) {
|
|
|
+ babylonMesh._delayInfo.push(kind);
|
|
|
+ }
|
|
|
+ attributes[kind] = uniqueId;
|
|
|
+ };
|
|
|
+ loadAttribute("POSITION", BABYLON.VertexBuffer.PositionKind);
|
|
|
+ loadAttribute("NORMAL", BABYLON.VertexBuffer.NormalKind);
|
|
|
+ loadAttribute("TANGENT", BABYLON.VertexBuffer.TangentKind);
|
|
|
+ loadAttribute("TEXCOORD_0", BABYLON.VertexBuffer.UVKind);
|
|
|
+ loadAttribute("TEXCOORD_1", BABYLON.VertexBuffer.UV2Kind);
|
|
|
+ loadAttribute("JOINTS_0", BABYLON.VertexBuffer.MatricesIndicesKind);
|
|
|
+ loadAttribute("WEIGHTS_0", BABYLON.VertexBuffer.MatricesWeightsKind);
|
|
|
+ loadAttribute("COLOR_0", BABYLON.VertexBuffer.ColorKind);
|
|
|
+ var bufferView = GLTF2.GLTFLoader._GetProperty(extensionContext, _this._loader._gltf.bufferViews, extension.bufferView);
|
|
|
+ return _this._loader._loadBufferViewAsync("#/bufferViews/" + bufferView._index, bufferView).then(function (data) {
|
|
|
+ try {
|
|
|
+ return BABYLON.DracoCompression.Decode(data, attributes);
|
|
|
+ }
|
|
|
+ catch (e) {
|
|
|
+ throw new Error(context + ": " + e.message);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ };
|
|
|
+ return KHR_draco_mesh_compression;
|
|
|
+ }(GLTF2.GLTFLoaderExtension));
|
|
|
+ Extensions.KHR_draco_mesh_compression = KHR_draco_mesh_compression;
|
|
|
+ if (BABYLON.DracoCompression.IsSupported) {
|
|
|
+ GLTF2.GLTFLoader._Register(NAME, function (loader) { return new KHR_draco_mesh_compression(loader); });
|
|
|
+ }
|
|
|
+ })(Extensions = GLTF2.Extensions || (GLTF2.Extensions = {}));
|
|
|
+ })(GLTF2 = BABYLON.GLTF2 || (BABYLON.GLTF2 = {}));
|
|
|
+})(BABYLON || (BABYLON = {}));
|
|
|
+
|
|
|
+//# sourceMappingURL=KHR_draco_mesh_compression.js.map
|
|
|
+
|
|
|
+/// <reference path="../../../../../dist/preview release/babylon.d.ts"/>
|
|
|
+
|
|
|
+var BABYLON;
|
|
|
+(function (BABYLON) {
|
|
|
+ var GLTF2;
|
|
|
+ (function (GLTF2) {
|
|
|
+ var Extensions;
|
|
|
+ (function (Extensions) {
|
|
|
// https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness
|
|
|
var NAME = "KHR_materials_pbrSpecularGlossiness";
|
|
|
var KHR_materials_pbrSpecularGlossiness = /** @class */ (function (_super) {
|