Fixed ordered dithering offset

This commit is contained in:
Lucas Dower 2021-11-19 21:46:02 +00:00
parent 31f9a93bb1
commit d310cc6b20

View File

@ -16,7 +16,7 @@ export class OrderedDitheringBlockAssigner implements BlockAssigner {
/** 4x4x4 */
private static _size = 4;
private static _threshold = 256/4;
private static _threshold = 256 / 8;
private static _mapMatrix = [
0, 16, 2, 18, 48, 32, 50, 34,
@ -34,7 +34,7 @@ export class OrderedDitheringBlockAssigner implements BlockAssigner {
assert(0 <= x && x < size && 0 <= y && y < size && 0 <= z && z < size)
const index = (x + (size * y) + (size * size * z));
assert(0 <= index && index < size * size * size);
return OrderedDitheringBlockAssigner._mapMatrix[index] / (size * size * size);
return (OrderedDitheringBlockAssigner._mapMatrix[index] / (size * size * size)) - 0.5;
}
assignBlock(voxelColour: RGB, voxelPosition: Vector3): BlockInfo {