Monday, September 7, 2009

Virtual Texturing part 3

My virtual texture implementation now reads pages from disk.

I'm doing it the completely naive way, reading and uploading a page to the video card *just* before i need it, and i'm absolutely surprised how little performance penalty i'm seeing; only 0.1 - 0.2ms!

I'm guessing that this has to do, at least in part, because of disk caching since i'm using the regular .net disk functions at the moment (and i -just- generated my virtual texture disk file, so it's fresh in the cache).
Update: Confirmed, after a reboot i get horrible spikes of +/- 30ms when i move the camera around on the virtual texture!

Unfortunately .net won't get any memory mapped IO until .net 4.0 comes out, so i won't be able to try this unless i port everything over to C++.

I really should 'acquire' some more interesting test scenes.. a flat polygon is simply too ..erhm.. simple.

2 comments:

  1. You don't need memory mapping, you just need async I/O (and some knowledge about which pages you're going to need soon).

    ReplyDelete
  2. I am using async I/O actually, but memory mapping would avoid an extra copy of the data.. And would avoid 'wasting' memory on copies.

    ReplyDelete

To you spammers out there:
Spam will be deleted before it shows up, so don't bother.