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

Fit interface

A texture framed in the element's box like CSS object-fit.

View as Markdown
import type { Fit } from '@dioramajs/diorama/effects'
interface Fit

Members

NameTypeDescription
mask
mask(at?: Node<'vec2'>): Node<'float'>

1 where the texture covers the box, 0 in contain bands, like the media's contain mask.

sample
sample(at?: Node<'vec2'>): Node<'vec4'>

The texture at box UV under the fit, clamped at its edge. Follows set().

set
set(texture: Texture, options?: FitOptions): void

Swaps the texture (the next slide): same uniforms, no recompile.

uv
uv(at?: Node<'vec2'>): Node<'vec2'>

Box UV (y up) to the texture's UV under the fit.

Also exported from @dioramajs/effects.

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