Skip to main content
gamedev.net
🔒 Locked

Point sprite question

Started by coderchris Dec 29, 2006 at 5:02 PM 1 replies 550+ views
Original Post
coderchris
coderchris
Ill get straight to the question: Is it possible to rotate a point sprite? When I say rotate, I mean I want an independent rotation for each of my point sprites. Im vertex bound at the moment and I need some way to render lots of rotated sprites. Im currently using hardware instancing but Im using quads for the sprites, so for every sprite there is 4 verticies. I figure that with point sprites I could have 4 times as many objects. If its not possible to directly rotate them, are there any shader tricks I can use to do so?
sirob
sirob
Point Sprites themselves don't support rotation. What you can do is rotate the texture being sampled, either using Texture Transformation Matrices, or by directly changing the texcoords in a shader. Both methods will suffer some performance loss.

Are you sure you're vertex limited? Most particle systems are fillrate limited, how have you determined that isn't the case?

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
coderchris
coderchris
thanks for the reply

about the vertex limitation, I was at first using actual sphere geometry, and as I lowered the vertex count on the spheres, it got loads faster. I then switched to using simple rotated textured quads, which sped it up even more. The total number of pixels being rendered each time is roughly the same, so im fairly sure its vertex limited, unless I am missing something

So, i guess I can try shifting the texture coordinates in the pixel shader, though Im not exactly sure how this is done.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.