|
@@ -31802,6 +31802,16 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ Object.defineProperty(BaseTexture.prototype, "noMipmap", {
|
|
|
+ /**
|
|
|
+ * Are mip maps generated for this texture or not.
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ return false;
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
Object.defineProperty(BaseTexture.prototype, "lodGenerationOffset", {
|
|
|
/**
|
|
|
* With prefiltered texture, defined the offset used during the prefiltering steps.
|
|
@@ -31973,6 +31983,41 @@ var BABYLON;
|
|
|
return new BABYLON.Size(this._texture.baseWidth, this._texture.baseHeight);
|
|
|
};
|
|
|
/**
|
|
|
+ * Update the sampling mode of the texture.
|
|
|
+ * Default is Trilinear mode.
|
|
|
+ *
|
|
|
+ * | Value | Type | Description |
|
|
|
+ * | ----- | ------------------ | ----------- |
|
|
|
+ * | 1 | NEAREST_SAMPLINGMODE or NEAREST_NEAREST_MIPLINEAR | Nearest is: mag = nearest, min = nearest, mip = linear |
|
|
|
+ * | 2 | BILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPNEAREST | Bilinear is: mag = linear, min = linear, mip = nearest |
|
|
|
+ * | 3 | TRILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPLINEAR | Trilinear is: mag = linear, min = linear, mip = linear |
|
|
|
+ * | 4 | NEAREST_NEAREST_MIPNEAREST | |
|
|
|
+ * | 5 | NEAREST_LINEAR_MIPNEAREST | |
|
|
|
+ * | 6 | NEAREST_LINEAR_MIPLINEAR | |
|
|
|
+ * | 7 | NEAREST_LINEAR | |
|
|
|
+ * | 8 | NEAREST_NEAREST | |
|
|
|
+ * | 9 | LINEAR_NEAREST_MIPNEAREST | |
|
|
|
+ * | 10 | LINEAR_NEAREST_MIPLINEAR | |
|
|
|
+ * | 11 | LINEAR_LINEAR | |
|
|
|
+ * | 12 | LINEAR_NEAREST | |
|
|
|
+ *
|
|
|
+ * > _mag_: magnification filter (close to the viewer)
|
|
|
+ * > _min_: minification filter (far from the viewer)
|
|
|
+ * > _mip_: filter used between mip map levels
|
|
|
+ *@param samplingMode Define the new sampling mode of the texture
|
|
|
+ */
|
|
|
+ BaseTexture.prototype.updateSamplingMode = function (samplingMode) {
|
|
|
+ if (!this._texture) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var scene = this.getScene();
|
|
|
+ if (!scene) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this._samplingMode = samplingMode;
|
|
|
+ scene.getEngine().updateTextureSamplingMode(samplingMode, this._texture);
|
|
|
+ };
|
|
|
+ /**
|
|
|
* Scales the texture if is `canRescale()`
|
|
|
* @param ratio the resize factor we want to use to rescale
|
|
|
*/
|
|
@@ -32532,41 +32577,6 @@ var BABYLON;
|
|
|
this._delayedOnLoad = null;
|
|
|
this._delayedOnError = null;
|
|
|
};
|
|
|
- /**
|
|
|
- * Update the sampling mode of the texture.
|
|
|
- * Default is Trilinear mode.
|
|
|
- *
|
|
|
- * | Value | Type | Description |
|
|
|
- * | ----- | ------------------ | ----------- |
|
|
|
- * | 1 | NEAREST_SAMPLINGMODE or NEAREST_NEAREST_MIPLINEAR | Nearest is: mag = nearest, min = nearest, mip = linear |
|
|
|
- * | 2 | BILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPNEAREST | Bilinear is: mag = linear, min = linear, mip = nearest |
|
|
|
- * | 3 | TRILINEAR_SAMPLINGMODE or LINEAR_LINEAR_MIPLINEAR | Trilinear is: mag = linear, min = linear, mip = linear |
|
|
|
- * | 4 | NEAREST_NEAREST_MIPNEAREST | |
|
|
|
- * | 5 | NEAREST_LINEAR_MIPNEAREST | |
|
|
|
- * | 6 | NEAREST_LINEAR_MIPLINEAR | |
|
|
|
- * | 7 | NEAREST_LINEAR | |
|
|
|
- * | 8 | NEAREST_NEAREST | |
|
|
|
- * | 9 | LINEAR_NEAREST_MIPNEAREST | |
|
|
|
- * | 10 | LINEAR_NEAREST_MIPLINEAR | |
|
|
|
- * | 11 | LINEAR_LINEAR | |
|
|
|
- * | 12 | LINEAR_NEAREST | |
|
|
|
- *
|
|
|
- * > _mag_: magnification filter (close to the viewer)
|
|
|
- * > _min_: minification filter (far from the viewer)
|
|
|
- * > _mip_: filter used between mip map levels
|
|
|
- *@param samplingMode Define the new sampling mode of the texture
|
|
|
- */
|
|
|
- Texture.prototype.updateSamplingMode = function (samplingMode) {
|
|
|
- if (!this._texture) {
|
|
|
- return;
|
|
|
- }
|
|
|
- var scene = this.getScene();
|
|
|
- if (!scene) {
|
|
|
- return;
|
|
|
- }
|
|
|
- this._samplingMode = samplingMode;
|
|
|
- scene.getEngine().updateTextureSamplingMode(samplingMode, this._texture);
|
|
|
- };
|
|
|
Texture.prototype._prepareRowForTextureGeneration = function (x, y, z, t) {
|
|
|
x *= this.uScale;
|
|
|
y *= this.vScale;
|
|
@@ -73756,6 +73766,16 @@ var BABYLON;
|
|
|
enumerable: true,
|
|
|
configurable: true
|
|
|
});
|
|
|
+ Object.defineProperty(CubeTexture.prototype, "noMipmap", {
|
|
|
+ /**
|
|
|
+ * Are mip maps generated for this texture or not.
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ return this._noMipmap;
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
/**
|
|
|
* Creates a cube texture from an array of image urls
|
|
|
* @param files defines an array of image urls
|
|
@@ -73784,9 +73804,10 @@ var BABYLON;
|
|
|
/**
|
|
|
* Update the url (and optional buffer) of this texture if url was null during construction.
|
|
|
* @param url the url of the texture
|
|
|
+ * @param forcedExtension defines the extension to use
|
|
|
* @param onLoad callback called when the texture is loaded (defaults to null)
|
|
|
*/
|
|
|
- CubeTexture.prototype.updateURL = function (url, onLoad) {
|
|
|
+ CubeTexture.prototype.updateURL = function (url, forcedExtension, onLoad) {
|
|
|
if (this.url) {
|
|
|
this.releaseInternalTexture();
|
|
|
}
|
|
@@ -73795,12 +73816,13 @@ var BABYLON;
|
|
|
if (onLoad) {
|
|
|
this._delayedOnLoad = onLoad;
|
|
|
}
|
|
|
- this.delayLoad();
|
|
|
+ this.delayLoad(forcedExtension);
|
|
|
};
|
|
|
/**
|
|
|
* Delays loading of the cube texture
|
|
|
+ * @param forcedExtension defines the extension to use
|
|
|
*/
|
|
|
- CubeTexture.prototype.delayLoad = function () {
|
|
|
+ CubeTexture.prototype.delayLoad = function (forcedExtension) {
|
|
|
if (this.delayLoadState !== BABYLON.Engine.DELAYLOADSTATE_NOTLOADED) {
|
|
|
return;
|
|
|
}
|
|
@@ -73815,7 +73837,7 @@ var BABYLON;
|
|
|
this._texture = scene.getEngine().createPrefilteredCubeTexture(this.url, scene, this.lodGenerationScale, this.lodGenerationOffset, this._delayedOnLoad, undefined, this._format, undefined, this._createPolynomials);
|
|
|
}
|
|
|
else {
|
|
|
- this._texture = scene.getEngine().createCubeTexture(this.url, scene, this._files, this._noMipmap, this._delayedOnLoad, undefined, this._format);
|
|
|
+ this._texture = scene.getEngine().createCubeTexture(this.url, scene, this._files, this._noMipmap, this._delayedOnLoad, undefined, this._format, forcedExtension);
|
|
|
}
|
|
|
}
|
|
|
};
|