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

GLSL_PRAGMA

Package @dioramajs/diorama/glsl Level error

A `// @diorama` line in a shader sets `when`, `reducedMotion` or `presence` to a value the effect cannot take, so the conversion fails.

View as Markdown
On this page
GLSL_PRAGMA: `{key}={value}` is not a valid value

The converter reports this at build time, with the file, the line and the values it accepts. The shader does not convert, so the effect is not built.

Why it happens

  • reducedMotion is something other than static or off.
  • presence is something other than fade or custom.
  • when is empty, for example when= or when="".

How to fix

Use one of the listed values. Put a media query with spaces in quotes: the line splits at spaces, so an unquoted when=(min-width: 768px) does not fail but reads as when=(min-width:, a query that never matches.

// @diorama when=hover reducedMotion=off presence=custom
// @diorama when="(min-width: 768px)"

A glue file sets the same options in TypeScript, where the type check catches a bad value before the build.

import { glslEffect } from '@dioramajs/glsl'
import shader from './wave.frag?shader'
export default glslEffect(shader, {
when: '(min-width: 768px)',
reducedMotion: 'off',
})