outlineEffect
Outline effect using the BackSide + scale approach.
Usage
ts
import { createOutlineMaterial } from '@threeuse/effects'
import { BoxGeometry, Group, Mesh, MeshStandardMaterial } from 'three'
const mesh = new Mesh(new BoxGeometry(), new MeshStandardMaterial())
const outlineMesh = new Mesh(mesh.geometry, createOutlineMaterial({
color: 0xFFFFFF,
thickness: 0.03,
}))
outlineMesh.scale.setScalar(1.03)
const group = new Group()
group.add(mesh, outlineMesh)
app.scene.add(group)Parameters
| Param | Type | Default | Description |
|---|---|---|---|
color | string | number | 0x000000 | Outline color |
thickness | number | 0.02 | Outline thickness (scale factor) |