I have two questions. First, i am trying to determine the final on-screen position of a vertex (actually a GL_POINT) in a shader. Here is what I am doing (in the vertex shader):
Code :float WIDTH = 800.0; float HEIGHT=650.0; gl_FrontColor = gl_Color; gl_Position = ftransform(); FinalPos.x = (gl_Position.x+1.0) * (WIDTH/2.0); FinalPos.y = (gl_Position.y+1.0) * (HEIGHT/2.0);
1) Is this the correct way of doing it?
2) If the final on-screen position (in pixels) is fractional, will the final pixel position be chosen using round(),floor(), or ceil()? As far as I know, the OpenGL spec doesnt specify. Anyone know what ATI or NVidia do?