|
@@ -12060,42 +12060,22 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
- Object.defineProperty(Engine, "TEXTUREFORMAT_R32F", {
|
|
|
+ Object.defineProperty(Engine, "TEXTUREFORMAT_R", {
|
|
|
/**
|
|
|
- * R32F
|
|
|
+ * R
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return Engine._TEXTUREFORMAT_R32F;
|
|
|
+ return Engine._TEXTUREFORMAT_R;
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
- Object.defineProperty(Engine, "TEXTUREFORMAT_RG32F", {
|
|
|
+ Object.defineProperty(Engine, "TEXTUREFORMAT_RG", {
|
|
|
/**
|
|
|
- * RG32F
|
|
|
+ * RG
|
|
|
*/
|
|
|
get: function () {
|
|
|
- return Engine._TEXTUREFORMAT_RG32F;
|
|
|
- },
|
|
|
- enumerable: true,
|
|
|
- configurable: true
|
|
|
- });
|
|
|
- Object.defineProperty(Engine, "TEXTUREFORMAT_RGB32F", {
|
|
|
- /**
|
|
|
- * RGB32F
|
|
|
- */
|
|
|
- get: function () {
|
|
|
- return Engine._TEXTUREFORMAT_RGB32F;
|
|
|
- },
|
|
|
- enumerable: true,
|
|
|
- configurable: true
|
|
|
- });
|
|
|
- Object.defineProperty(Engine, "TEXTUREFORMAT_RGBA32F", {
|
|
|
- /**
|
|
|
- * RGBA32F
|
|
|
- */
|
|
|
- get: function () {
|
|
|
- return Engine._TEXTUREFORMAT_RGBA32F;
|
|
|
+ return Engine._TEXTUREFORMAT_RG;
|
|
|
},
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
@@ -16144,10 +16124,14 @@ var BABYLON;
|
|
|
* @param format defines the data format
|
|
|
* @param invertY defines if data must be stored with Y axis inverted
|
|
|
* @param compression defines the used compression (can be null)
|
|
|
+ * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
|
|
|
*/
|
|
|
- Engine.prototype.updateRawTexture3D = function (texture, data, format, invertY, compression) {
|
|
|
+ Engine.prototype.updateRawTexture3D = function (texture, data, format, invertY, compression, textureType) {
|
|
|
if (compression === void 0) { compression = null; }
|
|
|
+ if (textureType === void 0) { textureType = Engine.TEXTURETYPE_UNSIGNED_INT; }
|
|
|
+ var internalType = this._getWebGLTextureType(textureType);
|
|
|
var internalFormat = this._getInternalFormat(format);
|
|
|
+ var internalSizedFomat = this._getRGBABufferInternalSizedFormat(textureType, format);
|
|
|
this._bindTextureDirectly(this._gl.TEXTURE_3D, texture, true);
|
|
|
this._gl.pixelStorei(this._gl.UNPACK_FLIP_Y_WEBGL, invertY === undefined ? 1 : (invertY ? 1 : 0));
|
|
|
if (!this._doNotHandleContextLost) {
|
|
@@ -16163,7 +16147,7 @@ var BABYLON;
|
|
|
this._gl.compressedTexImage3D(this._gl.TEXTURE_3D, 0, this.getCaps().s3tc[compression], texture.width, texture.height, texture.depth, 0, data);
|
|
|
}
|
|
|
else {
|
|
|
- this._gl.texImage3D(this._gl.TEXTURE_3D, 0, internalFormat, texture.width, texture.height, texture.depth, 0, internalFormat, this._gl.UNSIGNED_BYTE, data);
|
|
|
+ this._gl.texImage3D(this._gl.TEXTURE_3D, 0, internalSizedFomat, texture.width, texture.height, texture.depth, 0, internalFormat, internalType, data);
|
|
|
}
|
|
|
if (texture.generateMipMaps) {
|
|
|
this._gl.generateMipmap(this._gl.TEXTURE_3D);
|
|
@@ -16183,10 +16167,12 @@ var BABYLON;
|
|
|
* @param invertY defines if data must be stored with Y axis inverted
|
|
|
* @param samplingMode defines the required sampling mode (like BABYLON.Texture.NEAREST_SAMPLINGMODE)
|
|
|
* @param compression defines the compressed used (can be null)
|
|
|
+ * @param textureType defines the compressed used (can be null)
|
|
|
* @returns a new raw 3D texture (stored in an InternalTexture)
|
|
|
*/
|
|
|
- Engine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression) {
|
|
|
+ Engine.prototype.createRawTexture3D = function (data, width, height, depth, format, generateMipMaps, invertY, samplingMode, compression, textureType) {
|
|
|
if (compression === void 0) { compression = null; }
|
|
|
+ if (textureType === void 0) { textureType = Engine.TEXTURETYPE_UNSIGNED_INT; }
|
|
|
var texture = new BABYLON.InternalTexture(this, BABYLON.InternalTexture.DATASOURCE_RAW3D);
|
|
|
texture.baseWidth = width;
|
|
|
texture.baseHeight = height;
|
|
@@ -16195,13 +16181,14 @@ var BABYLON;
|
|
|
texture.height = height;
|
|
|
texture.depth = depth;
|
|
|
texture.format = format;
|
|
|
+ texture.type = textureType;
|
|
|
texture.generateMipMaps = generateMipMaps;
|
|
|
texture.samplingMode = samplingMode;
|
|
|
texture.is3D = true;
|
|
|
if (!this._doNotHandleContextLost) {
|
|
|
texture._bufferView = data;
|
|
|
}
|
|
|
- this.updateRawTexture3D(texture, data, format, invertY, compression);
|
|
|
+ this.updateRawTexture3D(texture, data, format, invertY, compression, textureType);
|
|
|
this._bindTextureDirectly(this._gl.TEXTURE_3D, texture, true);
|
|
|
// Filters
|
|
|
var filters = getSamplingParameters(samplingMode, generateMipMaps, this._gl);
|
|
@@ -17152,17 +17139,15 @@ var BABYLON;
|
|
|
internalFormat = this._gl.LUMINANCE_ALPHA;
|
|
|
break;
|
|
|
case Engine.TEXTUREFORMAT_RGB:
|
|
|
- case Engine.TEXTUREFORMAT_RGB32F:
|
|
|
internalFormat = this._gl.RGB;
|
|
|
break;
|
|
|
case Engine.TEXTUREFORMAT_RGBA:
|
|
|
- case Engine.TEXTUREFORMAT_RGBA32F:
|
|
|
internalFormat = this._gl.RGBA;
|
|
|
break;
|
|
|
- case Engine.TEXTUREFORMAT_R32F:
|
|
|
+ case Engine.TEXTUREFORMAT_R:
|
|
|
internalFormat = this._gl.RED;
|
|
|
break;
|
|
|
- case Engine.TEXTUREFORMAT_RG32F:
|
|
|
+ case Engine.TEXTUREFORMAT_RG:
|
|
|
internalFormat = this._gl.RG;
|
|
|
break;
|
|
|
}
|
|
@@ -17184,17 +17169,27 @@ var BABYLON;
|
|
|
if (type === Engine.TEXTURETYPE_FLOAT) {
|
|
|
if (format !== undefined) {
|
|
|
switch (format) {
|
|
|
- case Engine.TEXTUREFORMAT_R32F:
|
|
|
+ case Engine.TEXTUREFORMAT_R:
|
|
|
return this._gl.R32F;
|
|
|
- case Engine.TEXTUREFORMAT_RG32F:
|
|
|
+ case Engine.TEXTUREFORMAT_RG:
|
|
|
return this._gl.RG32F;
|
|
|
- case Engine.TEXTUREFORMAT_RGB32F:
|
|
|
+ case Engine.TEXTUREFORMAT_RGB:
|
|
|
return this._gl.RGB32F;
|
|
|
}
|
|
|
}
|
|
|
return this._gl.RGBA32F;
|
|
|
}
|
|
|
- else if (type === Engine.TEXTURETYPE_HALF_FLOAT) {
|
|
|
+ if (type === Engine.TEXTURETYPE_HALF_FLOAT) {
|
|
|
+ if (format) {
|
|
|
+ switch (format) {
|
|
|
+ case Engine.TEXTUREFORMAT_R:
|
|
|
+ return this._gl.R16F;
|
|
|
+ case Engine.TEXTUREFORMAT_RG:
|
|
|
+ return this._gl.RG16F;
|
|
|
+ case Engine.TEXTUREFORMAT_RGB:
|
|
|
+ return this._gl.RGB16F;
|
|
|
+ }
|
|
|
+ }
|
|
|
return this._gl.RGBA16F;
|
|
|
}
|
|
|
if (format !== undefined) {
|
|
@@ -17203,6 +17198,10 @@ var BABYLON;
|
|
|
return this._gl.LUMINANCE;
|
|
|
case Engine.TEXTUREFORMAT_RGB:
|
|
|
return this._gl.RGB;
|
|
|
+ case Engine.TEXTUREFORMAT_R:
|
|
|
+ return this._gl.R8;
|
|
|
+ case Engine.TEXTUREFORMAT_RG:
|
|
|
+ return this._gl.RG8;
|
|
|
case Engine.TEXTUREFORMAT_ALPHA:
|
|
|
return this._gl.ALPHA;
|
|
|
}
|
|
@@ -17552,10 +17551,8 @@ var BABYLON;
|
|
|
Engine._TEXTUREFORMAT_LUMINANCE_ALPHA = 2;
|
|
|
Engine._TEXTUREFORMAT_RGB = 4;
|
|
|
Engine._TEXTUREFORMAT_RGBA = 5;
|
|
|
- Engine._TEXTUREFORMAT_R32F = 6;
|
|
|
- Engine._TEXTUREFORMAT_RG32F = 7;
|
|
|
- Engine._TEXTUREFORMAT_RGB32F = 8;
|
|
|
- Engine._TEXTUREFORMAT_RGBA32F = 9;
|
|
|
+ Engine._TEXTUREFORMAT_R = 6;
|
|
|
+ Engine._TEXTUREFORMAT_RG = 7;
|
|
|
Engine._TEXTURETYPE_UNSIGNED_INT = 0;
|
|
|
Engine._TEXTURETYPE_FLOAT = 1;
|
|
|
Engine._TEXTURETYPE_HALF_FLOAT = 2;
|
|
@@ -58104,7 +58101,7 @@ var BABYLON;
|
|
|
d.push(Math.random());
|
|
|
d.push(Math.random());
|
|
|
}
|
|
|
- this._randomTexture = new BABYLON.RawTexture(new Float32Array(d), maxTextureSize, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA32F, this._scene, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE, BABYLON.Engine.TEXTURETYPE_FLOAT);
|
|
|
+ this._randomTexture = new BABYLON.RawTexture(new Float32Array(d), maxTextureSize, 1, BABYLON.Engine.TEXTUREFORMAT_RGBA, this._scene, false, false, BABYLON.Texture.NEAREST_SAMPLINGMODE, BABYLON.Engine.TEXTURETYPE_FLOAT);
|
|
|
this._randomTexture.wrapU = BABYLON.Texture.WRAP_ADDRESSMODE;
|
|
|
this._randomTexture.wrapV = BABYLON.Texture.WRAP_ADDRESSMODE;
|
|
|
this._randomTextureSize = maxTextureSize;
|
|
@@ -65714,17 +65711,19 @@ var BABYLON;
|
|
|
* @param generateMipMaps defines a boolean indicating if mip levels should be generated (true by default)
|
|
|
* @param invertY defines if texture must be stored with Y axis inverted
|
|
|
* @param samplingMode defines the sampling mode to use (BABYLON.Texture.TRILINEAR_SAMPLINGMODE by default)
|
|
|
+ * @param textureType defines the texture Type (Engine.TEXTURETYPE_UNSIGNED_INT, Engine.TEXTURETYPE_FLOAT...)
|
|
|
*/
|
|
|
function RawTexture3D(data, width, height, depth,
|
|
|
- /** Gets or sets the texture format to use*/
|
|
|
- format, scene, generateMipMaps, invertY, samplingMode) {
|
|
|
+ /** Gets or sets the texture format to use */
|
|
|
+ format, scene, generateMipMaps, invertY, samplingMode, textureType) {
|
|
|
if (generateMipMaps === void 0) { generateMipMaps = true; }
|
|
|
if (invertY === void 0) { invertY = false; }
|
|
|
if (samplingMode === void 0) { samplingMode = BABYLON.Texture.TRILINEAR_SAMPLINGMODE; }
|
|
|
+ if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
|
|
|
var _this = _super.call(this, null, scene, !generateMipMaps, invertY) || this;
|
|
|
_this.format = format;
|
|
|
_this._engine = scene.getEngine();
|
|
|
- _this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode);
|
|
|
+ _this._texture = scene.getEngine().createRawTexture3D(data, width, height, depth, format, generateMipMaps, invertY, samplingMode, undefined, textureType);
|
|
|
_this.is3D = true;
|
|
|
return _this;
|
|
|
}
|
|
@@ -65736,7 +65735,7 @@ var BABYLON;
|
|
|
if (!this._texture) {
|
|
|
return;
|
|
|
}
|
|
|
- this._engine.updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY);
|
|
|
+ this._engine.updateRawTexture3D(this._texture, data, this._texture.format, this._texture.invertY, undefined, this._texture.type);
|
|
|
};
|
|
|
return RawTexture3D;
|
|
|
}(BABYLON.Texture));
|
|
@@ -86165,16 +86164,34 @@ var BABYLON;
|
|
|
var Debug;
|
|
|
(function (Debug) {
|
|
|
/**
|
|
|
- * Demo available here: http://www.babylonjs-playground.com/#1BZJVJ#8
|
|
|
- */
|
|
|
+ * Class used to render a debug view of a given skeleton
|
|
|
+ * @see http://www.babylonjs-playground.com/#1BZJVJ#8
|
|
|
+ */
|
|
|
var SkeletonViewer = /** @class */ (function () {
|
|
|
- function SkeletonViewer(skeleton, mesh, scene, autoUpdateBonesMatrices, renderingGroupId) {
|
|
|
+ /**
|
|
|
+ * Creates a new SkeletonViewer
|
|
|
+ * @param skeleton defines the skeleton to render
|
|
|
+ * @param mesh defines the mesh attached to the skeleton
|
|
|
+ * @param scene defines the hosting scene
|
|
|
+ * @param autoUpdateBonesMatrices defines a boolean indicating if bones matrices must be forced to update before rendering (true by default)
|
|
|
+ * @param renderingGroupId defines the rendering group id to use with the viewer
|
|
|
+ */
|
|
|
+ function SkeletonViewer(
|
|
|
+ /** defines the skeleton to render */
|
|
|
+ skeleton,
|
|
|
+ /** defines the mesh attached to the skeleton */
|
|
|
+ mesh, scene,
|
|
|
+ /** defines a boolean indicating if bones matrices must be forced to update before rendering (true by default) */
|
|
|
+ autoUpdateBonesMatrices,
|
|
|
+ /** defines the rendering group id to use with the viewer */
|
|
|
+ renderingGroupId) {
|
|
|
if (autoUpdateBonesMatrices === void 0) { autoUpdateBonesMatrices = true; }
|
|
|
if (renderingGroupId === void 0) { renderingGroupId = 1; }
|
|
|
this.skeleton = skeleton;
|
|
|
this.mesh = mesh;
|
|
|
this.autoUpdateBonesMatrices = autoUpdateBonesMatrices;
|
|
|
this.renderingGroupId = renderingGroupId;
|
|
|
+ /** Gets or sets the color used to render the skeleton */
|
|
|
this.color = BABYLON.Color3.White();
|
|
|
this._debugLines = new Array();
|
|
|
this._isEnabled = false;
|
|
@@ -86186,6 +86203,7 @@ var BABYLON;
|
|
|
get: function () {
|
|
|
return this._isEnabled;
|
|
|
},
|
|
|
+ /** Gets or sets a boolean indicating if the viewer is enabled */
|
|
|
set: function (value) {
|
|
|
if (this._isEnabled === value) {
|
|
|
return;
|
|
@@ -86262,6 +86280,7 @@ var BABYLON;
|
|
|
boneNum++;
|
|
|
}
|
|
|
};
|
|
|
+ /** Update the viewer to sync with current skeleton state */
|
|
|
SkeletonViewer.prototype.update = function () {
|
|
|
if (this.autoUpdateBonesMatrices) {
|
|
|
this.skeleton.computeAbsoluteTransforms();
|
|
@@ -86282,6 +86301,7 @@ var BABYLON;
|
|
|
this._debugMesh.position.copyFrom(this.mesh.position);
|
|
|
this._debugMesh.color = this.color;
|
|
|
};
|
|
|
+ /** Release associated resources */
|
|
|
SkeletonViewer.prototype.dispose = function () {
|
|
|
if (this._debugMesh) {
|
|
|
this.isEnabled = false;
|
|
@@ -86308,11 +86328,19 @@ var BABYLON;
|
|
|
* The Axes viewer will show 3 axes in a specific point in space
|
|
|
*/
|
|
|
var AxesViewer = /** @class */ (function () {
|
|
|
+ /**
|
|
|
+ * Creates a new AxesViewer
|
|
|
+ * @param scene defines the hosting scene
|
|
|
+ * @param scaleLines defines a number used to scale line length (1 by default)
|
|
|
+ */
|
|
|
function AxesViewer(scene, scaleLines) {
|
|
|
if (scaleLines === void 0) { scaleLines = 1; }
|
|
|
this._xline = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()];
|
|
|
this._yline = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()];
|
|
|
this._zline = [BABYLON.Vector3.Zero(), BABYLON.Vector3.Zero()];
|
|
|
+ /**
|
|
|
+ * Gets or sets a number used to scale line length
|
|
|
+ */
|
|
|
this.scaleLines = 1;
|
|
|
this.scaleLines = scaleLines;
|
|
|
this._xmesh = BABYLON.Mesh.CreateLines("xline", this._xline, scene, true);
|
|
@@ -86329,6 +86357,13 @@ var BABYLON;
|
|
|
this._zmesh.color = new BABYLON.Color3(0, 0, 1);
|
|
|
this.scene = scene;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * Force the viewer to update
|
|
|
+ * @param position defines the position of the viewer
|
|
|
+ * @param xaxis defines the x axis of the viewer
|
|
|
+ * @param yaxis defines the y axis of the viewer
|
|
|
+ * @param zaxis defines the z axis of the viewer
|
|
|
+ */
|
|
|
AxesViewer.prototype.update = function (position, xaxis, yaxis, zaxis) {
|
|
|
var scaleLines = this.scaleLines;
|
|
|
if (this._xmesh) {
|
|
@@ -86356,6 +86391,7 @@ var BABYLON;
|
|
|
point2.z = zaxis.z * scaleLines;
|
|
|
BABYLON.Mesh.CreateLines("", this._zline, null, false, this._zmesh);
|
|
|
};
|
|
|
+ /** Releases resources */
|
|
|
AxesViewer.prototype.dispose = function () {
|
|
|
if (this._xmesh) {
|
|
|
this._xmesh.dispose();
|
|
@@ -86386,20 +86422,35 @@ var BABYLON;
|
|
|
(function (Debug) {
|
|
|
/**
|
|
|
* The BoneAxesViewer will attach 3 axes to a specific bone of a specific mesh
|
|
|
+ * @see demo here: https://www.babylonjs-playground.com/#0DE8F4#8
|
|
|
*/
|
|
|
var BoneAxesViewer = /** @class */ (function (_super) {
|
|
|
__extends(BoneAxesViewer, _super);
|
|
|
+ /**
|
|
|
+ * Creates a new BoneAxesViewer
|
|
|
+ * @param scene defines the hosting scene
|
|
|
+ * @param bone defines the target bone
|
|
|
+ * @param mesh defines the target mesh
|
|
|
+ * @param scaleLines defines a scaling factor for line length (1 by default)
|
|
|
+ */
|
|
|
function BoneAxesViewer(scene, bone, mesh, scaleLines) {
|
|
|
if (scaleLines === void 0) { scaleLines = 1; }
|
|
|
var _this = _super.call(this, scene, scaleLines) || this;
|
|
|
+ /** Gets current position */
|
|
|
_this.pos = BABYLON.Vector3.Zero();
|
|
|
+ /** Gets direction of X axis */
|
|
|
_this.xaxis = BABYLON.Vector3.Zero();
|
|
|
+ /** Gets direction of Y axis */
|
|
|
_this.yaxis = BABYLON.Vector3.Zero();
|
|
|
+ /** Gets direction of Z axis */
|
|
|
_this.zaxis = BABYLON.Vector3.Zero();
|
|
|
_this.mesh = mesh;
|
|
|
_this.bone = bone;
|
|
|
return _this;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * Force the viewer to update
|
|
|
+ */
|
|
|
BoneAxesViewer.prototype.update = function () {
|
|
|
if (!this.mesh || !this.bone) {
|
|
|
return;
|
|
@@ -86411,6 +86462,7 @@ var BABYLON;
|
|
|
bone.getDirectionToRef(BABYLON.Axis.Z, this.mesh, this.zaxis);
|
|
|
_super.prototype.update.call(this, this.pos, this.xaxis, this.yaxis, this.zaxis);
|
|
|
};
|
|
|
+ /** Releases resources */
|
|
|
BoneAxesViewer.prototype.dispose = function () {
|
|
|
if (this.mesh) {
|
|
|
this.mesh = null;
|
|
@@ -86613,12 +86665,19 @@ var BABYLON;
|
|
|
var Debug;
|
|
|
(function (Debug) {
|
|
|
/**
|
|
|
- * Used to show the physics impostor around the specific mesh.
|
|
|
+ * Used to show the physics impostor around the specific mesh
|
|
|
*/
|
|
|
var PhysicsViewer = /** @class */ (function () {
|
|
|
+ /**
|
|
|
+ * Creates a new PhysicsViewer
|
|
|
+ * @param scene defines the hosting scene
|
|
|
+ */
|
|
|
function PhysicsViewer(scene) {
|
|
|
+ /** @hidden */
|
|
|
this._impostors = [];
|
|
|
+ /** @hidden */
|
|
|
this._meshes = [];
|
|
|
+ /** @hidden */
|
|
|
this._numMeshes = 0;
|
|
|
this._scene = scene || BABYLON.Engine.LastCreatedScene;
|
|
|
var physicEngine = this._scene.getPhysicsEngine();
|
|
@@ -86626,6 +86685,7 @@ var BABYLON;
|
|
|
this._physicsEnginePlugin = physicEngine.getPhysicsPlugin();
|
|
|
}
|
|
|
}
|
|
|
+ /** @hidden */
|
|
|
PhysicsViewer.prototype._updateDebugMeshes = function () {
|
|
|
var plugin = this._physicsEnginePlugin;
|
|
|
for (var i = 0; i < this._numMeshes; i++) {
|
|
@@ -86644,6 +86704,10 @@ var BABYLON;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Renders a specified physic impostor
|
|
|
+ * @param impostor defines the impostor to render
|
|
|
+ */
|
|
|
PhysicsViewer.prototype.showImpostor = function (impostor) {
|
|
|
if (!this._scene) {
|
|
|
return;
|
|
@@ -86664,6 +86728,10 @@ var BABYLON;
|
|
|
this._numMeshes++;
|
|
|
}
|
|
|
};
|
|
|
+ /**
|
|
|
+ * Hides a specified physic impostor
|
|
|
+ * @param impostor defines the impostor to hide
|
|
|
+ */
|
|
|
PhysicsViewer.prototype.hideImpostor = function (impostor) {
|
|
|
if (!impostor || !this._scene) {
|
|
|
return;
|
|
@@ -86738,6 +86806,7 @@ var BABYLON;
|
|
|
}
|
|
|
return mesh;
|
|
|
};
|
|
|
+ /** Releases all resources */
|
|
|
PhysicsViewer.prototype.dispose = function () {
|
|
|
for (var i = 0; i < this._numMeshes; i++) {
|
|
|
this.hideImpostor(this._impostors[i]);
|
|
@@ -93488,10 +93557,17 @@ var BABYLON;
|
|
|
var blurTextureHeight = this._mainTextureDesiredSize.height * this._options.blurTextureSizeRatio;
|
|
|
blurTextureWidth = this._engine.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(blurTextureWidth, this._maxSize) : blurTextureWidth;
|
|
|
blurTextureHeight = this._engine.needPOTTextures ? BABYLON.Tools.GetExponentOfTwo(blurTextureHeight, this._maxSize) : blurTextureHeight;
|
|
|
+ var textureType = 0;
|
|
|
+ if (this._engine.getCaps().textureHalfFloatRender) {
|
|
|
+ textureType = BABYLON.Engine.TEXTURETYPE_HALF_FLOAT;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT;
|
|
|
+ }
|
|
|
this._blurTexture = new BABYLON.RenderTargetTexture("HighlightLayerBlurRTT", {
|
|
|
width: blurTextureWidth,
|
|
|
height: blurTextureHeight
|
|
|
- }, this._scene, false, true, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
|
|
|
+ }, this._scene, false, true, textureType);
|
|
|
this._blurTexture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
|
|
|
this._blurTexture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
|
|
|
this._blurTexture.anisotropicFilteringLevel = 16;
|
|
@@ -93518,7 +93594,7 @@ var BABYLON;
|
|
|
this._horizontalBlurPostprocess = new BABYLON.BlurPostProcess("HighlightLayerHBP", new BABYLON.Vector2(1.0, 0), this._options.blurHorizontalSize / 2, {
|
|
|
width: blurTextureWidth,
|
|
|
height: blurTextureHeight
|
|
|
- }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
|
|
|
+ }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
|
|
|
this._horizontalBlurPostprocess.width = blurTextureWidth;
|
|
|
this._horizontalBlurPostprocess.height = blurTextureHeight;
|
|
|
this._horizontalBlurPostprocess.onApplyObservable.add(function (effect) {
|
|
@@ -93527,7 +93603,7 @@ var BABYLON;
|
|
|
this._verticalBlurPostprocess = new BABYLON.BlurPostProcess("HighlightLayerVBP", new BABYLON.Vector2(0, 1.0), this._options.blurVerticalSize / 2, {
|
|
|
width: blurTextureWidth,
|
|
|
height: blurTextureHeight
|
|
|
- }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, BABYLON.Engine.TEXTURETYPE_HALF_FLOAT);
|
|
|
+ }, null, BABYLON.Texture.BILINEAR_SAMPLINGMODE, this._scene.getEngine(), false, textureType);
|
|
|
this._postProcesses = [this._horizontalBlurPostprocess, this._verticalBlurPostprocess];
|
|
|
}
|
|
|
this._mainTexture.onAfterUnbindObservable.add(function () {
|
|
@@ -107952,28 +108028,51 @@ var BABYLON;
|
|
|
* Abstract class that can be implemented to extend existing glTF loader behavior.
|
|
|
*/
|
|
|
var GLTFLoaderExtension = /** @class */ (function () {
|
|
|
+ /**
|
|
|
+ * Creates new GLTFLoaderExtension
|
|
|
+ * @param loader defines the GLTFLoader to use
|
|
|
+ */
|
|
|
function GLTFLoaderExtension(loader) {
|
|
|
+ /** Gets or sets a boolean indicating if the extension is enabled */
|
|
|
this.enabled = true;
|
|
|
this._loader = loader;
|
|
|
}
|
|
|
+ /** Release all resources */
|
|
|
GLTFLoaderExtension.prototype.dispose = function () {
|
|
|
delete this._loader;
|
|
|
};
|
|
|
// #region Overridable Methods
|
|
|
- /** Override this method to modify the default behavior for loading scenes. */
|
|
|
+ /**
|
|
|
+ * Override this method to modify the default behavior for loading scenes.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
GLTFLoaderExtension.prototype._loadSceneAsync = function (context, node) { return null; };
|
|
|
- /** Override this method to modify the default behavior for loading nodes. */
|
|
|
+ /**
|
|
|
+ * Override this method to modify the default behavior for loading nodes.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
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. */
|
|
|
+ /** Override this method to modify the default behavior for loading materials.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
GLTFLoaderExtension.prototype._loadMaterialAsync = function (context, material, babylonMesh, babylonDrawMode, assign) { return null; };
|
|
|
- /** Override this method to modify the default behavior for loading textures. */
|
|
|
+ /**
|
|
|
+ * Override this method to modify the default behavior for loading textures.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
GLTFLoaderExtension.prototype._loadTextureAsync = function (context, textureInfo, assign) { return null; };
|
|
|
- /** Override this method to modify the default behavior for loading uris. */
|
|
|
+ /**
|
|
|
+ * Override this method to modify the default behavior for loading uris.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
GLTFLoaderExtension.prototype._loadUriAsync = function (context, uri) { return null; };
|
|
|
// #endregion
|
|
|
- /** Helper method called by a loader extension to load an glTF extension. */
|
|
|
+ /**
|
|
|
+ * Helper method called by a loader extension to load an glTF extension.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
GLTFLoaderExtension.prototype._loadExtensionAsync = function (context, property, actionAsync) {
|
|
|
if (!property.extensions) {
|
|
|
return null;
|
|
@@ -107993,27 +108092,45 @@ var BABYLON;
|
|
|
extensions[this.name] = extension;
|
|
|
}
|
|
|
};
|
|
|
- /** Helper method called by the loader to allow extensions to override loading scenes. */
|
|
|
+ /**
|
|
|
+ * Helper method called by the loader to allow extensions to override loading scenes.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
GLTFLoaderExtension._LoadSceneAsync = function (loader, context, scene) {
|
|
|
return loader._applyExtensions(function (extension) { return extension._loadSceneAsync(context, scene); });
|
|
|
};
|
|
|
- /** Helper method called by the loader to allow extensions to override loading nodes. */
|
|
|
+ /**
|
|
|
+ * Helper method called by the loader to allow extensions to override loading nodes.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
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. */
|
|
|
+ /**
|
|
|
+ * Helper method called by the loader to allow extensions to override loading mesh primitive vertex data.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
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. */
|
|
|
+ /**
|
|
|
+ * Helper method called by the loader to allow extensions to override loading materials.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
GLTFLoaderExtension._LoadMaterialAsync = function (loader, context, material, babylonMesh, babylonDrawMode, assign) {
|
|
|
return loader._applyExtensions(function (extension) { return extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign); });
|
|
|
};
|
|
|
- /** Helper method called by the loader to allow extensions to override loading textures. */
|
|
|
+ /**
|
|
|
+ * Helper method called by the loader to allow extensions to override loading textures.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
GLTFLoaderExtension._LoadTextureAsync = function (loader, context, textureInfo, assign) {
|
|
|
return loader._applyExtensions(function (extension) { return extension._loadTextureAsync(context, textureInfo, assign); });
|
|
|
};
|
|
|
- /** Helper method called by the loader to allow extensions to override loading uris. */
|
|
|
+ /**
|
|
|
+ * Helper method called by the loader to allow extensions to override loading uris.
|
|
|
+ * @hidden
|
|
|
+ */
|
|
|
GLTFLoaderExtension._LoadUriAsync = function (loader, context, uri) {
|
|
|
return loader._applyExtensions(function (extension) { return extension._loadUriAsync(context, uri); });
|
|
|
};
|
|
@@ -108433,6 +108550,7 @@ var BABYLON;
|
|
|
_this.name = NAME;
|
|
|
return _this;
|
|
|
}
|
|
|
+ /** @hidden */
|
|
|
KHR_materials_pbrSpecularGlossiness.prototype._loadMaterialAsync = function (context, material, babylonMesh, babylonDrawMode, assign) {
|
|
|
var _this = this;
|
|
|
return this._loadExtensionAsync(context, material, function (extensionContext, extension) {
|