2015-05-01 20:05:55 +00:00
|
|
|
## Uniform
|
2017-12-20 20:34:26 +00:00
|
|
|
Uniform variable qualifier.
|
2015-05-01 20:05:55 +00:00
|
|
|
|
2017-12-20 20:34:26 +00:00
|
|
|
### Example
|
|
|
|
```glsl
|
|
|
|
uniform vec4 direction;
|
|
|
|
```
|
2015-06-12 16:02:51 +00:00
|
|
|
|
|
|
|
### Description
|
2017-12-20 20:34:26 +00:00
|
|
|
```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.
|
2015-06-12 16:02:51 +00:00
|
|
|
|
|
|
|
### See Also
|
2017-12-20 20:34:26 +00:00
|
|
|
[attribute](/glossary/?search=attribute), [const](/glossary/?search=const), [varying](/glossary/?search=varying), [Chapter 03: Uniforms](/03/)
|