浏览代码

Adding support for uv3, uv4, uv5 and uv6 for ShaderMaterial

David Catuhe 10 年之前
父节点
当前提交
4f64fa1ee6

文件差异内容过多而无法显示
+ 16 - 14
dist/preview release - alpha/babylon.2.2.js


+ 160 - 2
dist/preview release - alpha/babylon.2.2.max.js

@@ -13882,9 +13882,11 @@ var BABYLON;
                     this._strideSize = 3;
                     break;
                 case VertexBuffer.UVKind:
-                    this._strideSize = 2;
-                    break;
                 case VertexBuffer.UV2Kind:
+                case VertexBuffer.UV3Kind:
+                case VertexBuffer.UV4Kind:
+                case VertexBuffer.UV5Kind:
+                case VertexBuffer.UV6Kind:
                     this._strideSize = 2;
                     break;
                 case VertexBuffer.ColorKind:
@@ -13978,6 +13980,34 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(VertexBuffer, "UV3Kind", {
+            get: function () {
+                return VertexBuffer._UV3Kind;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(VertexBuffer, "UV4Kind", {
+            get: function () {
+                return VertexBuffer._UV4Kind;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(VertexBuffer, "UV5Kind", {
+            get: function () {
+                return VertexBuffer._UV5Kind;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(VertexBuffer, "UV6Kind", {
+            get: function () {
+                return VertexBuffer._UV6Kind;
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(VertexBuffer, "ColorKind", {
             get: function () {
                 return VertexBuffer._ColorKind;
@@ -14004,6 +14034,10 @@ var BABYLON;
         VertexBuffer._NormalKind = "normal";
         VertexBuffer._UVKind = "uv";
         VertexBuffer._UV2Kind = "uv2";
+        VertexBuffer._UV3Kind = "uv3";
+        VertexBuffer._UV4Kind = "uv4";
+        VertexBuffer._UV5Kind = "uv5";
+        VertexBuffer._UV6Kind = "uv6";
         VertexBuffer._ColorKind = "color";
         VertexBuffer._MatricesIndicesKind = "matricesIndices";
         VertexBuffer._MatricesWeightsKind = "matricesWeights";
@@ -19380,6 +19414,18 @@ var BABYLON;
                 if (parsedVertexData.hasUVs2) {
                     geometry._delayInfo.push(BABYLON.VertexBuffer.UV2Kind);
                 }
+                if (parsedVertexData.hasUVs3) {
+                    geometry._delayInfo.push(BABYLON.VertexBuffer.UV3Kind);
+                }
+                if (parsedVertexData.hasUVs4) {
+                    geometry._delayInfo.push(BABYLON.VertexBuffer.UV4Kind);
+                }
+                if (parsedVertexData.hasUVs5) {
+                    geometry._delayInfo.push(BABYLON.VertexBuffer.UV5Kind);
+                }
+                if (parsedVertexData.hasUVs6) {
+                    geometry._delayInfo.push(BABYLON.VertexBuffer.UV6Kind);
+                }
                 if (parsedVertexData.hasColors) {
                     geometry._delayInfo.push(BABYLON.VertexBuffer.ColorKind);
                 }
@@ -19747,6 +19793,26 @@ var BABYLON;
             if (uv2s) {
                 vertexData.set(uv2s, BABYLON.VertexBuffer.UV2Kind);
             }
+            // uv3s
+            var uv3s = parsedVertexData.uv3s;
+            if (uv3s) {
+                vertexData.set(uv3s, BABYLON.VertexBuffer.UV3Kind);
+            }
+            // uv4s
+            var uv4s = parsedVertexData.uv4s;
+            if (uv4s) {
+                vertexData.set(uv4s, BABYLON.VertexBuffer.UV4Kind);
+            }
+            // uv5s
+            var uv5s = parsedVertexData.uv5s;
+            if (uv5s) {
+                vertexData.set(uv5s, BABYLON.VertexBuffer.UV5Kind);
+            }
+            // uv6s
+            var uv6s = parsedVertexData.uv6s;
+            if (uv6s) {
+                vertexData.set(uv6s, BABYLON.VertexBuffer.UV6Kind);
+            }
             // colors
             var colors = parsedVertexData.colors;
             if (colors) {
@@ -23629,6 +23695,18 @@ var BABYLON;
         if (vertexData.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) {
             serializationObject.uvs2 = vertexData.getVerticesData(BABYLON.VertexBuffer.UV2Kind);
         }
+        if (vertexData.isVerticesDataPresent(BABYLON.VertexBuffer.UV3Kind)) {
+            serializationObject.uvs3 = vertexData.getVerticesData(BABYLON.VertexBuffer.UV3Kind);
+        }
+        if (vertexData.isVerticesDataPresent(BABYLON.VertexBuffer.UV4Kind)) {
+            serializationObject.uvs4 = vertexData.getVerticesData(BABYLON.VertexBuffer.UV4Kind);
+        }
+        if (vertexData.isVerticesDataPresent(BABYLON.VertexBuffer.UV5Kind)) {
+            serializationObject.uvs5 = vertexData.getVerticesData(BABYLON.VertexBuffer.UV5Kind);
+        }
+        if (vertexData.isVerticesDataPresent(BABYLON.VertexBuffer.UV6Kind)) {
+            serializationObject.uvs6 = vertexData.getVerticesData(BABYLON.VertexBuffer.UV6Kind);
+        }
         if (vertexData.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind)) {
             serializationObject.colors = vertexData.getVerticesData(BABYLON.VertexBuffer.ColorKind);
         }
@@ -25006,6 +25084,18 @@ var BABYLON;
                 case BABYLON.VertexBuffer.UV2Kind:
                     this.uv2s = data;
                     break;
+                case BABYLON.VertexBuffer.UV3Kind:
+                    this.uv3s = data;
+                    break;
+                case BABYLON.VertexBuffer.UV4Kind:
+                    this.uv4s = data;
+                    break;
+                case BABYLON.VertexBuffer.UV5Kind:
+                    this.uv5s = data;
+                    break;
+                case BABYLON.VertexBuffer.UV6Kind:
+                    this.uv6s = data;
+                    break;
                 case BABYLON.VertexBuffer.ColorKind:
                     this.colors = data;
                     break;
@@ -25042,6 +25132,18 @@ var BABYLON;
             if (this.uv2s) {
                 meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV2Kind, this.uv2s, updatable);
             }
+            if (this.uv3s) {
+                meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV3Kind, this.uv3s, updatable);
+            }
+            if (this.uv4s) {
+                meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV4Kind, this.uv4s, updatable);
+            }
+            if (this.uv5s) {
+                meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV5Kind, this.uv5s, updatable);
+            }
+            if (this.uv6s) {
+                meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV6Kind, this.uv6s, updatable);
+            }
             if (this.colors) {
                 meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.ColorKind, this.colors, updatable);
             }
@@ -25068,6 +25170,18 @@ var BABYLON;
             if (this.uv2s) {
                 meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV2Kind, this.uv2s, updateExtends, makeItUnique);
             }
+            if (this.uv3s) {
+                meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV3Kind, this.uv3s, updateExtends, makeItUnique);
+            }
+            if (this.uv4s) {
+                meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV4Kind, this.uv4s, updateExtends, makeItUnique);
+            }
+            if (this.uv5s) {
+                meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV5Kind, this.uv5s, updateExtends, makeItUnique);
+            }
+            if (this.uv6s) {
+                meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV6Kind, this.uv6s, updateExtends, makeItUnique);
+            }
             if (this.colors) {
                 meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.ColorKind, this.colors, updateExtends, makeItUnique);
             }
@@ -25146,6 +25260,38 @@ var BABYLON;
                     this.uv2s.push(other.uv2s[index]);
                 }
             }
+            if (other.uv3s) {
+                if (!this.uv3s) {
+                    this.uv3s = [];
+                }
+                for (index = 0; index < other.uv3s.length; index++) {
+                    this.uv3s.push(other.uv3s[index]);
+                }
+            }
+            if (other.uv4s) {
+                if (!this.uv4s) {
+                    this.uv4s = [];
+                }
+                for (index = 0; index < other.uv4s.length; index++) {
+                    this.uv4s.push(other.uv4s[index]);
+                }
+            }
+            if (other.uv5s) {
+                if (!this.uv5s) {
+                    this.uv5s = [];
+                }
+                for (index = 0; index < other.uv5s.length; index++) {
+                    this.uv5s.push(other.uv5s[index]);
+                }
+            }
+            if (other.uv6s) {
+                if (!this.uv6s) {
+                    this.uv6s = [];
+                }
+                for (index = 0; index < other.uv6s.length; index++) {
+                    this.uv6s.push(other.uv6s[index]);
+                }
+            }
             if (other.matricesIndices) {
                 if (!this.matricesIndices) {
                     this.matricesIndices = [];
@@ -25192,6 +25338,18 @@ var BABYLON;
             if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) {
                 result.uv2s = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV2Kind, copyWhenShared);
             }
+            if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV3Kind)) {
+                result.uv3s = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV3Kind, copyWhenShared);
+            }
+            if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV4Kind)) {
+                result.uv4s = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV4Kind, copyWhenShared);
+            }
+            if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV5Kind)) {
+                result.uv5s = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV5Kind, copyWhenShared);
+            }
+            if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV6Kind)) {
+                result.uv6s = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV6Kind, copyWhenShared);
+            }
             if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind)) {
                 result.colors = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.ColorKind, copyWhenShared);
             }

文件差异内容过多而无法显示
+ 16 - 14
dist/preview release - alpha/babylon.2.2.noworker.js


+ 1 - 0
dist/preview release - alpha/what's new.md

@@ -3,6 +3,7 @@
     - Meshes can now be attached to bones. See [documentation here](http://babylondoc.azurewebsites.net/page.php?p=22421) and [sample here](http://www.babylonjs-playground.com/#11BH6Z#18) [deltakosh](https://github.com/deltakosh)
     - HDR Rendering pipeline. See [demo here]() [julien-moreau](https://github.com/julien-moreau)
   - **Updates**
+    - Meshes can now support uv2, uv4, uv5 and uv6 for ShaderMaterials [deltakosh](https://github.com/deltakosh)
     - Panning support for ArcRotateCamera [julien-moreau](https://github.com/julien-moreau)
     - Vertex color and diffuse color can now be mixed [deltakosh](https://github.com/deltakosh)
     - Depth-of-field improvements [PR](https://github.com/BabylonJS/Babylon.js/pull/567) [jahow](https://github.com/jahow)

+ 32 - 0
src/Loading/Plugins/babylon.babylonFileLoader.js

@@ -497,6 +497,18 @@ var BABYLON;
                 if (parsedVertexData.hasUVs2) {
                     geometry._delayInfo.push(BABYLON.VertexBuffer.UV2Kind);
                 }
+                if (parsedVertexData.hasUVs3) {
+                    geometry._delayInfo.push(BABYLON.VertexBuffer.UV3Kind);
+                }
+                if (parsedVertexData.hasUVs4) {
+                    geometry._delayInfo.push(BABYLON.VertexBuffer.UV4Kind);
+                }
+                if (parsedVertexData.hasUVs5) {
+                    geometry._delayInfo.push(BABYLON.VertexBuffer.UV5Kind);
+                }
+                if (parsedVertexData.hasUVs6) {
+                    geometry._delayInfo.push(BABYLON.VertexBuffer.UV6Kind);
+                }
                 if (parsedVertexData.hasColors) {
                     geometry._delayInfo.push(BABYLON.VertexBuffer.ColorKind);
                 }
@@ -864,6 +876,26 @@ var BABYLON;
             if (uv2s) {
                 vertexData.set(uv2s, BABYLON.VertexBuffer.UV2Kind);
             }
+            // uv3s
+            var uv3s = parsedVertexData.uv3s;
+            if (uv3s) {
+                vertexData.set(uv3s, BABYLON.VertexBuffer.UV3Kind);
+            }
+            // uv4s
+            var uv4s = parsedVertexData.uv4s;
+            if (uv4s) {
+                vertexData.set(uv4s, BABYLON.VertexBuffer.UV4Kind);
+            }
+            // uv5s
+            var uv5s = parsedVertexData.uv5s;
+            if (uv5s) {
+                vertexData.set(uv5s, BABYLON.VertexBuffer.UV5Kind);
+            }
+            // uv6s
+            var uv6s = parsedVertexData.uv6s;
+            if (uv6s) {
+                vertexData.set(uv6s, BABYLON.VertexBuffer.UV6Kind);
+            }
             // colors
             var colors = parsedVertexData.colors;
             if (colors) {

+ 40 - 0
src/Loading/Plugins/babylon.babylonFileLoader.ts

@@ -621,6 +621,22 @@
                 geometry._delayInfo.push(BABYLON.VertexBuffer.UV2Kind);
             }
 
+            if (parsedVertexData.hasUVs3) {
+                geometry._delayInfo.push(BABYLON.VertexBuffer.UV3Kind);
+            }
+
+            if (parsedVertexData.hasUVs4) {
+                geometry._delayInfo.push(BABYLON.VertexBuffer.UV4Kind);
+            }
+
+            if (parsedVertexData.hasUVs5) {
+                geometry._delayInfo.push(BABYLON.VertexBuffer.UV5Kind);
+            }
+
+            if (parsedVertexData.hasUVs6) {
+                geometry._delayInfo.push(BABYLON.VertexBuffer.UV6Kind);
+            }
+
             if (parsedVertexData.hasColors) {
                 geometry._delayInfo.push(BABYLON.VertexBuffer.ColorKind);
             }
@@ -1069,6 +1085,30 @@
             vertexData.set(uv2s, BABYLON.VertexBuffer.UV2Kind);
         }
 
+        // uv3s
+        var uv3s = parsedVertexData.uv3s;
+        if (uv3s) {
+            vertexData.set(uv3s, BABYLON.VertexBuffer.UV3Kind);
+        }
+
+        // uv4s
+        var uv4s = parsedVertexData.uv4s;
+        if (uv4s) {
+            vertexData.set(uv4s, BABYLON.VertexBuffer.UV4Kind);
+        }
+
+        // uv5s
+        var uv5s = parsedVertexData.uv5s;
+        if (uv5s) {
+            vertexData.set(uv5s, BABYLON.VertexBuffer.UV5Kind);
+        }
+
+        // uv6s
+        var uv6s = parsedVertexData.uv6s;
+        if (uv6s) {
+            vertexData.set(uv6s, BABYLON.VertexBuffer.UV6Kind);
+        }
+
         // colors
         var colors = parsedVertexData.colors;
         if (colors) {

+ 80 - 0
src/Mesh/babylon.mesh.vertexData.js

@@ -17,6 +17,18 @@ var BABYLON;
                 case BABYLON.VertexBuffer.UV2Kind:
                     this.uv2s = data;
                     break;
+                case BABYLON.VertexBuffer.UV3Kind:
+                    this.uv3s = data;
+                    break;
+                case BABYLON.VertexBuffer.UV4Kind:
+                    this.uv4s = data;
+                    break;
+                case BABYLON.VertexBuffer.UV5Kind:
+                    this.uv5s = data;
+                    break;
+                case BABYLON.VertexBuffer.UV6Kind:
+                    this.uv6s = data;
+                    break;
                 case BABYLON.VertexBuffer.ColorKind:
                     this.colors = data;
                     break;
@@ -53,6 +65,18 @@ var BABYLON;
             if (this.uv2s) {
                 meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV2Kind, this.uv2s, updatable);
             }
+            if (this.uv3s) {
+                meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV3Kind, this.uv3s, updatable);
+            }
+            if (this.uv4s) {
+                meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV4Kind, this.uv4s, updatable);
+            }
+            if (this.uv5s) {
+                meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV5Kind, this.uv5s, updatable);
+            }
+            if (this.uv6s) {
+                meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.UV6Kind, this.uv6s, updatable);
+            }
             if (this.colors) {
                 meshOrGeometry.setVerticesData(BABYLON.VertexBuffer.ColorKind, this.colors, updatable);
             }
@@ -79,6 +103,18 @@ var BABYLON;
             if (this.uv2s) {
                 meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV2Kind, this.uv2s, updateExtends, makeItUnique);
             }
+            if (this.uv3s) {
+                meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV3Kind, this.uv3s, updateExtends, makeItUnique);
+            }
+            if (this.uv4s) {
+                meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV4Kind, this.uv4s, updateExtends, makeItUnique);
+            }
+            if (this.uv5s) {
+                meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV5Kind, this.uv5s, updateExtends, makeItUnique);
+            }
+            if (this.uv6s) {
+                meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.UV6Kind, this.uv6s, updateExtends, makeItUnique);
+            }
             if (this.colors) {
                 meshOrGeometry.updateVerticesData(BABYLON.VertexBuffer.ColorKind, this.colors, updateExtends, makeItUnique);
             }
@@ -157,6 +193,38 @@ var BABYLON;
                     this.uv2s.push(other.uv2s[index]);
                 }
             }
+            if (other.uv3s) {
+                if (!this.uv3s) {
+                    this.uv3s = [];
+                }
+                for (index = 0; index < other.uv3s.length; index++) {
+                    this.uv3s.push(other.uv3s[index]);
+                }
+            }
+            if (other.uv4s) {
+                if (!this.uv4s) {
+                    this.uv4s = [];
+                }
+                for (index = 0; index < other.uv4s.length; index++) {
+                    this.uv4s.push(other.uv4s[index]);
+                }
+            }
+            if (other.uv5s) {
+                if (!this.uv5s) {
+                    this.uv5s = [];
+                }
+                for (index = 0; index < other.uv5s.length; index++) {
+                    this.uv5s.push(other.uv5s[index]);
+                }
+            }
+            if (other.uv6s) {
+                if (!this.uv6s) {
+                    this.uv6s = [];
+                }
+                for (index = 0; index < other.uv6s.length; index++) {
+                    this.uv6s.push(other.uv6s[index]);
+                }
+            }
             if (other.matricesIndices) {
                 if (!this.matricesIndices) {
                     this.matricesIndices = [];
@@ -203,6 +271,18 @@ var BABYLON;
             if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) {
                 result.uv2s = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV2Kind, copyWhenShared);
             }
+            if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV3Kind)) {
+                result.uv3s = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV3Kind, copyWhenShared);
+            }
+            if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV4Kind)) {
+                result.uv4s = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV4Kind, copyWhenShared);
+            }
+            if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV5Kind)) {
+                result.uv5s = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV5Kind, copyWhenShared);
+            }
+            if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.UV6Kind)) {
+                result.uv6s = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.UV6Kind, copyWhenShared);
+            }
             if (meshOrGeometry.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind)) {
                 result.colors = meshOrGeometry.getVerticesData(BABYLON.VertexBuffer.ColorKind, copyWhenShared);
             }

+ 100 - 0
src/Mesh/babylon.mesh.vertexData.ts

@@ -13,6 +13,10 @@
         public normals: number[];
         public uvs: number[];
         public uv2s: number[];
+        public uv3s: number[];
+        public uv4s: number[];
+        public uv5s: number[];
+        public uv6s: number[];
         public colors: number[];
         public matricesIndices: number[];
         public matricesWeights: number[];
@@ -32,6 +36,18 @@
                 case VertexBuffer.UV2Kind:
                     this.uv2s = data;
                     break;
+                case VertexBuffer.UV3Kind:
+                    this.uv3s = data;
+                    break;
+                case VertexBuffer.UV4Kind:
+                    this.uv4s = data;
+                    break;
+                case VertexBuffer.UV5Kind:
+                    this.uv5s = data;
+                    break;
+                case VertexBuffer.UV6Kind:
+                    this.uv6s = data;
+                    break;
                 case VertexBuffer.ColorKind:
                     this.colors = data;
                     break;
@@ -77,6 +93,22 @@
                 meshOrGeometry.setVerticesData(VertexBuffer.UV2Kind, this.uv2s, updatable);
             }
 
+            if (this.uv3s) {
+                meshOrGeometry.setVerticesData(VertexBuffer.UV3Kind, this.uv3s, updatable);
+            }
+
+            if (this.uv4s) {
+                meshOrGeometry.setVerticesData(VertexBuffer.UV4Kind, this.uv4s, updatable);
+            }
+
+            if (this.uv5s) {
+                meshOrGeometry.setVerticesData(VertexBuffer.UV5Kind, this.uv5s, updatable);
+            }
+
+            if (this.uv6s) {
+                meshOrGeometry.setVerticesData(VertexBuffer.UV6Kind, this.uv6s, updatable);
+            }
+
             if (this.colors) {
                 meshOrGeometry.setVerticesData(VertexBuffer.ColorKind, this.colors, updatable);
             }
@@ -111,6 +143,22 @@
                 meshOrGeometry.updateVerticesData(VertexBuffer.UV2Kind, this.uv2s, updateExtends, makeItUnique);
             }
 
+            if (this.uv3s) {
+                meshOrGeometry.updateVerticesData(VertexBuffer.UV3Kind, this.uv3s, updateExtends, makeItUnique);
+            }
+
+            if (this.uv4s) {
+                meshOrGeometry.updateVerticesData(VertexBuffer.UV4Kind, this.uv4s, updateExtends, makeItUnique);
+            }
+
+            if (this.uv5s) {
+                meshOrGeometry.updateVerticesData(VertexBuffer.UV5Kind, this.uv5s, updateExtends, makeItUnique);
+            }
+
+            if (this.uv6s) {
+                meshOrGeometry.updateVerticesData(VertexBuffer.UV6Kind, this.uv6s, updateExtends, makeItUnique);
+            }
+
             if (this.colors) {
                 meshOrGeometry.updateVerticesData(VertexBuffer.ColorKind, this.colors, updateExtends, makeItUnique);
             }
@@ -207,6 +255,42 @@
                 }
             }
 
+            if (other.uv3s) {
+                if (!this.uv3s) {
+                    this.uv3s = [];
+                }
+                for (index = 0; index < other.uv3s.length; index++) {
+                    this.uv3s.push(other.uv3s[index]);
+                }
+            }
+
+            if (other.uv4s) {
+                if (!this.uv4s) {
+                    this.uv4s = [];
+                }
+                for (index = 0; index < other.uv4s.length; index++) {
+                    this.uv4s.push(other.uv4s[index]);
+                }
+            }
+
+            if (other.uv5s) {
+                if (!this.uv5s) {
+                    this.uv5s = [];
+                }
+                for (index = 0; index < other.uv5s.length; index++) {
+                    this.uv5s.push(other.uv5s[index]);
+                }
+            }
+
+            if (other.uv6s) {
+                if (!this.uv6s) {
+                    this.uv6s = [];
+                }
+                for (index = 0; index < other.uv6s.length; index++) {
+                    this.uv6s.push(other.uv6s[index]);
+                }
+            }
+
             if (other.matricesIndices) {
                 if (!this.matricesIndices) {
                     this.matricesIndices = [];
@@ -263,6 +347,22 @@
                 result.uv2s = meshOrGeometry.getVerticesData(VertexBuffer.UV2Kind, copyWhenShared);
             }
 
+            if (meshOrGeometry.isVerticesDataPresent(VertexBuffer.UV3Kind)) {
+                result.uv3s = meshOrGeometry.getVerticesData(VertexBuffer.UV3Kind, copyWhenShared);
+            }
+
+            if (meshOrGeometry.isVerticesDataPresent(VertexBuffer.UV4Kind)) {
+                result.uv4s = meshOrGeometry.getVerticesData(VertexBuffer.UV4Kind, copyWhenShared);
+            }
+
+            if (meshOrGeometry.isVerticesDataPresent(VertexBuffer.UV5Kind)) {
+                result.uv5s = meshOrGeometry.getVerticesData(VertexBuffer.UV5Kind, copyWhenShared);
+            }
+
+            if (meshOrGeometry.isVerticesDataPresent(VertexBuffer.UV6Kind)) {
+                result.uv6s = meshOrGeometry.getVerticesData(VertexBuffer.UV6Kind, copyWhenShared);
+            }
+
             if (meshOrGeometry.isVerticesDataPresent(VertexBuffer.ColorKind)) {
                 result.colors = meshOrGeometry.getVerticesData(VertexBuffer.ColorKind, copyWhenShared);
             }

+ 36 - 2
src/Mesh/babylon.vertexBuffer.js

@@ -27,9 +27,11 @@ var BABYLON;
                     this._strideSize = 3;
                     break;
                 case VertexBuffer.UVKind:
-                    this._strideSize = 2;
-                    break;
                 case VertexBuffer.UV2Kind:
+                case VertexBuffer.UV3Kind:
+                case VertexBuffer.UV4Kind:
+                case VertexBuffer.UV5Kind:
+                case VertexBuffer.UV6Kind:
                     this._strideSize = 2;
                     break;
                 case VertexBuffer.ColorKind:
@@ -123,6 +125,34 @@ var BABYLON;
             enumerable: true,
             configurable: true
         });
+        Object.defineProperty(VertexBuffer, "UV3Kind", {
+            get: function () {
+                return VertexBuffer._UV3Kind;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(VertexBuffer, "UV4Kind", {
+            get: function () {
+                return VertexBuffer._UV4Kind;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(VertexBuffer, "UV5Kind", {
+            get: function () {
+                return VertexBuffer._UV5Kind;
+            },
+            enumerable: true,
+            configurable: true
+        });
+        Object.defineProperty(VertexBuffer, "UV6Kind", {
+            get: function () {
+                return VertexBuffer._UV6Kind;
+            },
+            enumerable: true,
+            configurable: true
+        });
         Object.defineProperty(VertexBuffer, "ColorKind", {
             get: function () {
                 return VertexBuffer._ColorKind;
@@ -149,6 +179,10 @@ var BABYLON;
         VertexBuffer._NormalKind = "normal";
         VertexBuffer._UVKind = "uv";
         VertexBuffer._UV2Kind = "uv2";
+        VertexBuffer._UV3Kind = "uv3";
+        VertexBuffer._UV4Kind = "uv4";
+        VertexBuffer._UV5Kind = "uv5";
+        VertexBuffer._UV6Kind = "uv6";
         VertexBuffer._ColorKind = "color";
         VertexBuffer._MatricesIndicesKind = "matricesIndices";
         VertexBuffer._MatricesWeightsKind = "matricesWeights";

+ 24 - 2
src/Mesh/babylon.vertexBuffer.ts

@@ -40,9 +40,11 @@
                     this._strideSize = 3;
                     break;
                 case VertexBuffer.UVKind:
-                    this._strideSize = 2;
-                    break;
                 case VertexBuffer.UV2Kind:
+                case VertexBuffer.UV3Kind:
+                case VertexBuffer.UV4Kind:
+                case VertexBuffer.UV5Kind:
+                case VertexBuffer.UV6Kind:
                     this._strideSize = 2;
                     break;
                 case VertexBuffer.ColorKind:
@@ -125,6 +127,10 @@
         private static _NormalKind = "normal";
         private static _UVKind = "uv";
         private static _UV2Kind = "uv2";
+        private static _UV3Kind = "uv3";
+        private static _UV4Kind = "uv4";
+        private static _UV5Kind = "uv5";
+        private static _UV6Kind = "uv6";
         private static _ColorKind = "color";
         private static _MatricesIndicesKind = "matricesIndices";
         private static _MatricesWeightsKind = "matricesWeights";
@@ -145,6 +151,22 @@
             return VertexBuffer._UV2Kind;
         }
 
+        public static get UV3Kind(): string {
+            return VertexBuffer._UV3Kind;
+        }
+
+        public static get UV4Kind(): string {
+            return VertexBuffer._UV4Kind;
+        }
+
+        public static get UV5Kind(): string {
+            return VertexBuffer._UV5Kind;
+        }
+
+        public static get UV6Kind(): string {
+            return VertexBuffer._UV6Kind;
+        }
+
         public static get ColorKind(): string {
             return VertexBuffer._ColorKind;
         }

+ 12 - 0
src/Tools/babylon.sceneSerializer.js

@@ -424,6 +424,18 @@ var BABYLON;
         if (vertexData.isVerticesDataPresent(BABYLON.VertexBuffer.UV2Kind)) {
             serializationObject.uvs2 = vertexData.getVerticesData(BABYLON.VertexBuffer.UV2Kind);
         }
+        if (vertexData.isVerticesDataPresent(BABYLON.VertexBuffer.UV3Kind)) {
+            serializationObject.uvs3 = vertexData.getVerticesData(BABYLON.VertexBuffer.UV3Kind);
+        }
+        if (vertexData.isVerticesDataPresent(BABYLON.VertexBuffer.UV4Kind)) {
+            serializationObject.uvs4 = vertexData.getVerticesData(BABYLON.VertexBuffer.UV4Kind);
+        }
+        if (vertexData.isVerticesDataPresent(BABYLON.VertexBuffer.UV5Kind)) {
+            serializationObject.uvs5 = vertexData.getVerticesData(BABYLON.VertexBuffer.UV5Kind);
+        }
+        if (vertexData.isVerticesDataPresent(BABYLON.VertexBuffer.UV6Kind)) {
+            serializationObject.uvs6 = vertexData.getVerticesData(BABYLON.VertexBuffer.UV6Kind);
+        }
         if (vertexData.isVerticesDataPresent(BABYLON.VertexBuffer.ColorKind)) {
             serializationObject.colors = vertexData.getVerticesData(BABYLON.VertexBuffer.ColorKind);
         }

+ 16 - 0
src/Tools/babylon.sceneSerializer.ts

@@ -511,6 +511,22 @@
             serializationObject.uvs2 = vertexData.getVerticesData(VertexBuffer.UV2Kind);
         }
 
+        if (vertexData.isVerticesDataPresent(VertexBuffer.UV3Kind)) {
+            serializationObject.uvs3 = vertexData.getVerticesData(VertexBuffer.UV3Kind);
+        }
+
+        if (vertexData.isVerticesDataPresent(VertexBuffer.UV4Kind)) {
+            serializationObject.uvs4 = vertexData.getVerticesData(VertexBuffer.UV4Kind);
+        }
+
+        if (vertexData.isVerticesDataPresent(VertexBuffer.UV5Kind)) {
+            serializationObject.uvs5 = vertexData.getVerticesData(VertexBuffer.UV5Kind);
+        }
+
+        if (vertexData.isVerticesDataPresent(VertexBuffer.UV6Kind)) {
+            serializationObject.uvs6 = vertexData.getVerticesData(VertexBuffer.UV6Kind);
+        }
+
         if (vertexData.isVerticesDataPresent(VertexBuffer.ColorKind)) {
             serializationObject.colors = vertexData.getVerticesData(VertexBuffer.ColorKind);
         }