Commits

Vadim Savchuk committed 156ad15 Merge

Merge from default branch. Fixed gcc build.

  • Participants
  • Parent commits aa2b02f, ab09f2c
  • Branches product-engine

Comments (0)

Files changed (13)

indra/newview/app_settings/settings.xml

 		<key>Value</key>
 		<integer>0</integer>
 	</map>
+  <key>DebugAvatarLocalTexLoadedTime</key>
+  <map>
+    <key>Comment</key>
+    <string>Display time for loading avatar local textures.</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>0</integer>
+  </map>
     <key>DebugBeaconLineWidth</key>
     <map>
       <key>Comment</key>
       <key>Value</key>
       <integer>0</integer>
     </map>
+    <key>MultipleAttachments</key>
+    <map>
+      <key>Comment</key>
+      <string>Allow multiple objects to be attached to a single attachment point.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
    <key>MuteAmbient</key>
     <map>
       <key>Comment</key>
     <key>Type</key>
     <string>U32</string>
     <key>Value</key>
-    <integer>200</integer>
+    <integer>60</integer>
   </map>
   <key>RenderSSAOFactor</key>
   <map>
     <real>0.01</real>
   </map>
 
-  <key>RenderShadowBiasError</key>
-  <map>
-    <key>Comment</key>
-    <string>Error scale for shadow bias (based on altitude).</string>
+  <key>RenderShadowResolutionScale</key>
+  <map>
+    <key>Comment</key>
+    <string>Scale of shadow map resolution vs. screen resolution</string>
     <key>Persist</key>
     <integer>1</integer>
     <key>Type</key>
     <string>F32</string>
     <key>Value</key>
-    <real>0</real>
-  </map>
-  <key>RenderShadowOffsetError</key>
-  <map>
-    <key>Comment</key>
-    <string>Error scale for shadow offset (based on altitude).</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>0</real>
-  </map>
-  
-  <key>RenderSpotLightsInNondeferred</key>
-  <map>
-    <key>Comment</key>
-    <string>Whether to support projectors as spotlights when Lighting and Shadows is disabled</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>Boolean</string>
-    <key>Value</key>
-    <integer>0</integer>
+    <real>1.0</real>
   </map>
 
-  <key>RenderSpotShadowBias</key>
-  <map>
-    <key>Comment</key>
-    <string>Bias value for shadows (prevent shadow acne).</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>0.0</real>
-  </map>
-  <key>RenderSpotShadowOffset</key>
-  <map>
-    <key>Comment</key>
-    <string>Offset value for shadows (prevent shadow acne).</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>0.04</real>
-  </map>
 
-  <key>RenderShadowResolutionScale</key>
-  <map>
-    <key>Comment</key>
-    <string>Scale of shadow map resolution vs. screen resolution</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>F32</string>
-    <key>Value</key>
-    <real>1.0</real>
-  </map>
 
   <key>RenderDeferredTreeShadowBias</key>
   <map>
     <key>Type</key>
     <string>F32</string>
     <key>Value</key>
-    <real>8</real>
+    <real>1</real>
   </map>
 
   <key>RenderDeferred</key>
     <integer>0</integer>
   </map>
 
+  <key>RenderDeferredShadow</key>
+  <map>
+    <key>Comment</key>
+    <string>Enable shadows in deferred renderer.</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>1</integer>
+  </map>
+
   <key>RenderDeferredGI</key>
   <map>
     <key>Comment</key>
     <integer>0</integer>
   </map>
 
+  <key>RenderDeferredSunShadow</key>
+  <map>
+    <key>Comment</key>
+    <string>Generate shadows from the sun.</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>1</integer>
+  </map>
+
   <key>RenderDeferredSun</key>
   <map>
     <key>Comment</key>
     <integer>1</integer>
   </map>
 
-  <key>RenderDeferredSSAO</key>
-  <map>
-    <key>Comment</key>
-    <string>Execute screen space ambient occlusion shader in deferred renderer.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>Boolean</string>
-    <key>Value</key>
-    <integer>1</integer>
-  </map>
-
   <key>RenderDeferredBlurLight</key>
   <map>
     <key>Comment</key>
       <key>Value</key>
       <real>256.0</real>
     </map>
-    <key>RenderAutoMaskAlphaNonDeferred</key>
-    <map>
-      <key>Comment</key>
-      <string>Use alpha masks where appropriate, in the non-deferred (non-'Lighting and Shadows') graphics mode</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
-    <key>RenderAutoMaskAlphaDeferred</key>
-    <map>
-      <key>Comment</key>
-      <string>Use alpha masks where appropriate, in the deferred ('Lighting and Shadows') graphics mode</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
+    <key>RenderFastAlpha</key>
+    <map>
+      <key>Comment</key>
+      <string>Use lossy alpha rendering optimization (opaque/nonexistent small alpha faces).</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
     </map>
     <key>RenderFastUI</key>
     <map>
       <key>Value</key>
       <integer>0</integer>
     </map>
+    <key>RenderLightingDetail</key>
+    <map>
+      <key>Comment</key>
+      <string>Amount of detail for lighting objects/avatars/terrain (0=sun/moon only, 1=enable local lights)</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
     <key>RenderMaxPartCount</key>
     <map>
       <key>Comment</key>
       <key>Value</key>
       <integer>2</integer>
     </map>
-    <key>RenderShadowDetail</key>
-    <map>
-      <key>Comment</key>
-      <string>Detail of shadows.</string>
+    <key>RenderReflectionRes</key>
+    <map>
+      <key>Comment</key>
+      <string>Reflection map resolution.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>64</integer>
+    </map>
+    <key>RenderResolutionDivisor</key>
+    <map>
+      <key>Comment</key>
+      <string>Divisor for rendering 3D scene at reduced resolution.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>U32</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
+    <key>RenderShaderLightingMaxLevel</key>
+    <map>
+      <key>Comment</key>
+      <string>Max lighting level to use in the shader (class 3 is default, 2 is less lights, 1 is sun/moon only.  Works around shader compiler bugs on certain platforms.)</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>3</integer>
+    </map>
+    <key>RenderShaderLODThreshold</key>
+    <map>
+      <key>Comment</key>
+      <string>Fraction of draw distance defining the switch to a different shader LOD</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>1.0</real>
+    </map>
+    <key>RenderShaderParticleThreshold</key>
+    <map>
+      <key>Comment</key>
+      <string>Fraction of draw distance to not use shader on particles</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>0.25</real>
+    </map>
+    <key>RenderSunDynamicRange</key>
+    <map>
+      <key>Comment</key>
+      <string>Defines what percent brighter the sun is than local point lights (1.0 = 100% brighter. Value should not be less than 0. ).</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>1.0</real>
+    </map>
+    <key>RenderTerrainDetail</key>
+    <map>
+      <key>Comment</key>
+      <string>Detail applied to terrain texturing (0 = none, 1 or 2 = full)</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
       <key>Value</key>
       <integer>2</integer>
     </map>
-
-    <key>RenderReflectionRes</key>
-    <map>
-      <key>Comment</key>
-      <string>Reflection map resolution.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <integer>64</integer>
-    </map>
-    <key>RenderResolutionDivisor</key>
-    <map>
-      <key>Comment</key>
-      <string>Divisor for rendering 3D scene at reduced resolution.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>U32</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>RenderShaderLightingMaxLevel</key>
-    <map>
-      <key>Comment</key>
-      <string>Max lighting level to use in the shader (class 3 is default, 2 is less lights, 1 is sun/moon only.  Works around shader compiler bugs on certain platforms.)</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <integer>3</integer>
-    </map>
-    <key>RenderShaderLODThreshold</key>
-    <map>
-      <key>Comment</key>
-      <string>Fraction of draw distance defining the switch to a different shader LOD</string>
+    <key>RenderTerrainLODFactor</key>
+    <map>
+      <key>Comment</key>
+      <string>Controls level of detail of terrain (multiplier for current screen area when calculated level of detail)</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
       <key>Value</key>
       <real>1.0</real>
     </map>
-    <key>RenderShaderParticleThreshold</key>
-    <map>
-      <key>Comment</key>
-      <string>Fraction of draw distance to not use shader on particles</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>F32</string>
-      <key>Value</key>
-      <real>0.25</real>
-    </map>
-    <key>RenderSunDynamicRange</key>
-    <map>
-      <key>Comment</key>
-      <string>Defines what percent brighter the sun is than local point lights (1.0 = 100% brighter. Value should not be less than 0. ).</string>
+    <key>RenderTerrainScale</key>
+    <map>
+      <key>Comment</key>
+      <string>Terrain detail texture scale</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>12.0</real>
+    </map>
+    <key>RenderTextureMemoryMultiple</key>
+    <map>
+      <key>Comment</key>
+      <string>Multiple of texture memory value to use (should fit: 0 &lt; value &lt;= 1.0)</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
       <key>Value</key>
       <real>1.0</real>
     </map>
-    <key>RenderTerrainDetail</key>
-    <map>
-      <key>Comment</key>
-      <string>Detail applied to terrain texturing (0 = none, 1 or 2 = full)</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <integer>2</integer>
-    </map>
-    <key>RenderTerrainLODFactor</key>
-    <map>
-      <key>Comment</key>
-      <string>Controls level of detail of terrain (multiplier for current screen area when calculated level of detail)</string>
+    <key>RenderTreeLODFactor</key>
+    <map>
+      <key>Comment</key>
+      <string>Controls level of detail of vegetation (multiplier for current screen area when calculated level of detail)</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>F32</string>
+      <key>Value</key>
+      <real>0.5</real>
+    </map>
+    <key>RenderUIInSnapshot</key>
+    <map>
+      <key>Comment</key>
+      <string>Display user interface in snapshot</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
+    <key>RenderUIBuffer</key>
+    <map>
+      <key>Comment</key>
+      <string>Cache ui render in a screen aligned buffer.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
+    <key>RenderUnloadedAvatar</key>
+    <map>
+      <key>Comment</key>
+      <string>Show avatars which haven't finished loading</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
+    <key>RenderUseFBO</key>
+    <map>
+      <key>Comment</key>
+      <string>Whether we want to use GL_EXT_framebuffer_objects.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
+  <key>RenderUseTriStrips</key>
+  <map>
+    <key>Comment</key>
+    <string>Use triangle strips for rendering prims.</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>0</integer>
+  </map>
+    <key>RenderUseFarClip</key>
+    <map>
+      <key>Comment</key>
+      <string>If false, frustum culling will ignore far clip plane.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
+    <key>RenderUseImpostors</key>
+    <map>
+      <key>Comment</key>
+      <string>Whether we want to use impostors for far away avatars.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
+    <key>RenderUseShaderLOD</key>
+    <map>
+      <key>Comment</key>
+      <string>Whether we want to have different shaders for LOD</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
+    <key>RenderUseShaderNearParticles</key>
+    <map>
+      <key>Comment</key>
+      <string>Whether we want to use shaders on near particles</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
+    <key>RenderVBOEnable</key>
+    <map>
+      <key>Comment</key>
+      <string>Use GL Vertex Buffer Objects</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
+  <key>RenderUseStreamVBO</key>
+  <map>
+    <key>Comment</key>
+    <string>Use VBO's for stream buffers</string>
+    <key>Persist</key>
+    <integer>1</integer>
+    <key>Type</key>
+    <string>Boolean</string>
+    <key>Value</key>
+    <integer>1</integer>
+  </map>
+    <key>RenderVolumeLODFactor</key>
+    <map>
+      <key>Comment</key>
+      <string>Controls level of detail of primitives (multiplier for current screen area when calculated level of detail)</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
       <key>Value</key>
       <real>1.0</real>
     </map>
-    <key>RenderTerrainScale</key>
-    <map>
-      <key>Comment</key>
-      <string>Terrain detail texture scale</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>F32</string>
-      <key>Value</key>
-      <real>12.0</real>
-    </map>
-    <key>RenderTextureMemoryMultiple</key>
-    <map>
-      <key>Comment</key>
-      <string>Multiple of texture memory value to use (should fit: 0 &lt; value &lt;= 1.0)</string>
+    <key>RenderWater</key>
+    <map>
+      <key>Comment</key>
+      <string>Display water</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
+    <key>RenderWaterMipNormal</key>
+    <map>
+      <key>Comment</key>
+      <string>Use mip maps for water normal map.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
+    </map>
+    <key>RenderWaterRefResolution</key>
+    <map>
+      <key>Comment</key>
+      <string>Water planar reflection resolution.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>S32</string>
+      <key>Value</key>
+      <integer>512</integer>
+    </map>
+    <key>RenderWaterReflections</key>
+    <map>
+      <key>Comment</key>
+      <string>Reflect the environment in the water.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
+    <key>RotateRight</key>
+    <map>
+      <key>Comment</key>
+      <string>Make the agent rotate to its right.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>0</integer>
+    </map>
+    <key>RotationStep</key>
+    <map>
+      <key>Comment</key>
+      <string>All rotations via rotation tool are constrained to multiples of this unit (degrees)</string>
       <key>Persist</key>
       <integer>1</integer>
       <key>Type</key>
       <key>Value</key>
       <real>1.0</real>
     </map>
-    <key>RenderTreeLODFactor</key>
-    <map>
-      <key>Comment</key>
-      <string>Controls level of detail of vegetation (multiplier for current screen area when calculated level of detail)</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>F32</string>
-      <key>Value</key>
-      <real>0.5</real>
-    </map>
-    <key>RenderUIInSnapshot</key>
-    <map>
-      <key>Comment</key>
-      <string>Display user interface in snapshot</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>RenderUIBuffer</key>
-    <map>
-      <key>Comment</key>
-      <string>Cache ui render in a screen aligned buffer.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
-    <key>RenderUnloadedAvatar</key>
-    <map>
-      <key>Comment</key>
-      <string>Show avatars which haven't finished loading</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
-    <key>RenderUseFBO</key>
-    <map>
-      <key>Comment</key>
-      <string>Whether we want to use GL_EXT_framebuffer_objects.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
-  <key>RenderUseTriStrips</key>
-  <map>
-    <key>Comment</key>
-    <string>Use triangle strips for rendering prims.</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>Boolean</string>
-    <key>Value</key>
-    <integer>0</integer>
-  </map>
-    <key>RenderUseFarClip</key>
-    <map>
-      <key>Comment</key>
-      <string>If false, frustum culling will ignore far clip plane.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>RenderUseImpostors</key>
-    <map>
-      <key>Comment</key>
-      <string>Whether we want to use impostors for far away avatars.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>RenderUseShaderLOD</key>
-    <map>
-      <key>Comment</key>
-      <string>Whether we want to have different shaders for LOD</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>RenderUseShaderNearParticles</key>
-    <map>
-      <key>Comment</key>
-      <string>Whether we want to use shaders on near particles</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
-    <key>RenderVBOEnable</key>
-    <map>
-      <key>Comment</key>
-      <string>Use GL Vertex Buffer Objects</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-  <key>RenderUseStreamVBO</key>
-  <map>
-    <key>Comment</key>
-    <string>Use VBO's for stream buffers</string>
-    <key>Persist</key>
-    <integer>1</integer>
-    <key>Type</key>
-    <string>Boolean</string>
-    <key>Value</key>
-    <integer>1</integer>
-  </map>
-    <key>RenderVolumeLODFactor</key>
-    <map>
-      <key>Comment</key>
-      <string>Controls level of detail of primitives (multiplier for current screen area when calculated level of detail)</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>F32</string>
-      <key>Value</key>
-      <real>1.0</real>
-    </map>
-    <key>RenderWater</key>
-    <map>
-      <key>Comment</key>
-      <string>Display water</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>RenderWaterMipNormal</key>
-    <map>
-      <key>Comment</key>
-      <string>Use mip maps for water normal map.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>1</integer>
-    </map>
-    <key>RenderWaterRefResolution</key>
-    <map>
-      <key>Comment</key>
-      <string>Water planar reflection resolution.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>S32</string>
-      <key>Value</key>
-      <integer>512</integer>
-    </map>
-    <key>RotateRight</key>
-    <map>
-      <key>Comment</key>
-      <string>Make the agent rotate to its right.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
-    <key>RotationStep</key>
-    <map>
-      <key>Comment</key>
-      <string>All rotations via rotation tool are constrained to multiples of this unit (degrees)</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>F32</string>
-      <key>Value</key>
-      <real>1.0</real>
-    </map>
-    <key>RunMultipleThreads</key>
-    <map>
-      <key>Comment</key>
-      <string>If TRUE keep background threads active during render</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
     <key>SafeMode</key>
     <map>
       <key>Comment</key>
       <key>Value</key>
       <integer>75</integer>
     </map>
-    <key>SnapshotSharingEnabled</key>
-    <map>
-      <key>Comment</key>
-      <string>Enable uploading of snapshots to a web service.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>Boolean</string>
-      <key>Value</key>
-      <integer>0</integer>
-    </map>
-    <key>SnapshotConfigURL</key>
-    <map>
-      <key>Comment</key>
-      <string>URL to fetch Snapshot Sharing configuration data from.</string>
-      <key>Persist</key>
-      <integer>1</integer>
-      <key>Type</key>
-      <string>String</string>
-      <key>Value</key>
-      <string>http://photos.apps.staging.avatarsunited.com/viewer_config</string>
-    </map>
     <key>SnapshotTextureLastResolution</key>
     <map>
       <key>Comment</key>

indra/newview/llappviewer.cpp

 static LLFastTimer::DeclareTimer FTM_PAUSE_THREADS("Pause Threads");
 static LLFastTimer::DeclareTimer FTM_IDLE("Idle");
 static LLFastTimer::DeclareTimer FTM_PUMP("Pump");
-static LLFastTimer::DeclareTimer FTM_PUMP_ARES("Ares");
-static LLFastTimer::DeclareTimer FTM_PUMP_SERVICE("Service");
-static LLFastTimer::DeclareTimer FTM_SERVICE_CALLBACK("Callback");
-static LLFastTimer::DeclareTimer FTM_AGENT_AUTOPILOT("Autopilot");
-static LLFastTimer::DeclareTimer FTM_AGENT_UPDATE("Update");
 
 bool LLAppViewer::mainLoop()
 {
 						LLMemType mt_ip(LLMemType::MTYPE_IDLE_PUMP);
 						pingMainloopTimeout("Main:ServicePump");				
 						LLFastTimer t4(FTM_PUMP);
-						{
-							LLFastTimer t(FTM_PUMP_ARES);
-							gAres->process();
-						}
-						{
-							LLFastTimer t(FTM_PUMP_SERVICE);
-							// this pump is necessary to make the login screen show up
-							gServicePump->pump();
-
-							{
-								LLFastTimer t(FTM_SERVICE_CALLBACK);
-								gServicePump->callback();
-							}
-						}
+						gAres->process();
+						// this pump is necessary to make the login screen show up
+						gServicePump->pump();
+						gServicePump->callback();
 					}
 					
 					resumeMainloopTimeout();
 			{
 				LLMemType mt_sleep(LLMemType::MTYPE_SLEEP);
 				LLFastTimer t2(FTM_SLEEP);
-				bool run_multiple_threads = gSavedSettings.getBOOL("RunMultipleThreads");
-
+				
 				// yield some time to the os based on command line option
 				if(mYieldTime >= 0)
 				{
 				}
 
 				static const F64 FRAME_SLOW_THRESHOLD = 0.5; //2 frames per seconds				
-				const F64 min_frame_time = 0.0; //(.0333 - .0010); // max video frame rate = 30 fps
-				const F64 min_idle_time = 0.0; //(.0010); // min idle time = 1 ms
-				const F64 max_idle_time = run_multiple_threads ? min_idle_time : llmin(.005*10.0*gFrameTimeSeconds, 0.005); // 5 ms a second
+				const F64 max_idle_time = llmin(.005*10.0*gFrameTimeSeconds, 0.005); // 5 ms a second
 				idleTimer.reset();
 				bool is_slow = (frameTimer.getElapsedTimeF64() > FRAME_SLOW_THRESHOLD) ;
 				S32 total_work_pending = 0;
 
 					total_work_pending += work_pending ;
 					total_io_pending += io_pending ;
-					F64 frame_time = frameTimer.getElapsedTimeF64();
-					F64 idle_time = idleTimer.getElapsedTimeF64();
-					if (frame_time >= min_frame_time &&
-						idle_time >= min_idle_time &&
-						(!work_pending || idle_time >= max_idle_time))
+					
+					if (!work_pending || idleTimer.getElapsedTimeF64() >= max_idle_time)
 					{
 						break;
 					}
 				}
 
-				 // Prevent the worker threads from running while rendering.
-				// if (LLThread::processorCount()==1) //pause() should only be required when on a single processor client...
-				if (run_multiple_threads == FALSE)
+				if(!total_work_pending) //pause texture fetching threads if nothing to process.
 				{
-					//LLFastTimer ftm(FTM_PAUSE_THREADS); //not necessary.
-	 				
-					if(!total_work_pending) //pause texture fetching threads if nothing to process.
-					{
-						LLAppViewer::getTextureCache()->pause();
-						LLAppViewer::getImageDecodeThread()->pause();
-						LLAppViewer::getTextureFetch()->pause(); 
-					}
-					if(!total_io_pending) //pause file threads if nothing to process.
-					{
-						LLVFSThread::sLocal->pause(); 
-						LLLFSThread::sLocal->pause(); 
-					}
-				}					
+					LLAppViewer::getTextureCache()->pause();
+					LLAppViewer::getImageDecodeThread()->pause();
+					LLAppViewer::getTextureFetch()->pause(); 
+				}
+				if(!total_io_pending) //pause file threads if nothing to process.
+				{
+					LLVFSThread::sLocal->pause(); 
+					LLLFSThread::sLocal->pause(); 
+				}									
 
 				if ((LLStartUp::getStartupState() >= STATE_CLEANUP) &&
 					(frameTimer.getElapsedTimeF64() > FRAME_STALL_THRESHOLD))
 			gAgent.moveYaw(-1.f);
 		}
 
-		{
-			LLFastTimer t(FTM_AGENT_AUTOPILOT);
-			// Handle automatic walking towards points
-			gAgentPilot.updateTarget();
-			gAgent.autoPilot(&yaw);
-		}
+	    // Handle automatic walking towards points
+	    gAgentPilot.updateTarget();
+	    gAgent.autoPilot(&yaw);
     
 	    static LLFrameTimer agent_update_timer;
 	    static U32 				last_control_flags;
 		    
 	    if (flags_changed || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND)))
 	    {
-		    LLFastTimer t(FTM_AGENT_UPDATE);
 		    // Send avatar and camera info
 		    last_control_flags = gAgent.getControlFlags();
 		    send_agent_update(TRUE);

indra/newview/llface.cpp

 	}
 }
 
-
-bool LLFace::canRenderAsMask()
-{
-	const LLTextureEntry* te = getTextureEntry();
-	return (
-		(
-		 (LLPipeline::sRenderDeferred && LLPipeline::sAutoMaskAlphaDeferred) ||
-		 
-		 (!LLPipeline::sRenderDeferred && LLPipeline::sAutoMaskAlphaNonDeferred)		 
-		 ) // do we want masks at all?
-		&&
-		(te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha
-		!(LLPipeline::sRenderDeferred && te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible in deferred rendering mode, need to figure out why - for now, avoid
-		(te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask
-
-		getTexture()->getIsAlphaMask() // texture actually qualifies for masking (lazily recalculated but expensive)
-		);
-}
-
-
 static LLFastTimer::DeclareTimer FTM_FACE_GET_GEOM("Face Geom");
 
 BOOL LLFace::getGeometryVolume(const LLVolume& volume,
 		face_area =  mPixelArea / llclamp(texel_area, 0.015625f, 128.f);
 	}
 
-	if(face_area > LLViewerTexture::sMaxSmallImageSize)
+	face_area = LLFace::adjustPixelArea(mImportanceToCamera, face_area) ;
+	if(face_area > LLViewerTexture::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping.
 	{
-		if(mImportanceToCamera < LEAST_IMPORTANCE) //if the face is not important, do not load hi-res.
-		{
-			static const F32 MAX_LEAST_IMPORTANCE_IMAGE_SIZE = 128.0f * 128.0f ;
-			face_area = llmin(face_area * 0.5f, MAX_LEAST_IMPORTANCE_IMAGE_SIZE) ;
-		}
-		else if(face_area > LLViewerTexture::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping.
-		{
-			if(mImportanceToCamera < LEAST_IMPORTANCE_FOR_LARGE_IMAGE)//if the face is not important, do not load hi-res.
-			{
-				face_area = LLViewerTexture::sMinLargeImageSize ;
-			}	
-			else if(mTexture.notNull() && mTexture->isLargeImage())
-			{		
-				face_area *= adjustPartialOverlapPixelArea(cos_angle_to_view_dir, radius );
-			}			
-		}
+		if(mImportanceToCamera > LEAST_IMPORTANCE_FOR_LARGE_IMAGE && mTexture.notNull() && mTexture->isLargeImage())
+		{		
+			face_area *= adjustPartialOverlapPixelArea(cos_angle_to_view_dir, radius );
+		}	
 	}
 
 	setVirtualSize(face_area) ;
 	return importance ;
 }
 
+//static 
+F32 LLFace::adjustPixelArea(F32 importance, F32 pixel_area)
+{
+	if(pixel_area > LLViewerTexture::sMaxSmallImageSize)
+	{
+		if(importance < LEAST_IMPORTANCE) //if the face is not important, do not load hi-res.
+		{
+			static const F32 MAX_LEAST_IMPORTANCE_IMAGE_SIZE = 128.0f * 128.0f ;
+			pixel_area = llmin(pixel_area * 0.5f, MAX_LEAST_IMPORTANCE_IMAGE_SIZE) ;
+		}
+		else if(pixel_area > LLViewerTexture::sMinLargeImageSize) //if is large image, shrink face_area by considering the partial overlapping.
+		{
+			if(importance < LEAST_IMPORTANCE_FOR_LARGE_IMAGE)//if the face is not important, do not load hi-res.
+			{
+				pixel_area = LLViewerTexture::sMinLargeImageSize ;
+			}				
+		}
+	}
+
+	return pixel_area ;
+}
+
 BOOL LLFace::verify(const U32* indices_array) const
 {
 	BOOL ok = TRUE;

indra/newview/llface.h

 	void			unsetFaceColor(); // switch back to material color
 	const LLColor4&	getFaceColor() const { return mFaceColor; } 
 	const LLColor4& getRenderColor() const;
+	
 
 	//for volumes
 	void updateRebuildFlags();
-	bool canRenderAsMask(); // logic helper
 	BOOL getGeometryVolume(const LLVolume& volume,
 						const S32 &f,
 						const LLMatrix4& mat_vert, const LLMatrix3& mat_normal,
 	BOOL        calcPixelArea(F32& cos_angle_to_view_dir, F32& radius) ;
 public:
 	static F32  calcImportanceToCamera(F32 to_view_dir, F32 dist);
+	static F32  adjustPixelArea(F32 importance, F32 pixel_area) ;
 
 public:
 	

indra/newview/lltexlayer.cpp

 	}
 
 	restartUpdateTimer();
+
+	// need to swtich to using this layerset if this is the first update
+	// after getting the lowest LOD
+	mTexLayerSet->getAvatar()->updateMeshTextures();
 	
 	// Print out notification that we uploaded this texture.
 	if (gSavedSettings.getBOOL("DebugAvatarRezTime"))

indra/newview/lltexturefetch.cpp

 			return true; // abort
 		}
 	}
-	if(mImagePriority < 1.0f)
+	if(mImagePriority < F_ALMOST_ZERO)
 	{
 		if (mState == INIT || mState == LOAD_FROM_NETWORK || mState == LOAD_FROM_SIMULATOR)
 		{

indra/newview/llviewertexture.cpp

 //virtual
 void LLViewerFetchedTexture::processTextureStats()
 {
+	if(mFullyLoaded)
+	{		
+		if(mDesiredDiscardLevel > mMinDesiredDiscardLevel)//need to load more
+		{
+			mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ;
+			mFullyLoaded = FALSE ;
+		}
+	}
+	else
+	{
+		updateVirtualSize() ;
+		
+		static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes");
+		
+		if (textures_fullres)
+		{
+			mDesiredDiscardLevel = 0;
+		}
+		else if(!mFullWidth || !mFullHeight)
+		{
+			mDesiredDiscardLevel = 	getMaxDiscardLevel() ;
+		}
+		else
+		{	
+			if(!mKnownDrawWidth || !mKnownDrawHeight || mFullWidth <= mKnownDrawWidth || mFullHeight <= mKnownDrawHeight)
+			{
+				if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)
+				{
+					mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048
+				}
+				else
+				{
+					mDesiredDiscardLevel = 0;
+				}
+			}
+			else if(mKnownDrawSizeChanged)//known draw size is set
+			{			
+				mDesiredDiscardLevel = (S8)llmin(log((F32)mFullWidth / mKnownDrawWidth) / log_2, 
+													 log((F32)mFullHeight / mKnownDrawHeight) / log_2) ;
+				mDesiredDiscardLevel = 	llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()) ;
+				mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ;
+			}
+			mKnownDrawSizeChanged = FALSE ;
+		
+			if(getDiscardLevel() >= 0 && (getDiscardLevel() <= mDesiredDiscardLevel))
+			{
+				mFullyLoaded = TRUE ;
+			}
+		}
+	}
+
 	if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0) //force to refetch the texture.
 	{
 		mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, (S8)mDesiredSavedRawDiscardLevel) ;
-	}
-
-	if(mFullyLoaded)
-	{		
-		if(mDesiredDiscardLevel <= mMinDesiredDiscardLevel)//already loaded
+		if(getDiscardLevel() < 0 || getDiscardLevel() > mDesiredDiscardLevel)
 		{
-			return ;
-		}
-		mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ;
-		mFullyLoaded = FALSE ;
-		return ;
-	}
-
-	updateVirtualSize() ;
-	
-	static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes");
-	
-	if (textures_fullres)
-	{
-		mDesiredDiscardLevel = 0;
-	}
-	else if(!mFullWidth || !mFullHeight)
-	{
-		mDesiredDiscardLevel = 	getMaxDiscardLevel() ;
-	}
-	else
-	{	
-		if(!mKnownDrawWidth || !mKnownDrawHeight || mFullWidth <= mKnownDrawWidth || mFullHeight <= mKnownDrawHeight)
-		{
-			if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)
-			{
-				mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048
-			}
-			else
-			{
-				mDesiredDiscardLevel = 0;
-			}
-		}
-		else if(mKnownDrawSizeChanged)//known draw size is set
-		{			
-			mDesiredDiscardLevel = (S8)llmin(log((F32)mFullWidth / mKnownDrawWidth) / log_2, 
-					                             log((F32)mFullHeight / mKnownDrawHeight) / log_2) ;
-			mDesiredDiscardLevel = 	llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()) ;
-			mDesiredDiscardLevel = llmin(mDesiredDiscardLevel, mMinDesiredDiscardLevel) ;
-		}
-		mKnownDrawSizeChanged = FALSE ;
-		
-		if(getDiscardLevel() >= 0 && (getDiscardLevel() <= mDesiredDiscardLevel))
-		{
-			mFullyLoaded = TRUE ;
+			mFullyLoaded = FALSE ;
 		}
 	}
 }
 	llassert(!mInImageList); 
     
 	mDecodePriority = priority;
+
+	if(mDecodePriority < F_ALMOST_ZERO)
+	{
+		mStopFetchingTimer.reset() ;
+	}
 }
 
 void LLViewerFetchedTexture::setAdditionalDecodePriority(F32 priority)
 // 				llinfos << "Calling updateRequestPriority() with decode_priority = 0.0f" << llendl;
 // 				calcDecodePriority();
 // 			}
-			LLAppViewer::getTextureFetch()->updateRequestPriority(mID, decode_priority);
+			static const F32 MAX_HOLD_TIME = 5.0f ; //seconds to wait before canceling fecthing if decode_priority is 0.f.
+			if(decode_priority > 0.0f || mStopFetchingTimer.getElapsedTimeF32() > MAX_HOLD_TIME)
+			{
+				mStopFetchingTimer.reset() ;
+				LLAppViewer::getTextureFetch()->updateRequestPriority(mID, decode_priority);
+			}
 		}
 	}
 
 	}
 }
 
+void LLViewerFetchedTexture::clearCallbackEntryList()
+{
+	if(mLoadedCallbackList.empty())
+	{
+		return ;
+	}
+
+	for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
+			iter != mLoadedCallbackList.end(); )
+	{
+		LLLoadedCallbackEntry *entryp = *iter;
+			
+		// We never finished loading the image.  Indicate failure.
+		// Note: this allows mLoadedCallbackUserData to be cleaned up.
+		entryp->mCallback(FALSE, this, NULL, NULL, 0, TRUE, entryp->mUserData);
+		iter = mLoadedCallbackList.erase(iter) ;
+		delete entryp;
+	}
+	gTextureList.mCallbackList.erase(this);
+		
+	mMinDesiredDiscardLevel = MAX_DISCARD_LEVEL + 1;
+	mLoadedCallbackDesiredDiscardLevel = S8_MAX ;
+	if(mForceToSaveRawImage)
+	{
+		destroySavedRawImage() ;
+	}
+
+	return ;
+}
+
 void LLViewerFetchedTexture::deleteCallbackEntry(const LLLoadedCallbackEntry::source_callback_list_t* callback_list)
 {
 	if(mLoadedCallbackList.empty() || !callback_list)
 		return ;
 	}
 
-	S32 desired_discard = INVALID_DISCARD_LEVEL ;
+	S32 desired_discard = S8_MAX ;
 	S32 desired_raw_discard = INVALID_DISCARD_LEVEL ;
 	for(callback_list_t::iterator iter = mLoadedCallbackList.begin();
 			iter != mLoadedCallbackList.end(); )
 }
 void LLViewerFetchedTexture::destroySavedRawImage()
 {
+	clearCallbackEntryList() ;
+	//if(mForceToSaveRawImage && mDesiredSavedRawDiscardLevel >= 0 && mDesiredSavedRawDiscardLevel < getDiscardLevel())
+	//{
+	//	return ; //can not destroy the saved raw image before it is fully fetched, otherwise causing callbacks hanging there.
+	//}
+
 	mSavedRawImage = NULL ;
 	mForceToSaveRawImage  = FALSE ;
 	mSavedRawDiscardLevel = -1 ;
 void LLViewerLODTexture::processTextureStats()
 {
 	updateVirtualSize() ;
-
+	
 	static LLCachedControl<bool> textures_fullres(gSavedSettings,"TextureLoadFullRes");
 	
 	if (textures_fullres)

indra/newview/llviewertexture.h

 	void unpauseLoadedCallbacks(const LLLoadedCallbackEntry::source_callback_list_t* callback_list);
 	bool doLoadedCallbacks();
 	void deleteCallbackEntry(const LLLoadedCallbackEntry::source_callback_list_t* callback_list);
+	void clearCallbackEntryList() ;
 
 	void addToCreateTexture();
 
 
 	// Timers
 	LLFrameTimer mLastPacketTimer;		// Time since last packet.
+	LLFrameTimer mStopFetchingTimer;	// Time since mDecodePriority == 0.f.
 
 	BOOL  mInImageList;				// TRUE if image is in list (in which case don't reset priority!)
 	BOOL  mNeedsCreateTexture;	

indra/newview/llvoavatar.cpp

 			// When an avatar is changing clothes and not in Appearance mode,
 			// use the last-known good baked texture until it finish the first
 			// render of the new layerset.
+
+			const BOOL layerset_invalid = !mBakedTextureDatas[i].mTexLayerSet 
+										  || !mBakedTextureDatas[i].mTexLayerSet->getComposite()->isInitialized()
+										  || !mBakedTextureDatas[i].mTexLayerSet->isLocalTextureDataAvailable();
+
 			use_lkg_baked_layer[i] = (!is_layer_baked[i] 
 									  && (mBakedTextureDatas[i].mLastTextureIndex != IMG_DEFAULT_AVATAR) 
-									  && mBakedTextureDatas[i].mTexLayerSet 
-									  && !mBakedTextureDatas[i].mTexLayerSet->getComposite()->isInitialized());
+									  && layerset_invalid);
 			if (use_lkg_baked_layer[i])
 			{
 				mBakedTextureDatas[i].mTexLayerSet->setUpdatesEnabled(TRUE);

indra/newview/llvoavatarself.cpp

 
 void LLVOAvatarSelf::outputRezDiagnostics() const
 {
+	if(!gSavedSettings.getBOOL("DebugAvatarLocalTexLoadedTime"))
+	{
+		return ;
+	}
+
 	const F32 final_time = mDebugSelfLoadTimer.getElapsedTimeF32();
 	llinfos << "REZTIME: Myself rez stats:" << llendl;
 	llinfos << "\t Time from avatar creation to load wearables: " << (S32)mDebugTimeWearablesLoaded << llendl;

indra/newview/llvotree.cpp

 
 void LLVOTree::setPixelAreaAndAngle(LLAgent &agent)
 {
-	// First calculate values as for any other object (for mAppAngle)
-	LLViewerObject::setPixelAreaAndAngle(agent);
-
-	// Re-calculate mPixelArea accurately
+	LLVector3 center = getPositionAgent();//center of tree.
+	LLVector3 viewer_pos_agent = gAgentCamera.getCameraPositionAgent();
+	LLVector3 lookAt = center - viewer_pos_agent;
+	F32 dist = lookAt.normVec() ;	
+	F32 cos_angle_to_view_dir = lookAt * LLViewerCamera::getInstance()->getXAxis() ;	
 	
-	// This should be the camera's center, as soon as we move to all region-local.
-	LLVector3 relative_position = getPositionAgent() - gAgentCamera.getCameraPositionAgent();
-	F32 range_squared = relative_position.lengthSquared() ;				
+	F32 range = dist - getMinScale()/2;
+	if (range < F_ALMOST_ZERO || isHUDAttachment())		// range == zero
+	{
+		mAppAngle = 180.f;
+	}
+	else
+	{
+		mAppAngle = (F32) atan2( getMaxScale(), range) * RAD_TO_DEG;		
+	}
 
 	F32 max_scale = mBillboardScale * getMaxScale();
 	F32 area = max_scale * (max_scale*mBillboardRatio);
+	// Compute pixels per meter at the given range
+	F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() / (tan(LLViewerCamera::getInstance()->getView()) * dist);
+	mPixelArea = pixels_per_meter * pixels_per_meter * area ;	
 
-	// Compute pixels per meter at the given range
-	F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() / tan(LLViewerCamera::getInstance()->getView());
+	F32 importance = LLFace::calcImportanceToCamera(cos_angle_to_view_dir, dist) ;
+	mPixelArea = LLFace::adjustPixelArea(importance, mPixelArea) ;
+	if (mPixelArea > LLViewerCamera::getInstance()->getScreenPixelArea())
+	{
+		mAppAngle = 180.f;
+	}
 
-	mPixelArea = (pixels_per_meter) * (pixels_per_meter) * area / range_squared;
 #if 0
 	// mAppAngle is a bit of voodoo;
 	// use the one calculated LLViewerObject::setPixelAreaAndAngle above

indra/newview/llwearable.cpp

 #include "llvoavatarself.h"
 #include "llvoavatardefines.h"
 #include "llwearable.h"
+#include "llviewercontrol.h"
 
 using namespace LLVOAvatarDefines;
 
 			delete mSavedTEMap[te];
 		}
 
-		image->setLoadedCallback(LLVOAvatarSelf::debugOnTimingLocalTexLoaded,0,TRUE,FALSE, new LLVOAvatarSelf::LLAvatarTexData(id, (LLVOAvatarDefines::ETextureIndex)te), NULL);
-
+		if(gSavedSettings.getBOOL("DebugAvatarLocalTexLoadedTime"))
+		{
+			image->setLoadedCallback(LLVOAvatarSelf::debugOnTimingLocalTexLoaded,0,TRUE,FALSE, new LLVOAvatarSelf::LLAvatarTexData(id, (LLVOAvatarDefines::ETextureIndex)te), NULL);
+		}
 		LLUUID textureid(text_buffer);
 		mTEMap[te] = new LLLocalTextureObject(image, textureid);
 		mSavedTEMap[te] = new LLLocalTextureObject(image, textureid);

indra/newview/skins/default/xui/en/menu_viewer.xml

             <menu_item_call.on_click
              function="BuyCurrency" />
         </menu_item_call>
-
         <menu_item_separator/>
-
         <menu_item_call
          label="My Profile"
          name="Profile">
             <menu_item_call.on_click
              function="Advanced.LeaveAdminStatus" />
         </menu_item_call>
-
         <menu_item_separator/>
-
         <menu_item_call
          label="Exit [APP_NAME]"
          name="Quit"
              function="SideTray.PanelPeopleTab"
              parameter="groups_panel" />
         </menu_item_call>
-
         <menu_item_separator/>
-
         <!--menu_item_call
          label="Chat"
          name="Chat">
              parameter="region_info" />
         </menu_item_call>
         </menu>
-
         <menu_item_separator/>
-
         <menu_item_call
              label="Buy This Land"
              name="Buy Land">
                control="NavBarShowParcelProperties" />
           </menu_item_check>
         </menu>
-
         <menu_item_separator/>
-
 	    <menu_item_call
 	     label="Teleport Home"
 	     name="Teleport Home"
              parameter="ShowNavbarFavoritesPanel" />
         </menu_item_check>
         <menu_item_separator/>-->
-
         <menu_item_separator/>
-
     <menu
          create_jump_keys="true"
          label="Sun"
                  function="World.EnvSettings"
                  parameter="default" />
             </menu_item_call>
-
             <menu_item_separator/>
-
             <menu_item_call
              label="Environment Editor"
              name="Environment Editor">
             </menu_item_call>
         </menu>
         <menu_item_separator/>
-
         <menu_item_call
            label="Focus on Selection"
            name="Focus on Selection"
           <menu_item_call.on_enable
              function="Tools.SomethingSelectedNoHUD" />
         </menu_item_call>
-
         <menu_item_separator/>
-
         <menu
          create_jump_keys="true"
          label="Object"
                function="EditableSelected" />
           </menu_item_call>
         </menu>
-
         <menu_item_separator/>
-
         <menu
          create_jump_keys="true"
          label="Options"
 				 function="ToggleControl"
 				 parameter="DebugPermissions" />
 			</menu_item_check>
-
             <menu_item_separator/>
-
             <menu_item_check
                  label="Select Only My Objects"
                  name="Select Only My Objects">
                     <menu_item_check.on_click
                      function="Tools.SelectBySurrounding" />
             </menu_item_check>
-
           <menu_item_separator/>
-
                 <menu_item_check
                  label="Show Hidden Selection"
                  name="Show Hidden Selection">
                      function="ToggleControl"
                      parameter="ShowSelectionBeam" />
                 </menu_item_check>
-
         <menu_item_separator/>
-
                 <menu_item_check
                  label="Snap to Grid"
                  name="Snap to Grid"
              function="Floater.Show"
              parameter="hud" />
         </menu_item_call>-->
-
         <menu_item_separator/>
-
         <menu_item_call
              label="Report Abuse"
              name="Report Abuse">
                  function="ShowHelp"
                  parameter="report_bug" />
             </menu_item_call>
-
         <menu_item_separator/>
-
         <menu_item_call
          label="About [APP_NAME]"
          name="About Second Life">
      name="Advanced"
      tear_off="true"
      visible="false">
+        <menu_item_check
+         label="Show Advanced Menu"
+         name="Show Advanced Menu"
+         shortcut="control|alt|shift|D">
+          <on_check
+           function="CheckControl"
+           parameter="UseDebugMenus" />
+          <on_click
+           function="ToggleControl"
+           parameter="UseDebugMenus" />
+        </menu_item_check>
         <menu_item_call
          label="Stop Animating Me"
          name="Stop Animating My Avatar">
            function="Floater.Show"
            parameter="window_size" />
         </menu_item_call>
-
         <menu_item_separator/>
-
         <menu_item_check
          label="Limit Select Distance"
          name="Limit Select Distance">
              function="ToggleControl"
              parameter="DisableCameraConstraints" />
         </menu_item_check>
-
         <menu_item_separator/>
-
         <menu_item_check
          label="High-res Snapshot"
          name="HighResSnapshot">
              function="ToggleControl"
              parameter="CompressSnapshotsToDisk" />
         </menu_item_check>
-
         <menu_item_separator/>
-
         <menu
          create_jump_keys="true"
          label="Performance Tools"
                 <menu_item_check.on_click
                  function="View.ShowHoverTips" />
             </menu_item_check>
-
             <menu_item_separator/>
-
             <menu_item_check
              label="Show Land Tooltips"
              name="Land Tips">
                  function="Advanced.ToggleFeature"
                  parameter="flexible" />
             </menu_item_check>
-        </menu>
-        <menu_item_check
-         label="Run Multiple Threads"
-         name="Run Multiple Threads">
-            <menu_item_check.on_check
-             function="CheckControl"
-             parameter="RunMultipleThreads" />
-            <menu_item_check.on_click
-             function="ToggleControl"
-             parameter="RunMultipleThreads" />
-        </menu_item_check>
+        </menu>        
         <menu_item_check
          label="Use Plugin Read Thread"
          name="Use Plugin Read Thread">
              function="ToggleControl"
              parameter="MouseSmooth" />
         </menu_item_check>
-
         <menu_item_separator/>
-
         <menu
          label="Shortcuts"
          name="Shortcuts"
                 <menu_item_call.on_click
                  function="View.DefaultUISize" />
             </menu_item_call>
-
+            <!-- This second, alternative shortcut for Show Advanced Menu is for backward compatibility.  The main shortcut has been changed so it's Linux-friendly, where the old shortcut is typically eaten by the window manager. -->
+            <menu_item_check
+               label="Show Advanced Menu - legacy shortcut"
+               name="Show Advanced Menu - legacy shortcut"
+               shortcut="control|alt|D">
+              <on_check
+		 function="CheckControl"
+		 parameter="UseDebugMenus" />
+              <on_click
+		 function="ToggleControl"
+		 parameter="UseDebugMenus" />
+            </menu_item_check>
             <menu_item_separator/>
-
             <menu_item_check
              label="Always Run"
              name="Always Run"
                 <menu_item_check.on_enable
                  function="Agent.enableFlying" />
             </menu_item_check>
-
             <menu_item_separator/>
-
             <menu_item_call
              label="Close Window"
              name="Close Window"
                 <menu_item_call.on_enable
                  function="File.EnableCloseAllWindows" />
             </menu_item_call>
-
             <menu_item_separator/>
-
             <menu_item_call
              label="Snapshot to Disk"
              name="Snapshot to Disk"
                 <menu_item_call.on_click
                  function="File.TakeSnapshotToDisk" />
             </menu_item_call>
-
             <menu_item_separator/>
-
             <menu_item_call
              label="Mouselook"
              name="Mouselook"
                 <menu_item_call.on_enable
                  function="View.EnableLastChatter" />
             </menu_item_call>
-
             <menu_item_separator/>
-
             <menu
              create_jump_keys="true"
              label="Select Build Tool"
                      parameter="land" />
                 </menu_item_call>
             </menu>
-
             <menu_item_separator/>
-
             <menu_item_call
              label="Zoom In"
              name="Zoom In"
                 <menu_item_call.on_click
                  function="View.ZoomOut" />
             </menu_item_call>
-            <menu_item_separator
-             visible="false"/>
-            <!-- Made invisible to avoid a dissonance: menu item toggle menu where it is located. EXT-8069.
-              Can't be removed to keep sortcut workable.
-            -->
-            <menu_item_check
-             label="Show Advanced Menu"
-             name="Show Advanced Menu"
-             shortcut="control|alt|D"
-             visible="false">
-                <on_check
-                 function="CheckControl"
-                 parameter="UseDebugMenus" />
-                <on_click
-                 function="ToggleControl"
-                 parameter="UseDebugMenus" />
-        </menu_item_check>
-        </menu> <!--Shortcuts-->
-
+        </menu>
         <menu_item_separator/>
-
         <menu_item_call
          label="Show Debug Settings"
          name="Debug Settings">
              function="ToggleControl"
              parameter="QAMode" />
         </menu_item_check>
-    
     </menu>
     <menu
      create_jump_keys="true"
                  function="Advanced.ToggleConsole"
                  parameter="memory view" />
             </menu_item_check>
-
             <menu_item_separator/>
-
             <menu_item_call
              label="Region Info to Debug Console"
              name="Region Info to Debug Console">
                  function="Advanced.DumpInfoToConsole"
                  parameter="capabilities" />
             </menu_item_call>
-
             <menu_item_separator/>
-
             <menu_item_check
              label="Camera"
              name="Camera">
                  function="ToggleControl"
                  parameter="DebugShowColor" />
             </menu_item_check>
-
             <menu_item_separator/>
-
             <menu_item_check
              label="Show Updates to Objects"
              name="Show Updates"
                  function="Advanced.ToggleShowObjectUpdates" />
             </menu_item_check>
         </menu>
-
         <menu_item_separator/>
-
         <menu
          create_jump_keys="true"
          label="Force an Error"
             <menu_item_check.on_enable
                  function="Advanced.EnableRenderFBO" />
            </menu_item_check>
-
-          <menu_item_separator />
-
           <menu_item_check
-                       label="Lighting and Shadows"
-                       name="Lighting and Shadows">
+                       label="Deferred Rendering"
+                       name="Deferred Rendering">
             <menu_item_check.on_check
              function="CheckControl"
              parameter="RenderDeferred" />
                  function="Advanced.EnableRenderDeferred" />
           </menu_item_check>
           <menu_item_check
-                       label="   Shadows from Sun/Moon/Projectors"
-                       name="Shadows from Sun/Moon/Projectors">
-            <menu_item_check.on_check
-             function="Advanced.CheckRenderShadowOption"
-             parameter="RenderShadowDetail" />
-            <menu_item_check.on_click
-             function="Advanced.ClickRenderShadowOption"
-             parameter="RenderShadowDetail" />
-            <menu_item_check.on_enable
-                 function="Advanced.EnableRenderDeferredOptions" />
-          </menu_item_check>
-          <menu_item_check
-                   label="   SSAO and Shadow Smoothing"
-                   name="SSAO and Shadow Smoothing">
-            <menu_item_check.on_check
-             function="CheckControl"
-             parameter="RenderDeferredSSAO" />
-            <menu_item_check.on_click
-             function="ToggleControl"
-             parameter="RenderDeferredSSAO" />
-            <menu_item_check.on_enable
-                 function="Advanced.EnableRenderDeferredOptions" />
-          </menu_item_check>
-          <menu_item_check
-                   label="   Global Illumination (experimental)"
+                   label="Global Illumination"
                    name="Global Illumination">
             <menu_item_check.on_check
              function="CheckControl"
              function="ToggleControl"
              parameter="RenderDeferredGI" />
             <menu_item_check.on_enable
-                 function="Advanced.EnableRenderDeferredOptions" />
+                 function="Advanced.EnableRenderDeferredGI" />
           </menu_item_check>
-
           <menu_item_separator />
-
           <menu_item_check
              label="Debug GL"
              name="Debug GL">
                  parameter="RenderDebugPipeline" />
             </menu_item_check>
             <menu_item_check
-             label="Automatic Alpha Masks (deferred)"
-             name="Automatic Alpha Masks (deferred)">
+             label="Fast Alpha"
+             name="Fast Alpha">
                 <menu_item_check.on_check
                  function="CheckControl"
-                 parameter="RenderAutoMaskAlphaDeferred" />
+                 parameter="RenderFastAlpha" />