An example of building a sphere with dots, making sure there's a uniform density of dots across all the surface. In naive distributions, there's way more points towards the poles than necessary.
The algorithm accepts different point sizes and differents spacing between points.
Toggle camera or press Space
More details...
All points are GL_POINTS, using distance to the center and discard to make the look like dots.
>There are two buffers, one for vertices and another for colors. Whether there's a dot or not is decided by looking up a mask image loaded in a canvas. The color of the dot is also read from a color texture (earth and clouds), also loaded in their respective canvases. The position of the dot is displaced in the normal direction based on a lookup of a heightmap texture.
All images are equirectngular panoramas so can be mapped into a sphere. UV spherical coordinates from the sphere surface need to be adapted to be lookup 2D coordinates for the equirectangular panoramas.
All geometry is drawn in a single draw call.
Credits
Inspired by this image.
Textures are from NASA's Visible Earth
Coded using WebGL with three.js and isMobile.js