mirror of
https://github.com/gre/gl-react.git
synced 2026-01-25 16:43:36 +00:00
20 lines
438 B
JavaScript
20 lines
438 B
JavaScript
const React = require("react");
|
|
const GL = require("gl-react");
|
|
const glslify = require("glslify");
|
|
|
|
const shaders = GL.Shaders.create({
|
|
hueRotate: {
|
|
frag: glslify(`${__dirname}/hueRotate.frag`)
|
|
}
|
|
});
|
|
|
|
module.exports = GL.createComponent(
|
|
({ width, height, hue, children: tex }) =>
|
|
<GL.View
|
|
shader={shaders.hueRotate}
|
|
width={width}
|
|
height={height}
|
|
uniforms={{ hue, tex }}
|
|
/>,
|
|
{ displayName: "HueRotate"});
|