Plugins
save
The save plugin adds a save() method to a ShaderPad instance.
import ShaderPad from 'shaderpad'
import save, { WithSave } from 'shaderpad/plugins/save'
const shader = new ShaderPad(fragmentShaderSrc, {
canvas,
plugins: [save()],
}) as WithSave<ShaderPad>
Method Signature
save(filename?: string, text?: string, options?: {
preventShare?: boolean
}): Promise<void>
filenamedefaults toexport.pngtextadds a message alongside the image file when using the Web Share API on mobilepreventShareforces download behavior on mobile instead of using the Web Share API