What am I forgetting to optimize?

Started by
10 comments, last by Hodgman 9 years, 11 months ago

1. Reducing the shadow map from 2048x2048 to 1024x1024 was the first thing that caused FPS to increase to 30

2. Having the camera amidst the exhaust particles caused lag, possibly because of sorting, but I don't see why sorting would need to do more work

3. Removing bump and specular on 200 units

But now the shadows are missing on the trees. A minor detail, messed something up.

Whenever there is blending occurring multiple times over the entire screen, like when the camera is inside a bunch of particles, that typically causes a slowdown. Blending is expensive, which usually isn't a problem when it's only over a small portion of the screen. Especially since particles are drawn back-to-front, meaning there is lots of overdraw, which is unfortunately necessary for it to look right, but expensive!

Advertisement

Here's the GL extension for timer queries: EXT_timer_query

You can use glGenQueries to create a large number of query objects ahead of time and put them into a big list/pool. On the frame you want to profile, grab one query object ID from this list for each object that you draw in your scene, and wrap that object's draw calls in a glBeginQuery/glEndQuery. Record the query ID that you used in another list along with the object's name.

Next frame, use glGetQueryObject* to retrieve the results from those timer queries. Then print the information to a file, including the object names and the time taken by each.

I output my data in chrome tracing format, so I can view it in the chrome tracing tool

nNPDfaJ.png

p.s. this is great for CPU profiling too: http://i.imgur.com/Aym7sd0.png

p.p.s. the screenshots of your game are looking great :D

This topic is closed to new replies.

Advertisement