mirror of
https://github.com/patriciogonzalezvivo/thebookofshaders
synced 2024-11-11 13:10:57 +00:00
16 lines
526 B
Markdown
16 lines
526 B
Markdown
|
## Uniform
|
||
|
Uniform variable qualifier.
|
||
|
|
||
|
### Ví dụ
|
||
|
```glsl
|
||
|
uniform vec4 direction;
|
||
|
```
|
||
|
|
||
|
### Mô tả
|
||
|
```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.
|
||
|
|
||
|
### Tham khảo thêm
|
||
|
[attribute](/glossary/?lan=vi&search=attribute), [const](/glossary/?lan=vi&search=const), [varying](/glossary/?lan=vi&search=varying), [Chương 03: Uniform](/03/?lan=vi)
|