Hello,
I have a problem with textured point sprites. In my current application, I use extensively 2D 9x9 markers over photographs. Well, I though that the best way to render them could be using textured point sprites. This means only send one vertex per marker and let GL compute correct texture coordinates. Then I placed an ortho2d view and translated it by 0.375 in horz. and vert. (as MSDN and GL FAQ says, to ensure an exact match between texels and pixels, but this dont work as expected. Sometimes makers apperas shrinked in one dimension or stretched, like if texcoords were displaced a bit. Here is an example of a good and a bad marker:
Marker #470 is perfectly drawn, but #311 don’t.
This effect happens randomly, when I pan or zoom my scene, and not all markers are affected, only few.
This looks like a floating point round error, but I ran out of ideas.
I disabled in NV control panel anisotropic filtering and antialising, but it had no effect.
P.D: my graphic card is an NV 8500 GT with driver version 158.22 (later I’ll try with newest drivers, but this issue is happening since some driver versions and I really dont thing that could be a driver issue, but I’ll it)
P.D: for drawing I’m using the simplest fragment shader ever:
uniform sampler2D texture;
void main()
{
gl_FragColor = texture2D(texture, gl_TexCoord[0].xy) * gl_Color;
}
and in the VS, texcoords are simply passed to the FS:
gl_TexCoord[0] = gl_MultiTexCoord0;
as well as point size:
gl_PointSize = gl_Point.size;
If anyone is experienced with 2d glyphs drawing using point sprites, I really apreciatte his advises
Jacobo.