If we are going to generate fog using the vertex shader and the fragment shader, one of the common ways would be to compute the distance of a vertex in the vertex shader and apply the fog-mixed color in the fragment shader.
My question is, since we only computed the distance of the triangle vertices, how does OpenGL decide the colors of points inside the triangle? If it is automatically computed, is there a way to control the computation?