@@ -60379,7 +60379,7 @@ var BABYLON;
if (!info.isCompressed && info.isFourCC) {
dataLength = width * height * 4;
var floatArray;
- if (engine.badOS) {
+ if (engine.badOS || (!engine.getCaps().textureHalfFloat && !engine.getCaps().textureFloat)) {
if (bpp === 128) {
floatArray = DDSTools._GetFloatAsUIntRGBAArrayBuffer(width, height, dataOffset, dataLength, arrayBuffer, i);
}
@@ -482,11 +482,11 @@ module BABYLON.GLTF2 {
var values = <Float32Array>data;
switch (semantic) {
case "NORMAL":
- values.forEach((v, i) => values[i] += vertexData.normals[i]);
+ GLTFUtils.ForEach(values, (v, i) => values[i] += vertexData.normals[i]);
babylonMorphTarget.setNormals(values);
break;
case "POSITION":
- values.forEach((v, i) => values[i] += vertexData.positions[i]);
+ GLTFUtils.ForEach(values, (v, i) => values[i] += vertexData.positions[i]);
babylonMorphTarget.setPositions(values);
case "TANGENT":
@@ -29,6 +29,12 @@ module BABYLON.GLTF2 {
return bufferView.buffer;
+ public static ForEach(view: Uint16Array | Uint32Array | Float32Array, func: (nvalue: number, index:number) => void) : void {
+ for (var index = 0; index < view.length; index++) {
+ func(view[index], index);
+ }
+
/**
* Returns the wrap mode of the texture
* @param mode: the mode value