pmndrs / drei

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

Mixing <Environment/> children with HDRI broken #828

Closed ffdead closed 2 years ago

ffdead commented 2 years ago

Problem description:

It used to be possible to blend children of <Environemt> with the HDRI preset/files, seems like this no longer works.

As soon as I pass children to <Environemt> the HDRI disappears.

It was working in @react-three/drei version: 8.16.0

Possibly messed up by d970999e9c1a83c0e2c548cba399bcd354da4a68 ?

Relevant code:

{/* This environment renders its contents into a HDRI environment. */}
<Environment files="42ND_STREET-1024.hdr" frames={1} resolution={2048}>
  {/* Noise background blended with env map */}
  <Sphere args={[1, 64, 64]} scale={[15, 15, 15]}>
    <LayerMaterial side={THREE.BackSide} alpha={0}>
      <Depth colorA="white" colorB="white" alpha={0.7} near={14} far={15} origin={[1, 1, 1]} />
      <Noise colorA="magenta" colorB="magenta" alpha={0.9} colorC="blue" colorD="blue" scale={0.1} mapping="world" type="curl" />
    </LayerMaterial>
  </Sphere>
  {/* Angled screen highlight */}
  <Lightformer intensity={1} rotation-y={Math.PI / 2} rotation-z={Math.PI / -4} position={[-10, 0, -1]} scale={[30, 10, 1]} />
</Environment>
ffdead commented 2 years ago

Nevermind, it seems to work with the latest versions now 👍