Just to clarify while learning this stuff:
If I have a scene with just one rectangle declared like this:
const Vertex Vertices[] = {
{{1, -1, -7}, {1, 0, 0, 1}}, // X Y Z, R G B A
{{1, 1, -7}, {0, 1, 0, 1}},
{{-1, 1, -7}, {0, 0, 1, 1}},
{{-1, -1, -7}, {0, 0, 0, 1}}
};
How often will the vertex shader be called to render one frame? I believe 4 times.
But there is some interpolation going on with varying variables in the vertex shader. The fragment shader gets called a lot more often (usually for each pixel once). Is this correct?
The vertex shader is called for each vertex in the primitive. The fragment shader is called for each fragment, in practice, this usually means for each pixel.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With