Drawing millions of objects

I’m suprised no one has suggest you use Point Sprites. They were specifically designed to allow you to draw a ridiculous number of textured quads with same dimensions, and you only need to pass a single position to the pipeline.

The primary limitation of glPointSize, point sprites, and point parameters that is relevant here is that they have an implementation-dependent maximum size. This means that the requirement to be able to zoom will most likely not be satisfied correctly. Otherwise they would be a fine solution.

Agree, the point size limitation can be an issue, however depends on the target platform. ATI does support 8192 sized points for several GPU generations now and NVIDIA supports it as well in their lately appearing GPU generations.

Besides that, you can still generate point sprites using geometry shaders if that is an option. This solution does not suffer from any size limitation and the 1:4 vertex input-output ratio for geometry shaders is usually optimized in hardware (at least it is on ATI GPUs according to their programming guide).

What ATI programming guide is that? You wouldn’t happen to have an URL for it, by any chance?

Sorry, I always suppose that everybody reads the same stuff as me :slight_smile:
Here is the link:

http://www.amddevcentral.com/media/gpu_assets/ATI_Radeon_HD_2000_programming_guide.pdf

This is for the HD2000 series GPUs, however it is valid also for 3000 and 4000 series and mostly applies to later generations as well.

This is what it says:

When the geometry shader does 1:1 input/output, i.e. does no amplification or reduction, the shader can run with similar performance characteristics as a regular vertex shader, and similarly since the geometry shader is expected to be commonly used for replacing point sprites (by expanding point primitives to a triangle strip with two triangles) there is also special hardware for taking care of the 1:4 case.