for (let i = 0; i < 500; i++) {
const x = Math.floor(Math.random() * 32 * 16);
const y = Math.floor(Math.random() * 32 * 16);
const z = Math.floor(Math.random() * 32 * 16);
chunks.set(x, y, z, 3);
solverR.add(x, y, z, 15);
}
for (let i = 0; i < 10000000; i++) {
const x = Math.floor(Math.random() * 32 * 16);
const y = Math.floor(Math.random() * 32 * 16);
const z = Math.floor(Math.random() * 32 * 16);
if (chunks.get(x, y, z) === 0 && chunks.get(x, y - 1, z) === 1) {
chunks.set(x, y, z, 4);
}
}
for (let z = 0; z < chunks.h * CD; z++) {
for (let x = 0; x < chunks.w * CW; x++) {
for (let y = CH - 1; y >= 0; y--) {
const voxel = chunks.get(x, y, z);
if (!bricks[voxel].lightInside) {
if (y + 1 < CH) {
solverS.add(x, y + 1, z, 15);
}
break;
}
solverS.add(x, y + 1, z, 15);
}
}
solverS.solve();
console.log('day-light: ', z, ' of ', chunks.h * CD, '(' + Math.ceil(z / (chunks.h * CD) * 100.0) + '%)');
}
solverR.solve();
function init_lighting() {
}