Skip to content

Commit

Permalink
🎈 perf: Remove depth test parameter of material
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangechen committed Jan 27, 2024
1 parent 20e42d9 commit 57be6b6
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions packages/chili-three/src/threeShape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
AlwaysDepth,
BufferGeometry,
DoubleSide,
EqualDepth,
Float32BufferAttribute,
LineBasicMaterial,
LineSegments,
Expand All @@ -41,19 +42,13 @@ const highlightFaceMaterial = new MeshStandardMaterial({
side: DoubleSide,
transparent: true,
opacity: 0.85,
depthFunc: AlwaysDepth,
polygonOffsetFactor: 0,
polygonOffsetUnits: 1.0,
});

const selectedFaceMaterial = new MeshStandardMaterial({
color: ThreeHelper.fromColor(Config.instance.visual.selectedFaceColor),
side: DoubleSide,
transparent: true,
opacity: 0.32,
depthFunc: AlwaysDepth,
polygonOffsetFactor: 0,
polygonOffsetUnits: 1.0,
});

export class ThreeShape extends Object3D implements IVisualShape {
Expand All @@ -63,9 +58,6 @@ export class ThreeShape extends Object3D implements IVisualShape {
private _faceMaterial = new MeshStandardMaterial({
side: DoubleSide,
transparent: true,
depthFunc: AlwaysDepth,
polygonOffsetFactor: 0,
polygonOffsetUnits: 1.0,
});
private _edgeMaterial = new LineBasicMaterial();
private _edges?: LineSegments;
Expand Down

0 comments on commit 57be6b6

Please sign in to comment.