Assuming a graphics card which does not support double precision values (i.e. pre OpenGL 4)
When does the the following code convert doubles to floats.
// code snippet
const GLdouble vts[] = {0.0, 0.0, 0.0,
1.0, 0.0, 0.0,
0.2, 1.0, 0.0};
glGenBuffers(1, &name);
glBindBuffer(GL_ARRAY_BUFFER, name);
glBufferData(GL_ARRAY_BUFFER, sizeof(vts), vts, GL_STATIC_DRAW);
glVertexAttribPointer(0, 3, GL_DOUBLE, GL_FALSE, 0, 0);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 3);
It seems to me that the conversion from double to float would be between reading the double from the gpu VBO and handing it off to the vertex shader. Is this correct?
If so I am storing double precision in the VBO which is a poor use of memory as I’m storing doubles but using floats, correct?
Also I’m taking a speed hit in the conversion from double to float EVERY time the VBO is used, correct?
Thanks