-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod3js.js
35 lines (32 loc) · 1.23 KB
/
mod3js.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
console.log('running mod3js.js')
try {
var fs = require('fs')
fs.readFile('./node_modules/itowns/lib/core/view.js', 'utf8', function (err,data) {
if (err) {
return console.log(err);
}
var result = data.replace(
"this._fullSizeDepthBuffer = new Uint8Array(4 * width * height);",
`if (width === 0 || height === 0) { return; }
this._fullSizeDepthBuffer = new Uint8Array(4 * width * height);`);
fs.writeFile('./node_modules/itowns/lib/core/view.js', result, 'utf8', function (err) {
if (err) return console.log(err);
});
});
} catch (ex) {
console.log('Error:', ex)
}
// try {
// var fs = require('fs')
// fs.readFile('./node_modules/three/build/three.module.js', 'utf8', function (err,data) {
// if (err) {
// return console.log(err);
// }
// var result = data.replace("rendererExtensionFragDepth: isWebGL2", 'rendererExtensionFragDepth: false, // isWebGL2');
// fs.writeFile('./node_modules/three/build/three.module.js', result, 'utf8', function (err) {
// if (err) return console.log(err);
// });
// });
// } catch (ex) {
// console.log('Error:', ex)
// }