From 455fa76e7dff44f9b1d6092359336c49c8954182 Mon Sep 17 00:00:00 2001 From: xiange Date: Sat, 27 Jan 2024 21:52:33 +0800 Subject: [PATCH] perf: set hilighlight offset --- packages/chili-three/src/threeShape.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/chili-three/src/threeShape.ts b/packages/chili-three/src/threeShape.ts index d1ef02f8..8e27a87b 100644 --- a/packages/chili-three/src/threeShape.ts +++ b/packages/chili-three/src/threeShape.ts @@ -13,10 +13,8 @@ import { VisualState, } from "chili-core"; import { - AlwaysDepth, BufferGeometry, DoubleSide, - EqualDepth, Float32BufferAttribute, LineBasicMaterial, LineSegments, @@ -31,10 +29,16 @@ import { ThreeHelper } from "./threeHelper"; const hilightEdgeMaterial = new LineBasicMaterial({ color: ThreeHelper.fromColor(Config.instance.visual.highlightEdgeColor), + polygonOffset: true, + polygonOffsetFactor: -1, + polygonOffsetUnits: -1, }); const selectedEdgeMaterial = new LineBasicMaterial({ color: ThreeHelper.fromColor(Config.instance.visual.selectedEdgeColor), + polygonOffset: true, + polygonOffsetFactor: -1, + polygonOffsetUnits: -1, }); const highlightFaceMaterial = new MeshStandardMaterial({