Point Sprites or Geometry Shader

Is it better to use point sprites or create two triangles using the geometry shader?

Thanks.

Is it better to use point sprites or create two triangles using the geometry shader?

If you can live within the limitations of point sprites, then you should use them. They won’t be any slower than a geometry shader and may be a great deal faster.

Point sprites are no longer guaranteed to be hardware accelerated on newer GPUs: Deprecated Features (Direct3D 10) - Win32 apps | Microsoft Learn (you can bet that NVIDIA still does accelerate them though, but any vendor that designs primarily to the D3D spec most likely won’t).

Depending on your driver they may go all the way from being emulated via good old glBegin/glEnd to being emulated via geometry shaders, but bottom line is that they will be emulated and you have no control over how that emulation is done.

So use a geometry shader instead.

you can bet that NVIDIA still does accelerate them though, but any vendor that designs primarily to the D3D spec most likely won’t

Which would be… nobody.

Because all that D3D10 hardware also has to run D3D9 applications. Faster than D3D9 hardware. So they’re not going to make, for example, point sprites run slower than older D3D9-only hardware.

How they go about doing this is irrelevant. What matters is that it can be done and done with reasonable performance.

Depending on your driver they may go all the way from being emulated via good old glBegin/glEnd to being emulated via geometry shaders, but bottom line is that they will be emulated and you have no control over how that emulation is done.

So use a geometry shader instead.

That doesn’t make sense. The driver, having been written by people who really know their hardware, will use whatever the fastest method is for rendering them. If geometry shaders would be the fastest, then it will internally use a geometry shader. So in this case, your geometry shader code will (at best) match the performance of the driver.

However, if geometry shaders are not used, and something else is used instead, then the only reason for this is because this something else is faster than geometry shaders. Which means that your geometry shader point sprite code will not match the performance of the driver.

So use point sprites when you can live within their restrictions.

if I recall correctly point sprites have a maximum size and are culled when the center point is clipped (or used to). So GS provides greater flexibility.

if I recall correctly point sprites have a maximum size and are culled when the center point is clipped (or used to). So GS provides greater flexibility.

I know. That’s why I said, “So use point sprites when you can live within their restrictions.

I think the low limits are for the FFP point size. I’ve notice on NVidia at least with GL_VERTEX_PROGRAM_POINT_SIZE and gl_PointSize, the sky seems to be the limit on point size.

Same thing with clipping. Guess the spec says point sprites should be clipped as points, but NVidia clips them as QUADs as you’d hope.

See this thread for details.