From 940939b525da1653ff5c73925cc8c5be089ed7e6 Mon Sep 17 00:00:00 2001 From: vasco Date: Wed, 27 Mar 2024 21:21:55 +0000 Subject: [PATCH] Fix #188. Only disable legacy lights for Three < 155. --- src/globe.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/globe.js b/src/globe.js index 896148b4..2d9f52f9 100644 --- a/src/globe.js +++ b/src/globe.js @@ -1,10 +1,10 @@ -import { AmbientLight, DirectionalLight, Vector2 } from 'three'; +import { AmbientLight, DirectionalLight, Vector2, REVISION } from 'three'; import { CSS2DRenderer } from 'three/examples/jsm/renderers/CSS2DRenderer.js'; const THREE = { ...(window.THREE ? window.THREE // Prefer consumption from global THREE, if exists - : { AmbientLight, DirectionalLight, Vector2 } + : { AmbientLight, DirectionalLight, Vector2, REVISION } ), CSS2DRenderer }; @@ -425,7 +425,7 @@ export default Kapsule({ custom: d => d }; - state.renderObjs.renderer().useLegacyLights = false; // force behavior of three < 155 + THREE.REVISION < 155 && (state.renderObjs.renderer().useLegacyLights = false); // force behavior of three < 155 state.renderObjs .hoverOrderComparator((a, b) => { const aObj = getGlobeObj(a);