@infra7/glsl
v1.0.9
Published
Useful tools for GLSL.
Downloads
2
Maintainers
Readme
@infra7/glsl
Useful tools for GLSL.
Example
Installation
$ npm i -S @infra7/glsl
API
ExtractParams(source: string): ExtractResult;
import { ExtractParams } from '.';
const source = `
precision highp float;
attribute vec2 aPosition;
attribute vec4 aColor;
varying vec4 vColor;
uniform mat3 uViewMatrix;
uniform mat3 uLocalMatrix;
void main() {
vColor = aColor;
vec3 coord = uViewMatrix * uLocalMatrix * vec3(aPosition, 1.0);
gl_Position = vec4(coord.xy, 0.0, 1.0);
}
`;
const result = ExtractParams(source);