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

shaderNode function

The fragment shader as a vec4 node for a custom material.

View as Markdown
import { shaderNode } from '@dioramajs/diorama/glsl'

The element's image is texture(map, coverUV(uv)) times the box mask.

function shaderNode<P extends ParamSpec>(
  ctx: EffectContext<P>,
  shader: GlslShader,
  options?: ApplyOptions & { readonly uv?: Node<'vec2'> },
): Node<'vec4'>

Parameters

NameTypeDescription
ctxEffectContext<P>
shaderGlslShader
options?ApplyOptions & { readonly uv?: Node<'vec2'> }

Default {}.

  • Throws EFFECT_SETUP when a shader uniform is bound to a missing param.

Also exported from @dioramajs/glsl.

Defined in packages/glsl/src/runtime.ts.