Textured Points Demo — LOADING TEXTURES
This is a simple demo, whose purpose is simply to show image textures being used on a primitive of type gl.POINTS. It is similar to moving-points-demo.html, which also shows a gl.POINTS primitive, but without the texture.
This program uses a single texture unit, texture unit zero, and the value of the uniform sampler variable in the fragment shader is initialized to zero and is never changed after that. The program uses six texture objects for the six different texture images.
Each vertex of the POINTS primitive is rendered as a disk. The texture is applied to the disk by using the special vec2 fragment shader variable gl_PointCoord as the texture coordinates. Since the x and y coordinates in gl_PointCoord range from 0.0 to 1.0, this effectively cuts a disk out of the texture image.
The "Feature Edges" option will smooth the edges of the disks using alpha blending. The disk fades from opaque to transparent as the distance of the pixel from the center increases from 0.45 to 0.5. Distance is measured in the gl_PointCoord coordinate system.