|
@@ -14,17 +14,18 @@ var BABYLON;
|
|
|
this.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
|
|
|
this.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
|
|
|
this._generateMipMaps = generateMipMaps;
|
|
|
+ var forceExponentOfTwo = generateMipMaps || samplingMode !== BABYLON.Texture.NEAREST_SAMPLINGMODE;
|
|
|
if (options.getContext) {
|
|
|
this._canvas = options;
|
|
|
- this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode);
|
|
|
+ this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode, forceExponentOfTwo);
|
|
|
}
|
|
|
else {
|
|
|
this._canvas = document.createElement("canvas");
|
|
|
if (options.width) {
|
|
|
- this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode);
|
|
|
+ this._texture = scene.getEngine().createDynamicTexture(options.width, options.height, generateMipMaps, samplingMode, forceExponentOfTwo);
|
|
|
}
|
|
|
else {
|
|
|
- this._texture = scene.getEngine().createDynamicTexture(options, options, generateMipMaps, samplingMode);
|
|
|
+ this._texture = scene.getEngine().createDynamicTexture(options, options, generateMipMaps, samplingMode, forceExponentOfTwo);
|
|
|
}
|
|
|
}
|
|
|
var textureSize = this.getSize();
|
|
@@ -78,7 +79,7 @@ var BABYLON;
|
|
|
};
|
|
|
DynamicTexture.prototype.clone = function () {
|
|
|
var textureSize = this.getSize();
|
|
|
- var newTexture = new DynamicTexture(this.name, textureSize.width, this.getScene(), this._generateMipMaps);
|
|
|
+ var newTexture = new DynamicTexture(this.name, textureSize, this.getScene(), this._generateMipMaps);
|
|
|
// Base texture
|
|
|
newTexture.hasAlpha = this.hasAlpha;
|
|
|
newTexture.level = this.level;
|