const React = require("react-native"); const { View, Text, } = React; const GL = require("gl-react"); const {Surface} = require("gl-react-native"); const shaders = GL.Shaders.create({ drunkEffect: { frag: ` precision highp float; varying vec2 uv; uniform float time; uniform float amp; uniform float freq; uniform float colorSeparation; uniform sampler2D texture; uniform float moving; vec2 lookup (vec2 offset) { return mod( uv + amp * vec2(cos(freq*(uv.x+offset.x)+time),sin(freq*(uv.y+offset.x)+time)) + vec2(moving * time/10.0, 0.0), vec2(1.0)); } void main() { gl_FragColor = vec4( vec3( texture2D(texture, lookup(vec2(colorSeparation))).r, texture2D(texture, lookup(vec2(-colorSeparation))).g, texture2D(texture, lookup(vec2(0.0))).b), 1.0); } ` } }); class Intro extends React.Component { render () { const { time, fps, width, height } = this.props; return console.log("Intro onLoad")} onProgress={e => console.log("Intro onProgress", e.nativeEvent)}> GL REACT NATIVE {time.toFixed(2)}s {(fps).toFixed(0)} fps {""} ; } } module.exports = Intro;