Commit 9941c8d6 authored by Gaëtan Renaudeau's avatar Gaëtan Renaudeau

write some more doc

parent d8f96616
......@@ -44,3 +44,9 @@ class HelloGL extends React.Component {
}
}
```
A GL component is implemented in 2 parts:
- first, you need to implement a fragment shader in GLSL (OpenGL Shading Language).
Give it to `GL.Shaders.create` and you have a backed object in return (like `StyleSheet.create`).
- second, you can render a `<GL.View>` and pass-in the shader you have defined previously. **Do not forget to give a width and height**.
......@@ -49,3 +49,8 @@ class Saturation extends React.Component {
}
}
```
GL.View supports `uniforms` props that allow to send to the shader any parameters from the JavaScript world.
In this example, we send the `factor` number (that come from props) and we also send the image.
The image have the same format as the `source` passed in an `<Image/>`.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment