From 56315924175153467db9e78961d81440d04a34ee Mon Sep 17 00:00:00 2001 From: Lucas Dower Date: Thu, 6 Oct 2022 17:41:28 +0100 Subject: [PATCH] Multisampling now only applies to textured materials --- src/voxelisers/normal-corrected-ray-voxeliser.ts | 4 ++-- src/voxelisers/ray-voxeliser.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/voxelisers/normal-corrected-ray-voxeliser.ts b/src/voxelisers/normal-corrected-ray-voxeliser.ts index e97648b..139eccb 100644 --- a/src/voxelisers/normal-corrected-ray-voxeliser.ts +++ b/src/voxelisers/normal-corrected-ray-voxeliser.ts @@ -1,7 +1,7 @@ import { Bounds } from '../bounds'; import { RGBA, RGBAUtil } from '../colour'; import { AppConfig } from '../config'; -import { Mesh } from '../mesh'; +import { MaterialType, Mesh } from '../mesh'; import { ProgressManager } from '../progress'; import { Axes, Ray, rayIntersectTriangle } from '../ray'; import { Triangle, UVTriangle } from '../triangle'; @@ -86,7 +86,7 @@ export class NormalCorrectedRayVoxeliser extends IVoxeliser { voxelPosition.round(); let voxelColour: RGBA; - if (this._voxeliseParams!.useMultisampleColouring) { + if (this._voxeliseParams!.useMultisampleColouring && this._mesh!.getMaterialByName(materialName).type === MaterialType.textured) { const samples: RGBA[] = []; for (let i = 0; i < AppConfig.Get.MULTISAMPLE_COUNT; ++i) { const samplePosition = Vector3.add(voxelPosition, Vector3.random().add(-0.5)); diff --git a/src/voxelisers/ray-voxeliser.ts b/src/voxelisers/ray-voxeliser.ts index 352cbf2..40c9545 100644 --- a/src/voxelisers/ray-voxeliser.ts +++ b/src/voxelisers/ray-voxeliser.ts @@ -1,7 +1,7 @@ import { Bounds } from '../bounds'; import { RGBA, RGBAUtil } from '../colour'; import { AppConfig } from '../config'; -import { Mesh } from '../mesh'; +import { MaterialType, Mesh } from '../mesh'; import { ProgressManager } from '../progress'; import { Axes, Ray, rayIntersectTriangle } from '../ray'; import { Triangle, UVTriangle } from '../triangle'; @@ -68,7 +68,7 @@ export class RayVoxeliser extends IVoxeliser { } let voxelColour: RGBA; - if (this._voxeliseParams!.useMultisampleColouring) { + if (this._voxeliseParams!.useMultisampleColouring && this._mesh!.getMaterialByName(materialName).type === MaterialType.textured) { const samples: RGBA[] = []; for (let i = 0; i < AppConfig.Get.MULTISAMPLE_COUNT; ++i) { const samplePosition = Vector3.add(voxelPosition, Vector3.random().add(-0.5));