Disclaimer: this is a trick-question. It's not about transforms or projections it's about 'gaining perspective'.
Example: I want to create a smoking camp-fire in my game but all the tutorials on particle systems focus on logic. Spawning. Animating. Destroying. But that's easy. I would go even further and say that figuring out how to move the particles around is the FUN part. What I need to know is how to render them. Do I use Point Sprites? Quads? Vertexbuffers? The particle tutorials often nonchalantly do something like this:
glPointSize(5.0) glBegin(GL_POINTS) for point in points: glVertex2fv(point.get_position()) glEnd()
But immediate mode is deprecated! Right?
You're supposed to store stuff in a buffer now! On the GPU! Right?
But how do I animate stuff? Updating buffers is slow! Right?
I'm a beginner and this is my problem: The tutorials and books I found throw around these terms, but don't give you any perspective.
- How slow is slow?
- How deprecated is deprecated?
- What is worse? Many nested code-paths or many OpenGL state changes? And how many?!
- For how many vertices is it faster to multiply a matrix on the CPU and not in the shader?
- What's the performance impact of creating, binding, rendering to and applying a new texture?
- What orders of magnitude are we talking about?
And so forth. How do I go about learning this? Is there a list of thumb-rules anywhere or do I need to code everything multiple different ways and look at the raw FPS?
This isn't just about performance. I don't use thousands of vertices for my crappy little jump'n'run. This is about crippling perfectionism. I want to learn how to do it right.