point sprite texture clipping?

Hi all, I’m trying to draw a point sprite from a texture that looks like:

[attachment=1:2pl8eqfp]pointSpriteImg.png[/attachment:2pl8eqfp]

and it’s showing up like:

[attachment=0:2pl8eqfp]Screen shot 2011-03-07 at 1.10.01 PM.png[/attachment:2pl8eqfp]

the draw code is pretty straightforward:

  
  
glDisable(GL_DEPTH_TEST);  
pointSpriteTexture.bind();  
			  
glEnable(GL_POINT_SPRITE);  
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE);  
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);  
glEnableClientState(GL_VERTEX_ARRAY);  
glVertexPointer(2, GL_FLOAT, 0, posArray);  
			  
glDrawArrays(GL_POINTS, 0, PARTICLES);			  
glDisableClientState(GL_VERTEX_ARRAY);			  
pointSpriteTexture.unbind();  
  

creating the image is pretty straightforward too:

  
  
pointSpriteTexture.allocate(128, 128, GL_RGBA, false);  
	ofImage loader;  
	loader.loadImage("pointSpriteImg.png");  
	pointSpriteTexture.loadData(loader.getPixels(), 128, 128, GL_RGBA);  
  

it’s non-ARB, so I’m not sure what could be problem. Any advice?

![](http://forum.openframeworks.cc/uploads/default/1004/Screen shot 2011-03-07 at 1.10.01 PM.png)

i think the problem is the texture is not 128x128 but 127x126 so when uploading it to a texture setting the size to 128x128 it’s reading the pixels incorrectly

Oops, forgot I posted this. Yes, that was the problem, really dumb mistake. I hit “resize” in Preview with 128 as the height and just assumed it did the right thing. It did not :slight_smile: