const GL = require("gl-react"); const React = GL.React; const shaders = GL.Shaders.create({ Copy: { frag: ` precision highp float; varying vec2 uv; uniform sampler2D t; uniform bool preventAlphaMult; void main () { vec4 c = texture2D(t, uv); if (preventAlphaMult) // (I know if() in glsl is not performant. don't do this. It's just for readability purpose here) gl_FragColor = c / sqrt(c.a); else gl_FragColor = c; } ` } }); module.exports = GL.createComponent( ({ width, height, children: t, last, ...rest }) => , { displayName: "Copy" } );