Thursday, March 13, 2008

Z Buffer Capture

Got it working :)

The screenshot on the right shows the capture for the start hall. I've mangled the intensities (and inverted the range) so that you can see things a bit clearer. The image is also somewhat larger than I will use for production; again, this is just for demonstration purposes.

Further performance optimizations. I only capture the Z buffer under the following conditions:

  • The viewleaf has changed (always capture, no matter what).
  • We're in the first few frames of the map.
  • The view origin or angles have changed significantly.
  • 0.1 seconds have passed (i.e. capture at 10 FPS).
The last one might seem a bit controversial, but it does make perfect sense if you think about it. If the view origin and angles haven't changed significantly enough, then the resulting scene will be relatively static, so there's not much need to update the captured buffer. I might be able to get away with capturing less frequently (or even not at all!) under this condition, but a final decision on that will have to wait until I start bringing entities into play.

It's good to be back on track with this.

0 comments: