I'm trying to turn this display list into a VBO, and I'd like to turn the QUAD into a Point Sprite. Having trouble making it happen. Any help would be appreciated. Thanks
Code:
gl.glEnable(GL.GL_BLEND);
gl.glBlendFunc(GL.GL_SRC_ALPHA,GL.GL_ONE);
...
int nodeList;
void initNodes(){
nodeList = gl.glGenLists(1);
gl.glNewList(nodeList, GL.GL_COMPILE);
textureImg.bind();
textureImg.enable();
noStroke();
shader.startShader();
gl.glBegin(gl.GL_QUADS);
gl.glColor3f(1, 1, 1);
for (int i = 0; i < Nodes.length; i++) {
gl.glTexCoord4f(Nodes[i].x, Nodes[i].y, Nodes[i].z, Nodes[i].w );
gl.glVertex2f( -1.0f, -1.0f );
gl.glVertex2f( +1.0f, -1.0f );
gl.glVertex2f( +1.0f, +1.0f );
gl.glVertex2f( -1.0f, +1.0f );
}
gl.glEnd();
shader.endShader();
textureImg.disable();
gl.glEndList();
}
I've tried this to get sprites working with no luck. I'll see if I can dig up my VBO tests.
Code:
gl.glEnable(GL.GL_TEXTURE_2D);
gl.glBindTexture(GL.GL_TEXTURE_2D,mapPointTexture.getTextureID());
gl.glEnable(GL.GL_POINT_SPRITE);
gl.glTexEnvi(GL.GL_POINT_SPRITE, GL.GL_COORD_REPLACE, GL.GL_TRUE);
gl.glPointSize(15);
gl.glBegin(GL.GL_POINTS);
for (int i = 0; i < Nodes.length; i++) {
gl.glTexCoord3f(Nodes[i].x, Nodes[i].y, Nodes[i].z);
}
gl.glEnd();
gl.glDisable(GL.GL_POINT_SPRITE);
gl.glDisable(GL.GL_TEXTURE_2D);