Skip to content

Releases: CodyJasonBennett/shaderkit

v0.7.0

09 Oct 12:51

Choose a tag to compare

What's Changed

Full Changelog: v0.6.4...v0.7.0

v0.6.4

09 Oct 06:09

Choose a tag to compare

What's Changed

Full Changelog: v0.6.3...v0.6.4

v0.6.3

04 Oct 22:44

Choose a tag to compare

What's Changed

Full Changelog: v0.6.2...v0.6.3

v0.6.2

02 Oct 13:22

Choose a tag to compare

What's Changed

Full Changelog: v0.6.1...v0.6.2

v0.6.1

02 Sep 10:47

Choose a tag to compare

What's Changed

Full Changelog: v0.6.0...v0.6.1

v0.6.0

25 Aug 14:33

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.5.0...v0.6.0

v0.5.0

16 Feb 12:11

Choose a tag to compare

What's Changed

Full Changelog: v0.4.1...v0.5.0

v0.4.1

13 Feb 23:51

Choose a tag to compare

What's Changed

Full Changelog: v0.4.0...v0.4.1

v0.4.0

13 Feb 11:28

Choose a tag to compare

What's Changed

This release follows up v0.3.0 with a visitor API to recurse AST. Useful for reflecting or modifying a shader program.

import { type Program, parse, visit, generate } from 'shaderkit'

// https://github.com/CodyJasonBennett/shaderkit#ast
const program: Program = parse(glsl)

// optionally reflect program here (e.g. collect all global uniforms)
const uniforms: string[] = []
visit(program, {
  VariableDeclarator(node) {
    if (node.qualifiers.includes('uniform')) {
      uniforms.push(node.id.name)
    }
  },
})

// optionally modify program here (e.g. remove version header)
visit(program, {
  PreprocessorStatement(node, ancestors) {
    const parent = ancestors.at(-1)
    if (node.name === 'version' && parent?.type === 'Program') {
      parent.body.splice(parent.body.indexOf(node), 1)
    }
  },
})

// Compile back into GLSL
const output: string = generate(program, { target: 'GLSL' })

Full Changelog: v0.3.1...v0.4.0

v0.3.1

13 Feb 05:22

Choose a tag to compare

What's Changed

Full Changelog: v0.3.0...v0.3.1