openvdb icon indicating copy to clipboard operation
openvdb copied to clipboard

Trying to evaluate on r3f, three r153

Open mokargas opened this issue 2 years ago • 3 comments

I'm not sure if I'm using this naively or is a bona-fide issue.

I have the following very basic component

import * as OpenVDB from 'openvdb/three'
export const lights = {
  useAmbientLights: 0b100000, // 1
  usePointLights: 0b010000, // 2
  useDirectionalLights: 0b001000, // 4
  useSpotLights: 0b000100, // 8
  useHemisphereLights: 0b000010, // 16
  useEnvironment: 0b000001 // 32
}
function FogVolume() {
  const fogVolume = new OpenVDB.FogVolume(
    new OpenVDB.CloudVolume({
      height: 0.2,
      density: 0.3
    }),
    {
      resolution: 100,
      progressive: true,
      steps: 100,
      absorbance: 1,
      baseColor: 0x000000,
      lights: lights.useEnvironment | lights.useDirectionalLights,
      densityCutoff: 0
    }
  )
  fogVolume.scale.setScalar(1.0)

  return (
    <group dispose={null}>
      <primitive object={fogVolume} />
    </group>
  )
}

export default FogVolume

It's simply a clone of the cloud volume in the aircraft example. However, this appears to freeze my scene and I recieve a warning (not an error): THREE.Material: '_uniforms' is not a property of THREE.MeshBasicMaterial. I'm using version 0.3.0, along with Three r153 and r3f 8.13.3

Any ideas?

mokargas avatar Jun 24 '23 11:06 mokargas

Going to close this issue. It turns out the bloom post-processing I was using doesn't play nice with the fog volume density.

mokargas avatar Jun 24 '23 22:06 mokargas

It turns out the bloom post-processing I was using doesn't play nice with the fog volume density.

Oh - but that shouldn't be happening. Are you using the pmndrs postprocessing bloom or the default one?

mjurczyk avatar Jun 25 '23 06:06 mjurczyk

@mjurczyk The pmndrs bloom

mokargas avatar Jul 03 '23 09:07 mokargas