Created
February 8, 2018 09:22
-
-
Save wcandillon/1abb7e0a191b0279cb783987fc5e3d76 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @flow | |
import * as React from "react"; | |
import {Shaders, Node} from "gl-react"; | |
import resolveAssetSource from "react-native/Libraries/Image/resolveAssetSource"; | |
const shaders = Shaders.create({ | |
Brannan: { | |
frag: `...` | |
} | |
}); | |
export default class Brannan extends React.PureComponent<{ on: boolean, children: React.Node }> { | |
render(): React.Node { | |
const {on, children: inputImageTexture} = this.props; | |
// If the filter is disabled, it's a passthrough | |
if (!on) { | |
return this.props.children; | |
} | |
return ( | |
<Node | |
shader={shaders.Brannan} | |
uniforms={{ | |
inputImageTexture, | |
inputImageTexture2: resolveAssetSource(require("./images/brannanProcess.png")), | |
}} | |
/> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment