Three Vue3Three Vue3
Guide
  • English
  • 简体中文
GitHub
Guide
  • English
  • 简体中文
GitHub
    • Getting Started
    • Scene
    • SkyBox
    • Model Loader

      • Component Loader
      • Function Loader
    • Popup
    • Movable Element
    • Animation
    • Mesh

      • Wave Circle Mesh
    • Effect

      • Bloom
        • Default Usage
        • Props

type

Component

Default Usage

Click me to view the codes
<template>
  <tv-scene class="scene" @created="created">
    <tv-bloom :layer="1" />
  </tv-scene>
</template>

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

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

  const geometry = new THREE.BoxGeometry()
  const material = new THREE.MeshLambertMaterial({ color: 0xff5500 })
  const cube0 = new THREE.Mesh(geometry, material)
  cube0.position.set(0.5, 0, 0)
  cube0.layers.set(0)
  // Load cube to scene.
  scene.add(cube0)

  const cube1 = new THREE.Mesh(geometry, material)
  cube1.position.set(-0.5, 0, 0)
  cube1.layers.set(1)
  // Load cube to scene.
  scene.add(cube1)
}
</script>

<style>
.scene {
  margin-top: 10px;
  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, Shing Rui