glsl-layer
glsl-layer copied to clipboard
Layer texels on top of each other in the same shader.
glsl-layer
Layer texels on top of each other in the same shader.

Installation :package:
npm i glsl-layer -S
Usage & example :floppy_disk:
#pragma glslify: layer = require('glsl-layer')
attribute vec2 vUv;
uniform sampler2D circle;
uniform sampler2D square;
void main() {
gl_FragColor = layer(
texture2D(circle, vUv),
texture2D(square, vUv)
);
}
License :pencil:
MIT. See LICENSE for details.