Multisampling now only applies to textured materials

This commit is contained in:
Lucas Dower 2022-10-06 17:41:28 +01:00
parent 66fbe417cc
commit 5631592417
2 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
import { Bounds } from '../bounds'; import { Bounds } from '../bounds';
import { RGBA, RGBAUtil } from '../colour'; import { RGBA, RGBAUtil } from '../colour';
import { AppConfig } from '../config'; import { AppConfig } from '../config';
import { Mesh } from '../mesh'; import { MaterialType, Mesh } from '../mesh';
import { ProgressManager } from '../progress'; import { ProgressManager } from '../progress';
import { Axes, Ray, rayIntersectTriangle } from '../ray'; import { Axes, Ray, rayIntersectTriangle } from '../ray';
import { Triangle, UVTriangle } from '../triangle'; import { Triangle, UVTriangle } from '../triangle';
@ -86,7 +86,7 @@ export class NormalCorrectedRayVoxeliser extends IVoxeliser {
voxelPosition.round(); voxelPosition.round();
let voxelColour: RGBA; let voxelColour: RGBA;
if (this._voxeliseParams!.useMultisampleColouring) { if (this._voxeliseParams!.useMultisampleColouring && this._mesh!.getMaterialByName(materialName).type === MaterialType.textured) {
const samples: RGBA[] = []; const samples: RGBA[] = [];
for (let i = 0; i < AppConfig.Get.MULTISAMPLE_COUNT; ++i) { for (let i = 0; i < AppConfig.Get.MULTISAMPLE_COUNT; ++i) {
const samplePosition = Vector3.add(voxelPosition, Vector3.random().add(-0.5)); const samplePosition = Vector3.add(voxelPosition, Vector3.random().add(-0.5));

View File

@ -1,7 +1,7 @@
import { Bounds } from '../bounds'; import { Bounds } from '../bounds';
import { RGBA, RGBAUtil } from '../colour'; import { RGBA, RGBAUtil } from '../colour';
import { AppConfig } from '../config'; import { AppConfig } from '../config';
import { Mesh } from '../mesh'; import { MaterialType, Mesh } from '../mesh';
import { ProgressManager } from '../progress'; import { ProgressManager } from '../progress';
import { Axes, Ray, rayIntersectTriangle } from '../ray'; import { Axes, Ray, rayIntersectTriangle } from '../ray';
import { Triangle, UVTriangle } from '../triangle'; import { Triangle, UVTriangle } from '../triangle';
@ -68,7 +68,7 @@ export class RayVoxeliser extends IVoxeliser {
} }
let voxelColour: RGBA; let voxelColour: RGBA;
if (this._voxeliseParams!.useMultisampleColouring) { if (this._voxeliseParams!.useMultisampleColouring && this._mesh!.getMaterialByName(materialName).type === MaterialType.textured) {
const samples: RGBA[] = []; const samples: RGBA[] = [];
for (let i = 0; i < AppConfig.Get.MULTISAMPLE_COUNT; ++i) { for (let i = 0; i < AppConfig.Get.MULTISAMPLE_COUNT; ++i) {
const samplePosition = Vector3.add(voxelPosition, Vector3.random().add(-0.5)); const samplePosition = Vector3.add(voxelPosition, Vector3.random().add(-0.5));