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
| Param | Type | Default | Description |
|---|---|---|---|
threshold | number | 0.5 | Dissolve threshold (0 = solid, 1 = invisible) |
edgeWidth | number | 0.05 | Edge glow width |
edgeColor | [r,g,b] | [1,0.5,0] | Edge glow color |