Skip to main content

shader

The shader component renders WebGL shaders.

Usage

Modular:

import { shader } from "/42/ui/media/shader.js"

const myShader = shader({
src: "/path/to/shader.glsl",
})

Plan:

{
tag: "ui-shader",
src: "/path/to/shader.glsl",
}

Properties

PropertyTypeDescription
srcStringURL to the shader source file
srcdocStringInline shader source
uniformsObjectShader uniform values

Methods

  • setUniform(name, value) - update a shader uniform at runtime