David Catuhe 5 years ago
parent
commit
4f792fd9c9

+ 9 - 0
Playground/babylon.d.txt

@@ -18885,6 +18885,15 @@ declare module BABYLON {
          */
         constructor(name: string, scene: Scene, shaderPath: any, options?: Partial<IShaderMaterialOptions>);
         /**
+         * Gets the shader path used to define the shader code
+         * It can be modified to trigger a new compilation
+         */
+        /**
+        * Sets the shader path used to define the shader code
+        * It can be modified to trigger a new compilation
+        */
+        shaderPath: any;
+        /**
          * Gets the options used to compile the shader.
          * They can be modified to trigger a new compilation
          */

+ 9 - 0
dist/preview release/babylon.d.ts

@@ -19154,6 +19154,15 @@ declare module BABYLON {
          */
         constructor(name: string, scene: Scene, shaderPath: any, options?: Partial<IShaderMaterialOptions>);
         /**
+         * Gets the shader path used to define the shader code
+         * It can be modified to trigger a new compilation
+         */
+        /**
+        * Sets the shader path used to define the shader code
+        * It can be modified to trigger a new compilation
+        */
+        shaderPath: any;
+        /**
          * Gets the options used to compile the shader.
          * They can be modified to trigger a new compilation
          */

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.js


+ 31 - 5
dist/preview release/babylon.max.js

@@ -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]);

File diff suppressed because it is too large
+ 1 - 1
dist/preview release/babylon.max.js.map


+ 18 - 0
dist/preview release/babylon.module.d.ts

@@ -19695,6 +19695,15 @@ declare module "babylonjs/Materials/shaderMaterial" {
          */
         constructor(name: string, scene: Scene, shaderPath: any, options?: Partial<IShaderMaterialOptions>);
         /**
+         * Gets the shader path used to define the shader code
+         * It can be modified to trigger a new compilation
+         */
+        /**
+        * Sets the shader path used to define the shader code
+        * It can be modified to trigger a new compilation
+        */
+        shaderPath: any;
+        /**
          * Gets the options used to compile the shader.
          * They can be modified to trigger a new compilation
          */
@@ -87172,6 +87181,15 @@ declare module BABYLON {
          */
         constructor(name: string, scene: Scene, shaderPath: any, options?: Partial<IShaderMaterialOptions>);
         /**
+         * Gets the shader path used to define the shader code
+         * It can be modified to trigger a new compilation
+         */
+        /**
+        * Sets the shader path used to define the shader code
+        * It can be modified to trigger a new compilation
+        */
+        shaderPath: any;
+        /**
          * Gets the options used to compile the shader.
          * They can be modified to trigger a new compilation
          */

+ 9 - 0
dist/preview release/documentation.d.ts

@@ -19154,6 +19154,15 @@ declare module BABYLON {
          */
         constructor(name: string, scene: Scene, shaderPath: any, options?: Partial<IShaderMaterialOptions>);
         /**
+         * Gets the shader path used to define the shader code
+         * It can be modified to trigger a new compilation
+         */
+        /**
+        * Sets the shader path used to define the shader code
+        * It can be modified to trigger a new compilation
+        */
+        shaderPath: any;
+        /**
          * Gets the options used to compile the shader.
          * They can be modified to trigger a new compilation
          */

+ 1 - 1
dist/preview release/packagesSizeBaseLine.json

@@ -1 +1 @@
-{"thinEngineOnly":115911,"engineOnly":152732,"sceneOnly":496017,"minGridMaterial":626010,"minStandardMaterial":749853}
+{"thinEngineOnly":115916,"engineOnly":152737,"sceneOnly":496022,"minGridMaterial":626015,"minStandardMaterial":749858}

+ 18 - 0
dist/preview release/viewer/babylon.module.d.ts

@@ -19695,6 +19695,15 @@ declare module "babylonjs/Materials/shaderMaterial" {
          */
         constructor(name: string, scene: Scene, shaderPath: any, options?: Partial<IShaderMaterialOptions>);
         /**
+         * Gets the shader path used to define the shader code
+         * It can be modified to trigger a new compilation
+         */
+        /**
+        * Sets the shader path used to define the shader code
+        * It can be modified to trigger a new compilation
+        */
+        shaderPath: any;
+        /**
          * Gets the options used to compile the shader.
          * They can be modified to trigger a new compilation
          */
@@ -87172,6 +87181,15 @@ declare module BABYLON {
          */
         constructor(name: string, scene: Scene, shaderPath: any, options?: Partial<IShaderMaterialOptions>);
         /**
+         * Gets the shader path used to define the shader code
+         * It can be modified to trigger a new compilation
+         */
+        /**
+        * Sets the shader path used to define the shader code
+        * It can be modified to trigger a new compilation
+        */
+        shaderPath: any;
+        /**
          * Gets the options used to compile the shader.
          * They can be modified to trigger a new compilation
          */

File diff suppressed because it is too large
+ 2 - 2
dist/preview release/viewer/babylon.viewer.js


File diff suppressed because it is too large
+ 1 - 1
dist/preview release/viewer/babylon.viewer.max.js