Skip to content

Commit

Permalink
Fix z-fighting artifacts in new camera frustums (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
brentyi authored Nov 12, 2024
1 parent 360a66c commit 0ab92f2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/viser/client/src/ThreeAssets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,8 @@ export const CameraFrustum = React.forwardRef<
/>
{imageTexture && (
<mesh
position={[0.0, 0.0, z]}
// 0.999999 is to avoid z-fighting with the frustum lines.
position={[0.0, 0.0, z * 0.999999]}
rotation={new THREE.Euler(Math.PI, 0.0, 0.0)}
>
<planeGeometry
Expand Down

0 comments on commit 0ab92f2

Please sign in to comment.