diff options
Diffstat (limited to 'linden/indra/newview/llvotextbubble.cpp')
-rw-r--r-- | linden/indra/newview/llvotextbubble.cpp | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/linden/indra/newview/llvotextbubble.cpp b/linden/indra/newview/llvotextbubble.cpp index f9a12a4..ba53bd3 100644 --- a/linden/indra/newview/llvotextbubble.cpp +++ b/linden/indra/newview/llvotextbubble.cpp | |||
@@ -118,30 +118,16 @@ BOOL LLVOTextBubble::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) | |||
118 | void LLVOTextBubble::updateTextures(LLAgent &agent) | 118 | void LLVOTextBubble::updateTextures(LLAgent &agent) |
119 | { | 119 | { |
120 | // Update the image levels of all textures... | 120 | // Update the image levels of all textures... |
121 | // First we do some quick checks. | ||
122 | U32 i; | ||
123 | 121 | ||
124 | // This doesn't take into account whether the object is in front | 122 | for (U32 i = 0; i < getNumTEs(); i++) |
125 | // or behind... | ||
126 | |||
127 | LLVector3 position_local = getPositionAgent() - agent.getCameraPositionAgent(); | ||
128 | F32 dot_product = position_local * agent.getFrameAgent().getAtAxis(); | ||
129 | F32 cos_angle = dot_product / position_local.length(); | ||
130 | |||
131 | if (cos_angle > 1.f) | ||
132 | { | ||
133 | cos_angle = 1.f; | ||
134 | } | ||
135 | |||
136 | for (i = 0; i < getNumTEs(); i++) | ||
137 | { | 123 | { |
138 | const LLTextureEntry *te = getTE(i); | 124 | const LLTextureEntry *te = getTE(i); |
139 | F32 texel_area_ratio = fabs(te->mScaleS * te->mScaleT); | 125 | F32 texel_area_ratio = fabs(te->mScaleS * te->mScaleT); |
140 | 126 | texel_area_ratio = llclamp(texel_area_ratio, .125f, 16.f); | |
141 | LLViewerImage *imagep = getTEImage(i); | 127 | LLViewerImage *imagep = getTEImage(i); |
142 | if (imagep) | 128 | if (imagep) |
143 | { | 129 | { |
144 | imagep->addTextureStats(mPixelArea, texel_area_ratio, cos_angle); | 130 | imagep->addTextureStats(mPixelArea / texel_area_ratio); |
145 | } | 131 | } |
146 | } | 132 | } |
147 | } | 133 | } |