Friday, 24 May 2013

Grass Performance

My level was really starting to run slowly. It was a real inconvenience to accurately measure the effect of objects on performance, but after installing FRAPS, I was able to see the framerate as I made adjustments to the level without having to jump in-game.

It wasn't long before I had identified that in areas of poorest performance, the grass was taking about half the render time, which is far, far more than it should have been. I wasn't sure if it was getting drawn behind terrain which would later draw on top of it (overdraw). At this time the grass wasn't getting culled, so I figured I'd experiment a little there.

What I noticed, however, was that changing the draw distance on the grass was not actually culling the grass. It turns out this is because UDK was clumping together the grass actors into batches in their hundreds, and wouldn't cull them unless none of these actors could be seen. With such enourmous clumps, this meant almost no culling, and almost guaranteed maximum overdraw. After adjusting the clump sizes to be in small clumps no wider than a dozen meters or so, my framerate improved from a low of 17 FPS to a low of 30FPS... a huge and really pleasing improvement in performance!

No comments:

Post a Comment