secondlife / viewer

🖥️ Second Life's official client
GNU Lesser General Public License v2.1
212 stars 53 forks source link

viewer#2780 Speed up terrain loading on teleport #3065

Closed akleshchev closed 1 week ago

akleshchev commented 1 week ago

Terrain was arriving and processing too late resulting in issues like https://github.com/secondlife/viewer/issues/2780 "Lower terrain material incorrectly shown momentarily", terrain started invisible in general.

  1. We are in the 'arrived, but caching' part of teleport, so textures need to start fetching and decoding (all of them, not just for terrain).
  2. Agent update includes camera position and looks like it triggers first surface LayerData, so enabled sending it during 'arrival' state. Note that this might have some consequences due to sheer scope of the AgentUpdate, but if we find something that causes issues, we can make it to send camera position only, but at the moment I don't see anything that require such safeguards.
  3. Allowed processing of LayerData data during 'arrival'