A GLSL Parser implemented purely in TypeScript type annotations.
In accordance with GLSL ES Specification 1.0.
You can install ts-glsl
in your own project with npm install ts-glsl
.
import { Parse } from 'ts-glsl';
const vertex = `
attribute vec3 position;
varying vec2 uv;
void main() {
gl_Position = vec4(position, 1.0);
uv = position.xy;
}
`
type AST = Parse<typeof vertex>;