hillar
02-25-2005, 04:11 AM
Hi
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?
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?