Skip to content

dissolveEffect

Noise-based dissolve transition written with TSL. Supports dynamic threshold control.

Usage

ts
import { createDissolveMaterial } from '@threeuse/effects'

const material = createDissolveMaterial({
  threshold: 0.0,
  edgeWidth: 0.05,
  edgeColor: [1, 0.4, 0],
})

// Animate threshold in render loop
app.onBeforeRender((delta, elapsed) => {
  material.threshold.value = (Math.sin(elapsed) + 1) / 2
})

Parameters

ParamTypeDefaultDescription
thresholdnumber0.5Dissolve threshold (0 = solid, 1 = invisible)
edgeWidthnumber0.05Edge glow width
edgeColor[r,g,b][1,0.5,0]Edge glow color

Demo

Released under the MIT License.