Monday, July 6, 2009

All Units, We Have A Disable And Destroy Alert On Slow Cinematics

I've successfully sped up cinematic handling at large resolutions by a factor of about 50. I had originally (and misguidedly, as it turned out) thought that writing the raw data directly to the backbuffer would be the optimal solution, and - while it did work OK at 800x600 - at anything higher it went to a total crawl. Using regular texturing turned out to be the Correct Thing to do, after all. I'm not certain if it was the use of a fullscreen Device or the higher resolution, in fact; but at this stage I'm not really going to bother finding out, as it now works very fine indeed.

I've optimised it beyond the GL handling in that it caches the texture and only needs to recreate it if the size changes or a new cinematic begins. This is the D3D equivalent of a single glTexImage followed by glTexSubImage until the texture params change.

Just for laughs I also changed the texture update to only happen every other frame, and the difference in animation was completely invisible, but perf was boosted even further still. I kinda suspect that default QII cinematics were playing at some crazy high frame rate.

All in all, this has been a good one to mark off the list.

0 comments: