Update uniform and varying glossary docs

This commit is contained in:
David Broder-Rodgers 2017-12-20 20:34:26 +00:00
parent 5e2e1be3f3
commit 14921e8264
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/)