Skip to content

fresnelEffect

Fresnel edge-glow material written with Three.js TSL (Three Shading Language).

Usage

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)

Parameters

ParamTypeDefaultDescription
powernumber2.0Fresnel exponent — higher = thinner edge
colorstring | number0x88ccffGlow color
intensitynumber1.0Glow intensity

Demo

Released under the MIT License.