@@ -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.Viewshader={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.Viewshader={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.