|
@@ -15955,13 +15955,15 @@ var BABYLON;
|
|
|
* @param invertY defines if data must be stored with Y axis inverted
|
|
|
* @param premulAlpha defines if alpha is stored as premultiplied
|
|
|
* @param format defines the format of the data
|
|
|
+ * @param forceBindTexture if the texture should be forced to be bound eg. after a graphics context loss (Default: false)
|
|
|
*/
|
|
|
- Engine.prototype.updateDynamicTexture = function (texture, canvas, invertY, premulAlpha, format) {
|
|
|
+ Engine.prototype.updateDynamicTexture = function (texture, canvas, invertY, premulAlpha, format, forceBindTexture) {
|
|
|
if (premulAlpha === void 0) { premulAlpha = false; }
|
|
|
+ if (forceBindTexture === void 0) { forceBindTexture = false; }
|
|
|
if (!texture) {
|
|
|
return;
|
|
|
}
|
|
|
- this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true);
|
|
|
+ this._bindTextureDirectly(this._gl.TEXTURE_2D, texture, true, forceBindTexture);
|
|
|
this._unpackFlipY(invertY);
|
|
|
if (premulAlpha) {
|
|
|
this._gl.pixelStorei(this._gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);
|
|
@@ -31070,6 +31072,7 @@ var BABYLON;
|
|
|
case InternalTexture.DATASOURCE_DYNAMIC:
|
|
|
proxy = this._engine.createDynamicTexture(this.baseWidth, this.baseHeight, this.generateMipMaps, this.samplingMode);
|
|
|
proxy._swapAndDie(this);
|
|
|
+ this._engine.updateDynamicTexture(this, this._engine.getRenderingCanvas(), this.invertY, undefined, undefined, true);
|
|
|
// The engine will make sure to update content so no need to flag it as isReady = true
|
|
|
return;
|
|
|
case InternalTexture.DATASOURCE_RENDERTARGET:
|
|
@@ -102757,7 +102760,7 @@ var BABYLON;
|
|
|
this._rootMesh.position.copyFrom(this.attachedMesh.absolutePosition);
|
|
|
}
|
|
|
if (this._updateScale && this.gizmoLayer.utilityLayerScene.activeCamera && this.attachedMesh) {
|
|
|
- var cameraPosition = this.gizmoLayer.utilityLayerScene.activeCamera.position;
|
|
|
+ var cameraPosition = this.gizmoLayer.utilityLayerScene.activeCamera.globalPosition;
|
|
|
if (this.gizmoLayer.utilityLayerScene.activeCamera.devicePosition) {
|
|
|
cameraPosition = this.gizmoLayer.utilityLayerScene.activeCamera.devicePosition;
|
|
|
}
|