WebGL Shader Glossary
June 05, 2020
A personal reference for WebGL shader terms. Feel free to get in touch if anything isn’t clear or if there’s something you would like to add.
Terms
- Normalizing
- Converting a value to be between 0.0 and 1.0. You can normalize the FragCoord by dividing it with by the canvas resolution
Variables
Note: when I say “between pixels” it’s because a shader will perform its calculations on every individual pixel.
- Uniform
- The same between pixels
- Varying
- Can be different between pixels
- FragColor
- The colour of the pixel being computed
- FragCoord
- The x and y value of the pixel being computed