Skip to content
blotter

class · blotter.ts

ShaderMaterial

A Material for a one-off shader: the mainImage string first, everything else second.

extends Material

import { ShaderMaterial } from "blotter.ts";

Nothing more than a convenience constructor over Material. Use it when you have a shader body in hand and do not want to subclass.

import { ShaderMaterial } from "blotter.ts";

const material = new ShaderMaterial(mainImage, {
  uniforms: { uAmount: { type: "1f", value: 0.05 } },
});

Members #

constructor constructor

new ShaderMaterial ( mainImage: string , options?: Omit<MaterialOptions, "mainImage"> )

Takes the GLSL body and an optional MaterialOptions without its mainImage key.

Inherited #

mainImage get / set inherited from Material

shaderMaterial. mainImage : string

uniforms get / set inherited from Material

shaderMaterial. uniforms : UniformInterfaceMap

on method inherited from Material

shaderMaterial. on <K>( event: K , listener: Listener<MaterialEvents[K]> ): () => void

off method inherited from Material

shaderMaterial. off <K>( event: K , listener: Listener<MaterialEvents[K]> ): void

update method inherited from Material

shaderMaterial. update ( ): void