Pixelエフェクトを追加します。
ピクセルサイズ、法線エッジの強さ、深度エッジの強さを設定できます。
戻り値は、pixel のみのオブジェクトです。
戻り値の pixel は、animate の中で呼び出すことでエフェクトを適用します。
animate の第2引数を false にしてください。
const { camera, create, animate, postprocessing } = init()
camera.position.set(0, 0, 2)
create.ambientLight()
create.directionalLight()
const cube = create.cube()
const { pixel } = postprocessing.pixel()
animate(({ delta }) => {
cube.rotation.x += delta
cube.rotation.y += delta
pixel()
}, false)
const { camera, create, animate, postprocessing } = init()
camera.position.set(0, 0, 2)
create.ambientLight()
create.directionalLight()
const cube = create.cube()
const { pixel } = postprocessing.pixel()
animate(({ delta, time }) => {
cube.rotation.x += delta
cube.rotation.y += delta
pixel({
size: ~~(6 + 5 * Math.sin(time))
})
}, false)