To declare a uniform in GLSL we simply add the uniform keyword to a shader with a type and a name. From that point on we can use the newly declared uniform in the shader. Let's see if this time we can set the color of the triangle via a uniform
Explore more quotes
Components of a vector can be accessed via vec.xwhere x is the first component of the vector. You can use .x, .y, .z and .w to access their first, second, third and fourth component respectively. GLSL also allows you to use rgba for colors or stpq for texture coordinates, accessing the same components.
Maybe because I'm a child of the '80s, but for me, a sequel is a story that follows the previous one, and sometimes if you haven't seen the original, then you don't understand the second one. Like 'Back to the Future 2.' If you haven't seen the first one, you're not going to get anything out of 'Back to the Future 2.'