|
@@ -36445,11 +36445,7 @@ var NativeEngine = /** @class */ (function (_super) {
|
|
|
}
|
|
|
return;
|
|
|
}
|
|
|
- _this._native.loadTexture(webGLTexture, data, !noMipmap);
|
|
|
- if (invertY) {
|
|
|
- throw new Error("Support for textures with inverted Y coordinates not yet implemented.");
|
|
|
- }
|
|
|
- //this._unpackFlipY(invertY === undefined ? true : (invertY ? true : false));
|
|
|
+ _this._native.loadTexture(webGLTexture, data, !noMipmap, invertY);
|
|
|
texture.baseWidth = _this._native.getTextureWidth(webGLTexture);
|
|
|
texture.baseHeight = _this._native.getTextureHeight(webGLTexture);
|
|
|
texture.width = texture.baseWidth;
|
|
@@ -90312,6 +90308,24 @@ var ShaderMaterial = /** @class */ (function (_super) {
|
|
|
_this._options = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({ needAlphaBlending: false, needAlphaTesting: false, attributes: ["position", "normal", "uv"], uniforms: ["worldViewProjection"], uniformBuffers: [], samplers: [], defines: [] }, options);
|
|
|
return _this;
|
|
|
}
|
|
|
+ Object.defineProperty(ShaderMaterial.prototype, "shaderPath", {
|
|
|
+ /**
|
|
|
+ * Gets the shader path used to define the shader code
|
|
|
+ * It can be modified to trigger a new compilation
|
|
|
+ */
|
|
|
+ get: function () {
|
|
|
+ return this._shaderPath;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * Sets the shader path used to define the shader code
|
|
|
+ * It can be modified to trigger a new compilation
|
|
|
+ */
|
|
|
+ set: function (shaderPath) {
|
|
|
+ this._shaderPath = shaderPath;
|
|
|
+ },
|
|
|
+ enumerable: true,
|
|
|
+ configurable: true
|
|
|
+ });
|
|
|
Object.defineProperty(ShaderMaterial.prototype, "options", {
|
|
|
/**
|
|
|
* Gets the options used to compile the shader.
|
|
@@ -90862,6 +90876,18 @@ var ShaderMaterial = /** @class */ (function (_super) {
|
|
|
var result = _Misc_decorators__WEBPACK_IMPORTED_MODULE_1__["SerializationHelper"].Clone(function () { return new ShaderMaterial(name, _this.getScene(), _this._shaderPath, _this._options); }, this);
|
|
|
result.name = name;
|
|
|
result.id = name;
|
|
|
+ // Shader code path
|
|
|
+ if (typeof result._shaderPath === 'object') {
|
|
|
+ result._shaderPath = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, result._shaderPath);
|
|
|
+ }
|
|
|
+ // Options
|
|
|
+ this._options = Object(tslib__WEBPACK_IMPORTED_MODULE_0__["__assign"])({}, this._options);
|
|
|
+ Object.keys(this._options).forEach(function (propName) {
|
|
|
+ var propValue = _this._options[propName];
|
|
|
+ if (Array.isArray(propValue)) {
|
|
|
+ _this._options[propName] = propValue.slice(0);
|
|
|
+ }
|
|
|
+ });
|
|
|
// Texture
|
|
|
for (var key in this._textures) {
|
|
|
result.setTexture(key, this._textures[key]);
|