mirror of
https://github.com/LucasDower/ObjToSchematic.git
synced 2025-03-07 14:06:41 +08:00
Fixed ordered dithering offset
This commit is contained in:
parent
31f9a93bb1
commit
d310cc6b20
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user