Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

roundedBox function

Signed distance in px from a rounded box, negative inside: `point` from the box centre, `half` its half size, `radius` its corners.

View as Markdown
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

NameTypeDescription
pointNode<'vec2'>
halfNode<'vec2'>
radiusnumber | Node<'float'>

Also exported from @dioramajs/effects/kit.

Defined in packages/effects/src/kit.ts.