Skip to content

fresnelEffect

使用 TSL(Three Shading Language)实现的菲涅尔效果,物体边缘随视角产生发光效果。

用法

ts
import { createFresnelMaterial } from '@threeuse/effects'
import { Mesh, SphereGeometry } from 'three'

const material = createFresnelMaterial({
  power: 2.5,
  color: 0x88CCFF,
  intensity: 1.5,
})

const mesh = new Mesh(new SphereGeometry(1, 32, 32), material)
app.scene.add(mesh)

参数

参数类型默认值说明
powernumber2.0菲涅尔指数,越大边缘越细
colorstring | number0x88ccff发光颜色
intensitynumber1.0发光强度

Demo

Released under the MIT License.