Shaders / Primitives / Image

Image

A picture, one pixel per cell.

Drawn with
GLSL + CPU
Chain
image
Code
@forgeron/shaders: imageMeta, imageGlsl, imageCpu
/01 → What it is
  • Reads the picture's pixels from the page (`data.image`), already sized to the frame; on the GPU, a texture of the same pixels.
  • A preset alone cannot carry the picture: the demos go through `mountDitheredImage`.
  • Both sides: GLSL and CPU, with the same result.
/02 → In the examples
ExampleChain
Imageimage → pixelate → image-dither → palette
/03 → Versions
  • /01 Sourcethe picture, before
  • /02 Heropixel 3 · gain 1.1
  • /03 Brighterpixel 3 · gain 1.5
/04 → Use it
/01 → In a preset, with its defaults
{
  "type": "image"
}
/02 → One side per page
import { imageMeta, imageGlsl, imageCpu } from "@forgeron/shaders";

// imageMeta: description and params schema (validation, the editor)
// imageGlsl: the GPU side, for bindChain then glPipeline
// imageCpu: the CPU side, for bindChain then runCpu
API → Options

No settings.