Difference between revisions of "Avatar Impostors tech details"

From Second Life Wiki
Jump to navigation Jump to search
(New page: An attachment (at some distance) is visible with 50% transparency and disappears at 51% transparency. What are the rules? Impostors are cutouts, not translucency, so anything the avatar ...)
 
Line 1: Line 1:
{{OSWikiFeatureNav}}
=== Feature Design Document ===
(none)
=== Functional Spec ===
(none)
=== Test scripts ===
(none)
=== Discussion for future improvements ===
(none)
=== Relationship to other features ===
=== User Guides ===
(none)
An attachment (at some distance) is visible with 50% transparency and disappears at 51% transparency.
An attachment (at some distance) is visible with 50% transparency and disappears at 51% transparency.
What are the rules?  
What are the rules?  

Revision as of 14:15, 3 December 2007

Feature Design Document

(none)

Functional Spec

(none)

Test scripts

(none)

Discussion for future improvements

(none)

Relationship to other features

User Guides

(none)



An attachment (at some distance) is visible with 50% transparency and disappears at 51% transparency. What are the rules?

Impostors are cutouts, not translucency, so anything the avatar is wearing that more than 50% transparent will not be rendered. The same thing happens for non-impostored geometry on a face-by-face basis for items that are very small on screen.


How can I tell if impostors are working?

Turn on Wireframe mode (ctrl-shift-R or Client>Rendering>Wireframe). Impostored avatar will not be visible as a wireframe.


how does the avatar detail slider affect the impostor distance? how does the size of the avatar + attachments affect the impostor distance? how do we measure the size of the avatar + attachments? how often should the impostor update? how can we measure that?


The code for impostor update frequency is as such:

      F32 impostor_area = 256.f*512.f*(8.125f - LLVOAvatar::sLODFactor*8.f);
      if (visible && mPixelArea <= impostor_area)
      {
          mUpdatePeriod = llclamp((S32) sqrtf(impostor_area*4.f/mPixelArea), 2, 8);
          visible = (LLDrawable::getCurrentFrame()+mID.mData[0])%mUpdatePeriod == 0 ? TRUE : FALSE;
      }

If that visible BOOL comes out TRUE for a given frame, that avatar will get an animation update. LLVOAvatar::sLODFactor is the value that comes out of the avatar mesh detail slider. mPixelArea is the number of pixels being covered by the AABB that surrounds the avatar and all of its attachments. If the AABB of the avatar hasn't changed significantly after an animation update, there is no impostor update (this prevents redundantly updating impostors for avatars that aren't moving).

There's no info display for impostor update periods or when an update is triggered. Would you like me to make one? It should be trivial to make impostors flash green on frames where they received an update and display the update period as debug text.