roundedBox function
Signed distance in px from a rounded box, negative inside: `point` from the box centre, `half` its half size, `radius` its corners.
import { roundedBox } from '@dioramajs/diorama/kit'. clamp(0.5 - d, 0, 1) is a 1 px antialiased mask.
function roundedBox(
point: Node<'vec2'>,
half: Node<'vec2'>,
radius: number | Node<'float'>,
): Node<'float'>Parameters
| Name | Type | Description |
|---|---|---|
point | Node<'vec2'> | |
half | Node<'vec2'> | |
radius | number | Node<'float'> |
Also exported from @dioramajs/effects/kit.
Defined in packages/effects/src/kit.ts.