aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lldrawpoolwater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/lldrawpoolwater.cpp')
-rw-r--r--linden/indra/newview/lldrawpoolwater.cpp33
1 files changed, 2 insertions, 31 deletions
diff --git a/linden/indra/newview/lldrawpoolwater.cpp b/linden/indra/newview/lldrawpoolwater.cpp
index 922a5d8..231d0e1 100644
--- a/linden/indra/newview/lldrawpoolwater.cpp
+++ b/linden/indra/newview/lldrawpoolwater.cpp
@@ -163,17 +163,11 @@ void LLDrawPoolWater::render(S32 pass)
163 163
164 LLGLDisable cullFace(GL_CULL_FACE); 164 LLGLDisable cullFace(GL_CULL_FACE);
165 165
166 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
167 glEnableClientState(GL_VERTEX_ARRAY);
168 glEnableClientState(GL_NORMAL_ARRAY);
169
170 // Set up second pass first 166 // Set up second pass first
171 glActiveTextureARB(GL_TEXTURE1_ARB);
172 mWaterImagep->addTextureStats(1024.f*1024.f); 167 mWaterImagep->addTextureStats(1024.f*1024.f);
173 mWaterImagep->bind(1); 168 mWaterImagep->bind(1);
174 169 glActiveTextureARB(GL_TEXTURE1_ARB);
175 glClientActiveTextureARB(GL_TEXTURE1_ARB); 170
176 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
177 glEnable(GL_TEXTURE_2D); // Texture unit 1 171 glEnable(GL_TEXTURE_2D); // Texture unit 1
178 172
179 LLVector3 camera_up = LLViewerCamera::getInstance()->getUpAxis(); 173 LLVector3 camera_up = LLViewerCamera::getInstance()->getUpAxis();
@@ -215,7 +209,6 @@ void LLDrawPoolWater::render(S32 pass)
215 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS_ARB); 209 glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_ALPHA_ARB, GL_PREVIOUS_ARB);
216 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA); 210 glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_ALPHA_ARB, GL_SRC_ALPHA);
217 211
218 glClientActiveTextureARB(GL_TEXTURE0_ARB);
219 glActiveTextureARB(GL_TEXTURE0_ARB); 212 glActiveTextureARB(GL_TEXTURE0_ARB);
220 213
221 glClearStencil(1); 214 glClearStencil(1);
@@ -234,11 +227,9 @@ void LLDrawPoolWater::render(S32 pass)
234 } 227 }
235 face->bindTexture(); 228 face->bindTexture();
236 face->renderIndexed(); 229 face->renderIndexed();
237 mIndicesDrawn += face->getIndicesCount();
238 } 230 }
239 231
240 // Now, disable texture coord generation on texture state 1 232 // Now, disable texture coord generation on texture state 1
241 glClientActiveTextureARB(GL_TEXTURE1_ARB);
242 glActiveTextureARB(GL_TEXTURE1_ARB); 233 glActiveTextureARB(GL_TEXTURE1_ARB);
243 glDisable(GL_TEXTURE_2D); // Texture unit 1 234 glDisable(GL_TEXTURE_2D); // Texture unit 1
244 glDisable(GL_TEXTURE_GEN_S); //texture unit 1 235 glDisable(GL_TEXTURE_GEN_S); //texture unit 1
@@ -246,11 +237,9 @@ void LLDrawPoolWater::render(S32 pass)
246 LLImageGL::unbindTexture(1, GL_TEXTURE_2D); 237 LLImageGL::unbindTexture(1, GL_TEXTURE_2D);
247 238
248 // Disable texture coordinate and color arrays 239 // Disable texture coordinate and color arrays
249 glClientActiveTextureARB(GL_TEXTURE0_ARB);
250 glActiveTextureARB(GL_TEXTURE0_ARB); 240 glActiveTextureARB(GL_TEXTURE0_ARB);
251 LLImageGL::unbindTexture(0, GL_TEXTURE_2D); 241 LLImageGL::unbindTexture(0, GL_TEXTURE_2D);
252 242
253 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
254 stop_glerror(); 243 stop_glerror();
255 244
256 if (gSky.mVOSkyp->getCubeMap()) 245 if (gSky.mVOSkyp->getCubeMap())
@@ -284,7 +273,6 @@ void LLDrawPoolWater::render(S32 pass)
284 if (face->getGeomCount() > 0) 273 if (face->getGeomCount() > 0)
285 { 274 {
286 face->renderIndexed(); 275 face->renderIndexed();
287 mIndicesDrawn += face->getIndicesCount();
288 } 276 }
289 } 277 }
290 278
@@ -310,9 +298,6 @@ void LLDrawPoolWater::render(S32 pass)
310 renderReflection(refl_face); 298 renderReflection(refl_face);
311 } 299 }
312 300
313 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
314 glDisableClientState(GL_NORMAL_ARRAY);
315
316 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 301 glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
317} 302}
318 303
@@ -338,16 +323,10 @@ void LLDrawPoolWater::renderReflection(LLFace* face)
338 323
339 LLGLSNoFog noFog; 324 LLGLSNoFog noFog;
340 325
341 glEnableClientState(GL_VERTEX_ARRAY);
342 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
343
344 LLViewerImage::bindTexture(mHBTex[dr]); 326 LLViewerImage::bindTexture(mHBTex[dr]);
345 327
346 LLOverrideFaceColor override(this, face->getFaceColor().mV); 328 LLOverrideFaceColor override(this, face->getFaceColor().mV);
347 face->renderIndexed(); 329 face->renderIndexed();
348 mIndicesDrawn += face->getIndicesCount();
349
350 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
351} 330}
352 331
353void LLDrawPoolWater::shade() 332void LLDrawPoolWater::shade()
@@ -361,10 +340,6 @@ void LLDrawPoolWater::shade()
361 return; 340 return;
362 } 341 }
363 342
364 glEnableClientState(GL_TEXTURE_COORD_ARRAY);
365 glEnableClientState(GL_VERTEX_ARRAY);
366 glEnableClientState(GL_NORMAL_ARRAY);
367
368 LLGLDisable blend(GL_BLEND); 343 LLGLDisable blend(GL_BLEND);
369 344
370 LLColor3 light_diffuse(0,0,0); 345 LLColor3 light_diffuse(0,0,0);
@@ -562,8 +537,6 @@ void LLDrawPoolWater::shade()
562 face->renderIndexed(); 537 face->renderIndexed();
563 } 538 }
564 } 539 }
565
566 mIndicesDrawn += face->getIndicesCount();
567 } 540 }
568 } 541 }
569 542
@@ -576,8 +549,6 @@ void LLDrawPoolWater::shade()
576 shader->unbind(); 549 shader->unbind();
577 550
578 glActiveTextureARB(GL_TEXTURE0_ARB); 551 glActiveTextureARB(GL_TEXTURE0_ARB);
579 glClientActiveTextureARB(GL_TEXTURE0_ARB);
580 glDisableClientState(GL_TEXTURE_COORD_ARRAY);
581 glEnable(GL_TEXTURE_2D); 552 glEnable(GL_TEXTURE_2D);
582 glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_FALSE); 553 glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_FALSE);
583 554