GL_POINT_SPRITE + texture atlas


Is it possible to combine the use of point sprites
with the texture atlas technique? Basically, I need
to be able to specify the UV coords for each sprite
(each call to glVertex()) rendered. It looks impossible
from the specs at:
but I was hoping someone might know a trick or two.


It is possible with a fragment shader.

A GLSL example:

uniform sampler2D Colormap;
uniform vec2 scale;
uniform vec2 offset;

void main(void){
 vec2 coords = gl_PointCoord * scale + offset;
 gl_FragColor = texture2D(Colormap,cords);

Thanks oc2k1!

I was hoping to be able to do it without
using shaders, but a partial solution is
better than no solution. Thanks again! :slight_smile: