ソースを参照

Addind DXT3 support

David Catuhe 11 年 前
コミット
6e1d064f66

+ 13 - 0
Babylon/Mesh/babylon.mesh.vertexData.js

@@ -20,6 +20,10 @@ var BABYLON = BABYLON || {};
             mesh.setVerticesData(this.uvs, BABYLON.VertexBuffer.UVKind, updatable);
         }
 
+        if (this.colors) {
+            mesh.setVerticesData(this.colors, BABYLON.VertexBuffer.ColorKind, updatable);
+        }
+
         if (this.indices) {
             mesh.setIndices(this.indices);
         }
@@ -94,6 +98,15 @@ var BABYLON = BABYLON || {};
                 this.uvs.push(other.uvs[index]);
             }
         }
+
+        if (other.colors) {
+            if (!this.colors) {
+                this.colors = [];
+            }
+            for (index = 0; index < other.colors.length; index++) {
+                this.colors.push(other.colors[index]);
+            }
+        }
     };
 
     // Statics

+ 5 - 0
Babylon/Tools/babylon.tools.dds.js

@@ -56,6 +56,7 @@ var BABYLON = BABYLON || {};
     }
 
     var FOURCC_DXT1 = FourCCToInt32("DXT1");
+    var FOURCC_DXT3 = FourCCToInt32("DXT3");
     var FOURCC_DXT5 = FourCCToInt32("DXT5");
 
     var headerLengthInt = 31; // The header length in 32 bit ints
@@ -111,6 +112,10 @@ var BABYLON = BABYLON || {};
                 blockBytes = 8;
                 internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT1_EXT;
                 break;
+            case FOURCC_DXT3:
+                blockBytes = 16;
+                internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT3_EXT;
+                break;
             case FOURCC_DXT5:
                 blockBytes = 16;
                 internalFormat = ext.COMPRESSED_RGBA_S3TC_DXT5_EXT;