pmndrs / drei

🥉 useful helpers for react-three-fiber
https://docs.pmnd.rs/drei
MIT License
8.36k stars 699 forks source link

Upgrading to Latest ThreeJS adds an extra plane like geometry #2015

Open sabinayakc opened 4 months ago

sabinayakc commented 4 months ago
 "@react-three/drei": "9.108.1",
    "@react-three/fiber": "8.16.8",
    "@types/three": "0.166.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-scripts": "5.0.1",
    "three": "0.166.0"

Problem description:

I upgraded to the latest three and I see a weird plane geometry. It happens in other cases as well. image

Relevant code: Update this codesandbox to the latest versions.

https://codesandbox.io/s/57iefg

rndexe commented 3 months ago

I'm assuming this is using <AccumulativeShadows>.

Steps to fix:

  1. Multiply intensity of RandomizedLight by Math.PI if set to 1
  2. Reduce alphaTest on AccumulativeShadows just enough that the plane disappears
sabinayakc commented 1 month ago

Im using helper. How do I fix this ?

 <Stage
        intensity={1}
        preset="rembrandt"
        shadows={{
          type: 'accumulative',
          color: 'skyblue',
          colorBlend: 2,
          opacity: 1
        }}
        adjustCamera={1}
        environment="city"
      >
rndexe commented 1 month ago

try adding intensity: Math.PI to the shadows prop. Like so :

 <Stage
        intensity={1}
        preset="rembrandt"
        shadows={{
          type: 'accumulative',
          color: 'skyblue',
          colorBlend: 2,
          opacity: 1,
          intensity: Math.PI
        }}
        adjustCamera={1}
        environment="city"
      >