I've been working on optimizing brush model rendering as per my previous post, and have something good coming along. As with alias models, it's a complete change of the in-memory format to something that's laid out in a more optimal fashion for rendering from. This time I was able to do indexed triangle lists quite effectively with the end result being that even the central arena in ctf1rq now runs very smoothly.
The setup code is a little nightmarish! I don't recommend that anyone working on their own engine just copy and paste this in without reading it carefully and fully understanding what's going on.
There's more optimization to come here too, as I can reduce the number of state changes required fairly well, so we're going to be in a situation where large complex scenes with lots of brush models (or with complex brush models, or a mixture of both) don't slow down as much (they can be over twice as fast as before).
Interestingly, I had an experimental version that used hardware vertex buffer objects but it didn't run as well; likely because the format of brush models necessitated a lot of changes between buffers. This bears on my own previous experiments with VBOs in the regular renderer, where they just didn't give that substantial a performance increase (even back when I had the entire world in a single VBO I only got about a 5% to 10% gain, at the expense of complexity, setup, loading times and loss of flexibility). At the end of the day it's down to what format and usage is most optimal for the data you have, and for Quake VBOs are firmly in the "not such a big deal" arena.
Undoubtedly if I had fully static geometry all of which shared the same textures the situation would be different.
Monday, December 28, 2009
Fun with Brush Models
Posted by
mhquake
at
2:03 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment