diff --git a/glossary/uniform/README.md b/glossary/uniform/README.md index 04b632f..9836f65 100644 --- a/glossary/uniform/README.md +++ b/glossary/uniform/README.md @@ -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/) diff --git a/glossary/varying/README.md b/glossary/varying/README.md index 95fadcb..d833555 100644 --- a/glossary/varying/README.md +++ b/glossary/varying/README.md @@ -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/)