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

EFFECT_OVERRIDE

Package @dioramajs/diorama/core Level warning

An effect of your site has the name of a built-in one, so it replaces the built-in everywhere on the page.

View as Markdown
On this page
EFFECT_OVERRIDE: {source} replaces the built-in effect "{name}"; rename yours or mark it override: true

This warning prints in development builds only, once per name, when start() runs. A production build says nothing.

Why it happens

Your effects win over the built-in ones: an effect with the name of a built-in replaces it for every element with that token. That is allowed, but it also happens by accident, since new versions of Diorama add built-in effects. The source in the message names where yours comes from:

  • the effects folder: a file such as src/effects/glow.ts (app/effects/ with Nuxt) whose name is the name of a built-in effect.
  • start({ effects }): an entry with a loader or an effect under a built-in name, such as start({ effects: { glow: () => import('./glow') } }).

A patch never raises it. start({ effects: { ripple: { when: 'all' } } }) changes the built-in ripple and keeps its code.

How to fix

If you did not mean to replace the built-in, rename your effect. Rename the file, or the key in start():

src/effects/soft-glow.ts
import { effect } from '@dioramajs/diorama'
export default effect({ strength: 1 }, ({ surface, u }) => {
surface.color((c) => c.mul(u.strength.add(1)))
})

and the token in your markup:

<img src="/img/cover.avif" data-dio="soft-glow" />

If you meant it, mark the replacement as intended. In a file of the effects folder, export override:

src/effects/glow.ts
import { effect } from '@dioramajs/diorama'
export const override = true
export default effect({ strength: 1 }, ({ surface, u }) => {
surface.color((c) => c.mul(u.strength.add(1)))
})

In start(), add override: true to the entry:

import { start } from '@dioramajs/diorama'
export const app = start({
effects: {
glow: { load: () => import('./effects/glow'), override: true },
},
})

A GLSL file in the effects folder cannot export anything, so mark it from start() with a patch: start({ effects: { glow: { override: true } } }).