I'm trying to understand OpenGL by using Processing OpenGL ES.
If I have an example Cube to render.
I've read that a vertex shader will be run once for each Vertex. The fragment shader will be run (at least) once for each pixel.
In a vertex shader I have:
#define PROCESSING_COLOR_SHADER
uniform mat4 transform;
attribute vec4 vertex;
attribute vec4 color;
varying vec4 col;
void main(){
gl_Position = vertex;
col = color;
}
In a fragment shader I have:
gl_FragColor = col;
When ran, it creates a simple painted cube of the colour defined in the Processing sketch. However, if I change the vertex shader to...
gl_Position = vertex
(instead of transform*vertex) it draws a wireframe cube in exactly the same place. What exactly does the transform matrix do?