|
@@ -25378,6 +25378,7 @@ var BABYLON;
|
|
|
this._engine = engine;
|
|
|
}
|
|
|
this._updatable = updatable;
|
|
|
+ this._instanced = instanced;
|
|
|
this._data = data;
|
|
|
this._strideSize = stride;
|
|
|
if (!postponeInternalCreation) {
|
|
@@ -25395,7 +25396,7 @@ var BABYLON;
|
|
|
*/
|
|
|
Buffer.prototype.createVertexBuffer = function (kind, offset, size, stride, instanced) {
|
|
|
// a lot of these parameters are ignored as they are overriden by the buffer
|
|
|
- return new BABYLON.VertexBuffer(this._engine, this, kind, this._updatable, true, stride ? stride : this._strideSize, instanced, offset, size);
|
|
|
+ return new BABYLON.VertexBuffer(this._engine, this, kind, this._updatable, true, stride ? stride : this._strideSize, instanced === undefined ? this._instanced : instanced, offset, size);
|
|
|
};
|
|
|
// Properties
|
|
|
Buffer.prototype.isUpdatable = function () {
|
|
@@ -68394,21 +68395,41 @@ var BABYLON;
|
|
|
_this.color = color;
|
|
|
_this.depth = depth;
|
|
|
_this.colorLevel = colorLevel;
|
|
|
+ _this._ownRefractionTexture = true;
|
|
|
_this.onActivateObservable.add(function (cam) {
|
|
|
- _this._refRexture = _this._refRexture || new BABYLON.Texture(refractionTextureUrl, cam.getScene());
|
|
|
+ _this._refTexture = _this._refTexture || new BABYLON.Texture(refractionTextureUrl, cam.getScene());
|
|
|
});
|
|
|
_this.onApplyObservable.add(function (effect) {
|
|
|
effect.setColor3("baseColor", _this.color);
|
|
|
effect.setFloat("depth", _this.depth);
|
|
|
effect.setFloat("colorLevel", _this.colorLevel);
|
|
|
- effect.setTexture("refractionSampler", _this._refRexture);
|
|
|
+ effect.setTexture("refractionSampler", _this._refTexture);
|
|
|
});
|
|
|
return _this;
|
|
|
}
|
|
|
+ Object.defineProperty(RefractionPostProcess.prototype, "refractionTexture", {
|
|
|
+ /**
|
|
|
+ * Gets or sets the refraction texture
|
|
|
+ * Please note that you are responsible for disposing the texture if you set it manually
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ return this._refTexture;
|
|
|
+ },
|
|
|
+ set: function (value) {
|
|
|
+ if (this._refTexture && this._ownRefractionTexture) {
|
|
|
+ this._refTexture.dispose();
|
|
|
+ }
|
|
|
+ this._refTexture = value;
|
|
|
+ this._ownRefractionTexture = false;
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
// Methods
|
|
|
RefractionPostProcess.prototype.dispose = function (camera) {
|
|
|
- if (this._refRexture) {
|
|
|
- this._refRexture.dispose();
|
|
|
+ if (this._refTexture && this._ownRefractionTexture) {
|
|
|
+ this._refTexture.dispose();
|
|
|
+ this._refTexture = null;
|
|
|
}
|
|
|
_super.prototype.dispose.call(this, camera);
|
|
|
};
|