react-postprocessing icon indicating copy to clipboard operation
react-postprocessing copied to clipboard

SelectiveBloom allocates huge GPU memory even with empty selection

Open erikdotdesign opened this issue 2 months ago • 0 comments

Using SelectiveBloom causes very large GPU memory usage, even for a small scene. Memory usage can quickly reach multiple gigabytes. State updates appear to multiply the gl texture count.

To Reproduce:

import { useState } from "react";
import { useThree, Canvas } from "@react-three/fiber";
import { EffectComposer, SelectiveBloom } from "@react-three/postprocessing";

const Effects = () => {
  const { gl } = useThree();

  console.log(gl.info.memory.textures);

  return (
    <EffectComposer>
      <SelectiveBloom
        lights={[]}
        selection={[]}
        intensity={1}
        luminanceThreshold={0.8}
        luminanceSmoothing={0.025} />
    </EffectComposer>
  );
};

const SelectiveBloomTest = () => {
  const [count, setCount] = useState(0);

  return (
    <Canvas>
      <ambientLight intensity={2} />
      <mesh onClick={() => setCount(count + 1)}>
        <planeGeometry args={[3, 3, 32, 32]} /> 
        <meshStandardMaterial color="red" />
      </mesh>
      <Effects />
    </Canvas>
  )
};

export default SelectiveBloomTest;

erikdotdesign avatar Oct 28 '25 17:10 erikdotdesign