mirror of
https://github.com/gre/gl-react.git
synced 2026-01-25 16:43:36 +00:00
24 lines
493 B
JavaScript
24 lines
493 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`)
|
|
}
|
|
});
|
|
|
|
class HueRotate extends GL.Component {
|
|
render () {
|
|
const { width, height, hue, children: tex } = this.props;
|
|
return <GL.View
|
|
shader={shaders.hueRotate}
|
|
width={width}
|
|
height={height}
|
|
uniforms={{ hue, tex }}
|
|
/>;
|
|
}
|
|
}
|
|
|
|
module.exports = HueRotate;
|