mirror of
https://github.com/LucasDower/ObjToSchematic.git
synced 2024-11-21 01:04:15 +08:00
Fixed voxel colouring
This commit is contained in:
parent
f14c7dafa7
commit
401fc016f4
@ -112,12 +112,12 @@ export class VoxelMesh {
|
||||
if (this._voxelMeshParams.useMultisampleColouring && material.type === MaterialType.textured) {
|
||||
const samples: RGB[] = [];
|
||||
for (let i = 0; i < AppConfig.MULTISAMPLE_COUNT; ++i) {
|
||||
const samplePosition = Vector3.mulScalar(Vector3.add(voxelPosition, Vector3.random().addScalar(-0.5)), this._voxelSize);
|
||||
const samplePosition = Vector3.add(voxelPosition, Vector3.random().addScalar(-0.5));
|
||||
samples.push(this._getVoxelColour(triangle, material, materialName, samplePosition));
|
||||
}
|
||||
voxelColour = RGB.averageFrom(samples);
|
||||
} else {
|
||||
voxelColour = this._getVoxelColour(triangle, material, materialName, Vector3.mulScalar(voxelPosition, this._voxelSize));
|
||||
voxelColour = this._getVoxelColour(triangle, material, materialName, voxelPosition);
|
||||
}
|
||||
this._addVoxel(voxelPosition, voxelColour);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user