Pixel-Coords of a vertex


I am rendering GL_POINTS and need the distance of a fragment to the point-center in the fragment-shader, as a float, measured in pixels. For this i want to compute the pixel-coords of the vertex in the vertex-shader and pass the result as a varying to the fragment-shader and compute the distance using gl_Fragcoord.

But how do i get the pixel-cords of a vertex?

By doing the same what gluProject does:
The only problem would be clipping.
Check the OpenGL 2.0 spec 2.11 and 2.12 for the detailed description.

thanks, that is what i was looking for!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.