I'm trying to speed up particles, and one way to do that is by precomputing the texture rotations. What I want to do is load the texture, rotate it and save it to a handle.

How would I go about doing this?

Thanks in advance.


2 Answers 2


How does that save any significant amount of time? Presuming you handle the rotation in a vertex shader, that only saves time if you're VS bound.

If you are talking about a fixed-function pipeline, it's much cheaper to precompute the rotated edge vectors for the quads you are using. Rotating the texture is then done by the GPU. The only way that might incur additional cost is if you use a software renderer.

  • \$\begingroup\$ The reason I'm looking for ways to precompute it is because it's the biggest bottleneck when working with point sprite particles. \$\endgroup\$
    – knight666
    Jul 22, 2010 at 19:09
  • 2
    \$\begingroup\$ Bottleneck how? How did you measure that? Rotating around a center point in a vertex shader is pretty cheap. If you precompute sin/cos and provide it as shader constants, dirt cheap even. Or are you referring to ARB_point_sprite sprites? Just don't use those - build your own billboards. That way, your quads can actually rotate, as opposed to axis-aligned quads with a rotated texture \$\endgroup\$ Jul 22, 2010 at 21:51

You can use a Framebufer Object (FBO) to draw the transformed texture into another texture, then you can use the generated texture and draw it to screen.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .