Open deathcap opened 8 years ago
Reproduced with isolated voxel-example: https://github.com/deathcap/voxel-example/tree/5e8ed535f8418e816001c8f14d4f3dcb858360aa
previously was using cwise 1.0.4 circa 2014, https://github.com/scijs/cwise/commits/master - https://github.com/scijs/cwise#notes documents "All input arrays must have the same shape. If not, then the library will throw an error". Exception is thrown in generated code: https://github.com/scijs/cwise-compiler/blob/master/lib/thunk.js#L61
code.push("if (!(" + shapeConditions.join(" && ") + ")) throw new Error('cwise: Arrays do not all have the same shape!')")
this is a recent message, changed in https://github.com/scijs/cwise-compiler/commit/8f881ce54182581f88ffc30a4a9a6dd8b098a00d from "Generic arrays not supported in combination with blocks" which was added Jun 20th 2015 in https://github.com/scijs/cwise-compiler/commit/77fc9256152d2e95203437d5849501c9f5bcafc9 "Implemented array shape equality test.". Using cwise-compiler 1.0.0, also 1.1.0 does not have this check, but 1.1.2 does.
Pinning cwise-compiler to 1.0.0 (package.json: "cwise-compiler": "1.0.0" — instead of "^1.0.0") gets past this error, but then the same problem occurs in ops.assign() in voxel-mesher splitVoxelArray(). ndarray-ops 1.2.2, but then ndarray-fill 1.0.1 depends on cwise-compiler, rolling back to ^0.1.0 hits the esprima-six unpublishing issue (https://github.com/deathcap/voxelmetaverse/issues/60)
--- a/package.json
+++ b/package.json
@@ -8,18 +8,18 @@
},
"dependencies": {
"block-models": "^0.1.0",
- "cwise-compiler": "^1.0.0",
+ "cwise-compiler": "1.0.0",
"gl-buffer": "^2.0.8",
"gl-mat4": "^1.1.2",
"gl-vao": "^1.1.3",
"greedy-mesher": "^1.0.2",
"inherits": "^2.0.1",
"ndarray": "^1.0.15",
- "ndarray-ops": "^1.2.2",
+ "ndarray-ops": "1.2.2",
"typedarray-pool": "^1.0.2"
},
"devDependencies": {
- "ndarray-fill": "^1.0.1",
+ "ndarray-fill": "1.0.1",
"ndarray-segment": "0.0.0",
"tap": "^0.6.0",
"voxel": "^0.5.0"
cwise-compiler 1.1.0 is compatible, sticking on it for now (voxel-mesher 0.14.3 bugfix release), but may want to revisit to upgrade to a newer version. The problem is voxel-mesher relies on unequal array sizes in order to add padding between the chunks, maybe could instead use .subarray() to get an equally-sized ndarray before passing to cwise. @jaspervdg any possibility the check added in https://github.com/scijs/cwise-compiler/commit/77fc9256152d2e95203437d5849501c9f5bcafc9 could be made optional?
on vmv with dev versions of voxel-decals, voxel-engine-stackgl, voxel-webview.
ao0, ao1, ao2 are all
Int32Array[39304]
(34^3 = 39304, chunk size 32x32x32 + 2 for padding) butarray
isUint16Array[46656]
(36^3 = 46656), passed in from: