Three Vue3Three Vue3
Guide
Demo
AI Agents
  • English
  • 简体中文
GitHub
Guide
Demo
AI Agents
  • English
  • 简体中文
GitHub
    • Getting Started
    • Scene
    • Parameter Bus
    • SkyBox
    • Model Loader

      • Component Loader
      • Function Loader
    • Popup
    • Callout
    • Movable Element
    • Animation
    • Model Rotator
    • Picker
    • Fit Camera
    • Mesh

      • Wave Circle Mesh
      • Flow Line Mesh
    • Effect

      • Nature

        • Rain
        • Snow
        • Water
        • Water Pool
        • Sandy Beach
      • Sky & Atmosphere

        • Sky Dome
        • HeightFog
        • Nebula Galaxy
      • Light

        • Bloom
          • Default Usage
          • Props
        • Sweep Light
        • Light Gradient
        • Light Pillar
        • Radar Sweep
        • Signal Wave
        • Force Shield
      • Particles & Sprites

        • Fireworks
        • Text Fireworks
        • Glow Sprite
    • GIS

      • Geographic Reference
      • GeoObject
      • GeoJsonLayer
      • Tile Layer

type

Component

<tv-bloom> blooms the objects on the selected camera layer. It renders on WebGPURenderer (the default) and on a classic WebGLRenderer through WebGLNodesHandler; add renderer-type="webgl" to <tv-scene> to compare the two backends.

Default Usage

Click me to view the codes
<template>
  <tv-scene class="scene" bg-color="rgb(40, 42, 54)" @created="created">
    <tv-bloom :layer="1" :strength="2" :radius="1" :threshold="0" />
  </tv-scene>
</template>

<script lang="ts" setup>
import * as THREE from 'three'

const created = (scene, { camera }) => {
  camera.position.set(0, 1.5, 3)

  const geometry = new THREE.BoxGeometry()

  // Left: glowing cube on layer 1, so the bloom pass picks it up.
  const cube0 = new THREE.Mesh(geometry, new THREE.MeshBasicMaterial({ color: 0xff5500 }))
  cube0.position.set(-0.5, 0, 0)
  cube0.layers.set(1)
  scene.add(cube0)

  // Right: the same cube on layer 0, without bloom, for comparison.
  const cube1 = new THREE.Mesh(geometry, new THREE.MeshBasicMaterial({ color: 0xff5500 }))
  cube1.position.set(0.5, 0, 0)
  cube1.layers.set(0)
  scene.add(cube1)
}
</script>

<style>
.scene {
  margin-top: 10px;
  margin-bottom: 16px;
  width: 100%;
  height: 300px;
}
</style>

Props

NameTypeDefaultDescription
layernumber0optional The layer of the bloom effect.
strengthnumber1optional The strength of the bloom effect.
radiusnumber0.5optional The radius of the bloom effect.
thresholdnumber0.5optional The threshold of the bloom effect.
Edit this page on GitHub
Last Updated:
Contributors: Shing Rui
Next
Sweep Light