PDA

View Full Version : Point Sprites or Geometry Shader



ViolentHamster
09-07-2010, 03:02 PM
Is it better to use point sprites or create two triangles using the geometry shader?

Thanks.

Alfonse Reinheart
09-07-2010, 04:12 PM
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.

mhagain
09-07-2010, 05:30 PM
Point sprites are no longer guaranteed to be hardware accelerated on newer GPUs: http://msdn.microsoft.com/en-us/library/cc308047%28VS.85%29.aspx (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.

Alfonse Reinheart
09-07-2010, 06:48 PM
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.

CrazyButcher
09-08-2010, 12:24 AM
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.

Alfonse Reinheart
09-08-2010, 08:49 AM
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."

Dark Photon
09-08-2010, 06:34 PM
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 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 (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=270493) for details.