mirror of
https://github.com/patriciogonzalezvivo/thebookofshaders
synced 2024-11-09 19:10:24 +00:00
Update uniform and varying glossary docs
This commit is contained in:
parent
5e2e1be3f3
commit
14921e8264
@ -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/)
|
||||
|
@ -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/)
|
||||
|
Loading…
Reference in New Issue
Block a user