Monday, November 9, 2009

Adventures in virtual texture space, part 14

This is just an update to show my progress.

Texture coordinates are now generated correctly, and popping of pages is extremely rare now and basically only happens if you travel trough a wall.

Note that I haven't put the texture compression code in yet, so IO performance will actually get better in the future.

Also, the frame rate in the video is rather chaotic, this is due to the screen recorder competing with the application for resources.

2 comments:

  1. To my knowledge, there is no lightmap texture coordinate in Quake4/Doom3 games. Which algorithm do you use to pack your meshes?

    Quake3 map do have lightmap texture coordinates so it should be easy to convert a map to a virtual texture. I plan to start with data from this game when I'll try to implement virtual texturing.

    thank you again for sharing your work, it inspires me a lot.

    ReplyDelete
  2. That's a good point about Quake3. You might need to take extra care about boundaries between surfaces since light maps have different needs than virtual textures.

    I merge all polygons of the same material that share edges, and calculate the extends in texture space. I then assign texture space for this rectangle in my virtual texture using the following algorithm:
    http://www.blackpawn.com/texts/lightmaps/default.html

    Keep in mind this is just the indirection table, how the pages are stored in the virtual texture itself can be radically different and pages do not need to be unique there.

    If you figure out a better way of doing things, please don't hesitate to share! ;)

    ReplyDelete

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