import { Behaviour, BloomEffect, serializable, Volume } from "@needle-tools/engine";

export class PostProcessingVolumeController extends Behaviour {
  @serializable(Volume)
  volume?: Volume;

  start(): void {
    if (!this.volume) {
      console.warn("No PostProcessVolume assigned");
      return;
    }

    this.volume.addEffect(
      new BloomEffect({
        intensity: 3,
        luminanceThreshold: 0.2,
      })
    );
  }
}
