Bloom

Add a glow around the bright areas of the scene.

Bloom adds a blurred copy of the bright areas of the scene to the image. It wraps three's BloomNode.

It is an HDR effect. It runs on linear scene colors, before tone mapping, so colors above 1 (such as an emissiveIntensity above 1) glow more.

On a canvas with alpha, the glow adds to the color but not to the alpha. Do not rely on the glow over a transparent pixel: three r186 and newer hide it, and with older versions the result depends on the browser.

Usage

<script setup lang="ts">
import { TresCanvas } from '@tresjs/core/webgpu'
import { Bloom, EffectComposer } from '@tresjs/post-processing/webgpu'
</script>

<template>
  <TresCanvas>
    <!-- Your scene -->

    <EffectComposer>
      <Bloom :strength="1" :radius="0.4" :threshold="0.8" />
    </EffectComposer>
  </TresCanvas>
</template>

Props

PropDescriptionDefault
strengthThe strength of the glow.1
radiusHow far the glow spreads. Range is 0, 1.0
thresholdThe luminance above which a pixel glows. 0 makes every pixel glow.0
smoothWidthThe width of the soft transition above threshold. Higher values fade the glow in more gradually. Keep it above 0.0.01

Differences from BloomPmndrs

Bloom exposes the parameters of three's bloom() function and the smoothWidth uniform of BloomNode. Some BloomPmndrs props have no counterpart, because BloomNode uses fixed values for them.

BloomPmndrsBloom
intensitystrength
luminanceThresholdthreshold
radiusradius. Always active, because BloomNode always blurs with mipmaps.
mipmapBlurNot available. BloomNode always blurs 5 mip levels.
kernelSizeNot available. BloomNode uses fixed kernel sizes (6, 10, 14, 18 and 22) for its 5 mip levels.
luminanceSmoothingsmoothWidth. Same role, with the BloomNode default of 0.01 instead of 0.025.
blendFunctionNot available. The WebGPU family has no blend functions. See Blending.

Further Reading

See the three.js example.