Skip to content

Commit

Permalink
Fix #188. Only disable legacy lights for Three < 155.
Browse files Browse the repository at this point in the history
  • Loading branch information
vasturiano committed Mar 27, 2024
1 parent fb73fdb commit 940939b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/globe.js
Original file line number Diff line number Diff line change
@@ -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
};
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 940939b

Please sign in to comment.