Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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.

share|improve this question
add comment

2 Answers 2

up vote 6 down vote accepted

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.

share|improve this answer
    
The reason I'm looking for ways to precompute it is because it's the biggest bottleneck when working with point sprite particles. –  knight666 Jul 22 '10 at 19:09
2  
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 –  Rachel Blum Jul 22 '10 at 21:51
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.