Is there a way to apply a texture to a point sprite in OpenGl 4.3? I've searched around the internet but most tutorials and guides are using older versions that still support:
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE);
However this function seems to no longer be supported and the standard texture environment doesn't seem to work. Any advice on how to do it or where to find how to do it?
You use
gl_PointCoord
in your fragment shader. This value goes from [0, 1] across the surface of the point. When doing point rendering, it is the only input that ever changes across the surface of the point. (0, 0) is the upper-left corner of the point.You can compute a texture coordinate however you would like from this value.