From 9941c8d66ce221573e09dac7386925c006cc0fdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Thu, 20 Aug 2015 15:12:58 +0200 Subject: [PATCH] write some more doc --- docs/examples/1.md | 6 ++++++ docs/examples/2.md | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/docs/examples/1.md b/docs/examples/1.md index 1fdd588..fbcdac9 100644 --- a/docs/examples/1.md +++ b/docs/examples/1.md @@ -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 `` and pass-in the shader you have defined previously. **Do not forget to give a width and height**. diff --git a/docs/examples/2.md b/docs/examples/2.md index 8ffdc26..f693481 100644 --- a/docs/examples/2.md +++ b/docs/examples/2.md @@ -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 ``. -- 2.26.2