Monday, August 16, 2010

Virtual texturing on iPhone

Sorry for the lack of updates, I've been on vacation in Illinois for the last 3 weeks, visiting family in laws, and only now starting to recover from jet lag. Before I left me and Matthew Baranowski (start blogging already!) submitted a proposal to write an article for a book (not sure if I'm allowed to say anything more about it, so I won't, at least not yet), and while I was on vacation it got accepted! Yesterday (Sunday) was the deadline for the first draft, and I came back last Wednesday.
If I hadn't taken my laptop with me and worked on the article in my vacation, I would've only had a couple of days to write it! Pfew!

Today we submitted the draft and we should be getting comments on the article eventually.


While I was on vacation John Carmack showed a technical demo on the iPhone which used virtual texturing.
It's pretty cool, but I'm actually not surprised that it works. In fact it's something I wanted to try myself, but haven't had the time to do yet.

Why does it work so well on the iPhone? Well from what I've heard they've backed lighting into most surfaces in Rage, leaving only the specular channel to store and render.

IO latency and throughput are less of an issue on the iPhone because of flash memory for 'disk', and that pages don't need to be of as high a resolution compared to consoles.

So if you have pixel shaders, which the iphone does, then it's really not that hard.

The only thing that is more problematic on the iPhone is storage space which is alleviated somewhat by the lower resolution pages. Texture decompression would be more of a problem on the iPhone however, so they're probably not doing that.

I'm still wondering if Id software is subdividing it's geometry at the highest resolution page level though, in which case you wouldn't even need a pixel shader.


  1. In iphone one thing is problematic and that is storage space and it can be alleviated somewhat by lower resolution pages.
    Office supplies

  2. John Carmack also said that the iPhone version would work great on the iPhone 2G and 3G that don't have pixel shaders.

    That is very interesting.

  3. That confirms my suspicions that Id software subdivides their geometry into per page geometry. It does mean they have to update the texture coordinates of pieces of geometry now and then. But then again, they need to upload new chunks of geometry every now and then anyway because of VSD.

    I wonder if they're using an analytical approach to page usage determination. I have no idea how fast texture readback is on the iPhone.
    The iPhone 2G/3G do support render to texture, so it's not impossible.

  4. my virtual texturing implementation has been running on the iPhone / iPad for some months now ;->

  5. can't say - for lack of pixel shader capable hardware (only have a 3G) i can only run it in the simulator ;-(

    (that should answer the second question too ;)

    i guess i'll put up the source in the coming weeks so anyone with the right hardware can try out...

  6. nice :)
    whats the fps? are you using pixel shaders?

  7. source is up:


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