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

@dioramajs/effects/effect

effect() and defineEffect() without the rest of the effects package.

View as Markdown
On this page
import { CSS_COLOR, defineEffect, effect } from '@dioramajs/effects/effect'

Functions

defineEffectChecks a definition and returns it as a frozen callable. Registers and loads nothing. Throws `EFFECT_DEFINITION` on a bad definition.
effectShort form of `defineEffect`: defaults, optional options, setup. An unnamed effect takes its registry key (the file name when a build plugin finds it).
isParamDefaultWhether `defineEffect` accepts this as a param default.
oneOfString param limited to these values, the first one the default. The same as `oneOf` of the light entry, for effect modules, which must not import it.
problemsWhat is wrong with a definition, empty when nothing is.

Constants

CSS_COLORColour strings three can parse. In `effect()` a string default that matches becomes a colour param. Keep in sync with `IsCssColor` so '#gallery' stays a string in types and at runtime.
INPUTSThe input uniforms of `ctx.u`.

Types

ColorsInThe spec as setup sees it, with colour strings turned into colour params.
IsCssColorTrue for '#rgb', '#rgba', '#rrggbb', '#rrggbbaa' and rgb()/hsl() strings.