outlineEffect
基于背面外扩(BackSide + scale)方案的描边效果。
用法
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)参数
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
color | string | number | 0x000000 | 描边颜色 |
thickness | number | 0.02 | 描边厚度(scale 值) |