Texture Pipeline Improvements

From Second Life Wiki
Jump to navigation Jump to search
KBwarning.png

This article is obsolete, but kept as a historical record. Do not rely on this information in any way. However, it may be used in the future, so please do not delete or modify.


< Viewer Roadmap, Render Roadmap


Summary

The existing texture pipeline is a UDP packet based system riding on top of our general purpose message system. This is an outdated an inefficient way to deliver textures and needs to be replaced with a more scalable HTTP based system. The avatar appearance pipeline is tightly coupled to the texture pipeline and needs to be updated as well to streamline this crucial piece of functionality.

Priority

This project is high priority. It would be critical except that the existing system generally works so projects to eliminate crashes and fix systems that frequently do not work are more urgent.

Objectives

  • Improve simulator performance by reducing stalls due to fetching texture data from disk
    • This should improve the overall performance of class 3 and 4 sims by 10-20% by improving the worst case performance significantly
  • Improve system performance by reducing unnecessary and redundant texture fetches
    • This will help improve viewer performance on machines with poor network connections
    • overall framerate will not be measurably improved but should be smoother
  • Improve viewer experience by presenting texture information in a more timely manner
    • difficult to measure, but should feel slightly better

Tasks

Avatar Pipeline Improvements

Improve the baked avatar image pipeline:

  • Remove download of all composited textures for every agent
    • Simplifies rendering pipeline
    • Somewhat protects clothing assets
    • Have default baked texture that all non-baked agents revert to, in case of baked cache timeout
  • Change the way baked textures are moved around the system
  • Move through texture pipeline to increase reliability of baked textures

Texture downloads over HTTP

  • Reduce time dilation caused by blocking file reads the simulator performs while reading images out of the vfs cache.
    • These blocking reads can cause time dilation by taking longer than a frame to return.
    • When either the sim or another sim is busy forking and saving state, contention for the disk can cause very long read times.
  • Improve load times for large textures
    • Initial testing has shown some improvement in overall texture load times, and significant improvement loading high resolution images
      • This is due to the fact that http texture sends the image data as a single large chunk instead of breaking it up into smaller pieces; this makes it significantly more efficient for large images.

Two-phase design

While there are other design possibilities available which reduce the number of request-response pairs required for each mip to one, the initial design will require first asking for permission to download a texture with a POST to the Texture Download Request capability, then downloading the actual texture data with a GET to the returned one-shot capability. This requires the least number of changes to the sim-caps infrastructure and should still be reasonably efficient, as the overhead of making an additional roundtrip is insignificant to the time it takes to download the actual texture data.

  1. Viewer requests capability to download texture
  2. Sim grants a capability to access the texture
  3. Viewer invokes capability, fetching requested texture over HTTP