UNPKG

gl-react-native-filters

Version:

Includes the instagram filters for gl-react-native, see examples folder as the usage tip.

32 lines (26 loc) 627 B
import React from 'react'; import PropTypes from 'prop-types'; import { GLSL, Shaders, Node } from 'gl-react'; const shaders = Shaders.create({ Normal: { frag: GLSL` precision highp float; varying vec2 uv; uniform sampler2D inputImageTexture; void main () { vec3 texel = texture2D(inputImageTexture, uv).rgb; gl_FragColor = vec4(texel, 1.0); }` } }); const Normal = ({ children: t }) => (<Node shader={shaders.Normal} uniforms={{ inputImageTexture: t }} />); Normal.propTypes = { children: PropTypes.object.isRequired }; export default Normal;