diff --git a/src/components/plots/AnalysisWG.tsx b/src/components/plots/AnalysisWG.tsx index 6f6f0de6..dd19f416 100644 --- a/src/components/plots/AnalysisWG.tsx +++ b/src/components/plots/AnalysisWG.tsx @@ -224,7 +224,6 @@ const AnalysisWG = ({ setTexture, }: { setTexture: React.Dispatch new THREE.IcosahedronGeometry(1, sphereResolution), [sphereResolution]); const shaderMaterial = useMemo(()=>{ const shader = new THREE.ShaderMaterial({ @@ -140,8 +141,12 @@ export const Sphere = ({textures} : {textures: THREE.Data3DTexture[] | THREE.Dat return shader },[isFlat, textures, borderTexture]) - const backMaterial = shaderMaterial.clone() - backMaterial.side = THREE.BackSide; + const backMaterial = useMemo(()=>{ + const mat = shaderMaterial.clone() + mat.side = THREE.BackSide; + return mat; + },[shaderMaterial]) + useEffect(()=>{ if (shaderMaterial){ const uniforms = shaderMaterial.uniforms;