Browse Source

Gary's fixes for the green chair GLTF, which had no normals and multiple primitives.

Justin Murray 6 years ago
parent
commit
5ae36c7b0e
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/Engine/babylon.nativeEngine.ts

+ 2 - 2
src/Engine/babylon.nativeEngine.ts

@@ -189,7 +189,7 @@
             this._caps.maxVertexUniformVectors = 16;
 
             // Extensions
-            this._caps.standardDerivatives = false;
+            this._caps.standardDerivatives = true;
 
             this._caps.astc = null;
             this._caps.s3tc = null;
@@ -283,7 +283,7 @@
                         if (data) {
                             if (vertexBuffer.type === VertexBuffer.FLOAT && ArrayBuffer.isView(data)) {
                                 if (!buffer._nativeVertexBuffer) {
-                                    const length = vertexBuffer.count * vertexBuffer.getSize();
+                                    const length = vertexBuffer.byteLength / Float32Array.BYTES_PER_ELEMENT;
                                     buffer._nativeVertexBuffer = this._native.createVertexBuffer(new Float32Array(data.buffer, data.byteOffset, length));
                                 }
                                 this._native.bindVertexBuffer(buffer._nativeVertexBuffer, location, vertexBuffer.byteOffset, vertexBuffer.byteStride);