Commit 6e287a79 authored by Gaëtan Renaudeau's avatar Gaëtan Renaudeau

polish doc

parent 9941c8d6
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
```js ```js
render () { render () {
return <GL.View shader={shaders.myEffect3} return <GL.View
width={200} height={100}> shader={shaders.myEffect3}
width={200}
height={100}>
<GL.Target uniform="textureName"> <GL.Target uniform="textureName">
...any React Native components ...any React Native components
...@@ -21,4 +23,4 @@ render () { ...@@ -21,4 +23,4 @@ render () {
## Props ## Props
- **`uniform`** *string* **(required)**: The name of the shader texture uniform to use for rendering the content. - **`uniform`** *(string)* **(required)**: The name of the shader texture uniform to use for rendering the content.
...@@ -8,8 +8,10 @@ Renders a "standalone" shader: ...@@ -8,8 +8,10 @@ Renders a "standalone" shader:
```js ```js
render () { render () {
return <GL.View shader={shaders.myEffect} return <GL.View
width={200} height={100} />; shader={shaders.myEffect}
width={200}
height={100} />;
} }
``` ```
...@@ -17,8 +19,10 @@ Renders a shader with uniform parameters: ...@@ -17,8 +19,10 @@ Renders a shader with uniform parameters:
```js ```js
render () { render () {
return <GL.View shader={shaders.myEffect2} return <GL.View
width={200} height={100} shader={shaders.myEffect2}
width={200}
height={100}
uniforms={{ uniforms={{
floatValue: 0.5, floatValue: 0.5,
vec3Value: [ 1, 0.5, 0.5 ] vec3Value: [ 1, 0.5, 0.5 ]
...@@ -35,8 +39,10 @@ Renders a shader with an image (texture): ...@@ -35,8 +39,10 @@ Renders a shader with an image (texture):
```js ```js
render () { render () {
return <GL.View shader={shaders.myEffect3} return <GL.View
width={200} height={100} shader={shaders.myEffect3}
width={200}
height={100}
uniforms={{ uniforms={{
textureName: {{ uri: "...url" }} // RN convention textureName: {{ uri: "...url" }} // RN convention
}} />; }} />;
...@@ -50,10 +56,10 @@ render () { ...@@ -50,10 +56,10 @@ render () {
## Props ## Props
- **`shader`** *id created by GL.Shaders.create* **(required)**: The shader to use for rendering the `GL.View`. - **`shader`** *(id created by GL.Shaders.create)* **(required)**: The shader to use for rendering the `GL.View`.
- **`width`** and **`height`** *Number* **(required)**: the size of the view. - **`width`** and **`height`** *(Number)* **(required)**: the size of the view.
- **`uniforms`**: an object that contains all uniform parameters to send to the shader. The key is the uniform name and the value is whatever value that makes sense for the uniform's type (see below). - **`uniforms`** *(object)*: an object that contains all uniform parameters to send to the shader. The key is the uniform name and the value is whatever value that makes sense for the uniform's type (see below).
- **`opaque`**: specify if the view should be opaque. By default, it is true, meaning that the GL View won't support texture opacity and alpha channel. - **`opaque`** *(bool)*: specify if the view should be opaque. By default, it is true, meaning that the GL View won't support texture opacity and alpha channel.
## Uniform types ## Uniform types
......
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