Merge pull request #203 from broder/storage-qualifiers

Update uniform and varying glossary docs
This commit is contained in:
Patricio Gonzalez Vivo 2017-12-20 13:32:20 -08:00 committed by GitHub
commit 522dafc53a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 7 deletions

View File

@ -1,10 +1,15 @@
## Uniform
Uniform variable qualifier.
### Declaration / Example
### Parameters
### Example
```glsl
uniform vec4 direction;
```
### Description
```uniform``` variables contain read-only data shared from WebGL/OpenGL environment to a vertex or fragment shader.
The value is per primitive, so is useful for variables which remain constant along a primitive, frame or scene.
### See Also
[Chapter 03: Uniforms](../05/)
[attribute](/glossary/?search=attribute), [const](/glossary/?search=const), [varying](/glossary/?search=varying), [Chapter 03: Uniforms](/03/)

View File

@ -1,9 +1,15 @@
## Varying
Varying variable qualifier.
### Declaration / Example
### Parameters
### Example
```glsl
varying vec3 position;
```
### Description
```varying``` variables contain data shared from a vertex shader to a fragment shader.
The variable must be written in the vertex shader and the read-only value in the fragment shader is then interpolated from the vertices which make up the fragment.
### See Also
[attribute](/glossary/?search=attribute), [const](/glossary/?search=const), [uniform](/glossary/?search=uniform), [Chapter 03: Uniforms](/03/)