aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lldrawpoolwater.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-09-06 18:24:57 -0500
committerJacek Antonelli2008-09-06 18:25:07 -0500
commit798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch)
tree1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/lldrawpoolwater.cpp
parentSecond Life viewer sources 1.20.15 (diff)
downloadmeta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2
meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz
Second Life viewer sources 1.21.0-RC
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/lldrawpoolwater.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/linden/indra/newview/lldrawpoolwater.cpp b/linden/indra/newview/lldrawpoolwater.cpp
index 3a98235..d8303bd 100644
--- a/linden/indra/newview/lldrawpoolwater.cpp
+++ b/linden/indra/newview/lldrawpoolwater.cpp
@@ -51,7 +51,7 @@
51#include "llvowater.h" 51#include "llvowater.h"
52#include "llworld.h" 52#include "llworld.h"
53#include "pipeline.h" 53#include "pipeline.h"
54#include "llglslshader.h" 54#include "llviewershadermgr.h"
55#include "llwaterparammanager.h" 55#include "llwaterparammanager.h"
56 56
57const LLUUID WATER_TEST("2bfd3884-7e27-69b9-ba3a-3e673f680004"); 57const LLUUID WATER_TEST("2bfd3884-7e27-69b9-ba3a-3e673f680004");
@@ -100,8 +100,8 @@ LLDrawPool *LLDrawPoolWater::instancePool()
100 100
101void LLDrawPoolWater::prerender() 101void LLDrawPoolWater::prerender()
102{ 102{
103 mVertexShaderLevel = (gGLManager.mHasCubeMap && LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap")) ? 103 mVertexShaderLevel = (gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps) ?
104 LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_WATER) : 0; 104 LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_WATER) : 0;
105 105
106 // got rid of modulation by light color since it got a little too 106 // got rid of modulation by light color since it got a little too
107 // green at sunset and sl-57047 (underwater turns black at 8:00) 107 // green at sunset and sl-57047 (underwater turns black at 8:00)
@@ -385,7 +385,7 @@ void LLDrawPoolWater::shade()
385 385
386 sTime = (F32)LLFrameTimer::getElapsedSeconds()*0.5f; 386 sTime = (F32)LLFrameTimer::getElapsedSeconds()*0.5f;
387 387
388 S32 reftex = shader->enableTexture(LLShaderMgr::WATER_REFTEX); 388 S32 reftex = shader->enableTexture(LLViewerShaderMgr::WATER_REFTEX);
389 389
390 if (reftex > -1) 390 if (reftex > -1)
391 { 391 {
@@ -395,7 +395,7 @@ void LLDrawPoolWater::shade()
395 } 395 }
396 396
397 //bind normal map 397 //bind normal map
398 S32 bumpTex = shader->enableTexture(LLShaderMgr::BUMP_MAP); 398 S32 bumpTex = shader->enableTexture(LLViewerShaderMgr::BUMP_MAP);
399 399
400 LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); 400 LLWaterParamManager * param_mgr = LLWaterParamManager::instance();
401 401
@@ -410,15 +410,15 @@ void LLDrawPoolWater::shade()
410 mWaterNormp->setMipFilterNearest (mWaterNormp->getMipFilterNearest(), 410 mWaterNormp->setMipFilterNearest (mWaterNormp->getMipFilterNearest(),
411 !gSavedSettings.getBOOL("RenderWaterMipNormal")); 411 !gSavedSettings.getBOOL("RenderWaterMipNormal"));
412 412
413 S32 screentex = shader->enableTexture(LLShaderMgr::WATER_SCREENTEX); 413 S32 screentex = shader->enableTexture(LLViewerShaderMgr::WATER_SCREENTEX);
414 stop_glerror(); 414 stop_glerror();
415 415
416 shader->bind(); 416 shader->bind();
417 417
418 if (screentex > -1) 418 if (screentex > -1)
419 { 419 {
420 shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV); 420 shader->uniform4fv(LLViewerShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV);
421 shader->uniform1f(LLShaderMgr::WATER_FOGDENSITY, 421 shader->uniform1f(LLViewerShaderMgr::WATER_FOGDENSITY,
422 param_mgr->getFogDensity()); 422 param_mgr->getFogDensity());
423 } 423 }
424 424
@@ -427,7 +427,7 @@ void LLDrawPoolWater::shade()
427 if (mVertexShaderLevel == 1) 427 if (mVertexShaderLevel == 1)
428 { 428 {
429 sWaterFogColor.mV[3] = param_mgr->mDensitySliderValue; 429 sWaterFogColor.mV[3] = param_mgr->mDensitySliderValue;
430 shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV); 430 shader->uniform4fv(LLViewerShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV);
431 } 431 }
432 432
433 F32 screenRes[] = 433 F32 screenRes[] =
@@ -438,7 +438,7 @@ void LLDrawPoolWater::shade()
438 shader->uniform2fv("screenRes", 1, screenRes); 438 shader->uniform2fv("screenRes", 1, screenRes);
439 stop_glerror(); 439 stop_glerror();
440 440
441 S32 diffTex = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP); 441 S32 diffTex = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
442 stop_glerror(); 442 stop_glerror();
443 443
444 light_dir.normVec(); 444 light_dir.normVec();
@@ -447,14 +447,14 @@ void LLDrawPoolWater::shade()
447 light_diffuse *= 6.f; 447 light_diffuse *= 6.f;
448 448
449 //shader->uniformMatrix4fv("inverse_ref", 1, GL_FALSE, (GLfloat*) gGLObliqueProjectionInverse.mMatrix); 449 //shader->uniformMatrix4fv("inverse_ref", 1, GL_FALSE, (GLfloat*) gGLObliqueProjectionInverse.mMatrix);
450 shader->uniform1f(LLShaderMgr::WATER_WATERHEIGHT, eyedepth); 450 shader->uniform1f(LLViewerShaderMgr::WATER_WATERHEIGHT, eyedepth);
451 shader->uniform1f(LLShaderMgr::WATER_TIME, sTime); 451 shader->uniform1f(LLViewerShaderMgr::WATER_TIME, sTime);
452 shader->uniform3fv(LLShaderMgr::WATER_EYEVEC, 1, LLViewerCamera::getInstance()->getOrigin().mV); 452 shader->uniform3fv(LLViewerShaderMgr::WATER_EYEVEC, 1, LLViewerCamera::getInstance()->getOrigin().mV);
453 shader->uniform3fv(LLShaderMgr::WATER_SPECULAR, 1, light_diffuse.mV); 453 shader->uniform3fv(LLViewerShaderMgr::WATER_SPECULAR, 1, light_diffuse.mV);
454 shader->uniform1f(LLShaderMgr::WATER_SPECULAR_EXP, light_exp); 454 shader->uniform1f(LLViewerShaderMgr::WATER_SPECULAR_EXP, light_exp);
455 shader->uniform2fv(LLShaderMgr::WATER_WAVE_DIR1, 1, param_mgr->getWave1Dir().mV); 455 shader->uniform2fv(LLViewerShaderMgr::WATER_WAVE_DIR1, 1, param_mgr->getWave1Dir().mV);
456 shader->uniform2fv(LLShaderMgr::WATER_WAVE_DIR2, 1, param_mgr->getWave2Dir().mV); 456 shader->uniform2fv(LLViewerShaderMgr::WATER_WAVE_DIR2, 1, param_mgr->getWave2Dir().mV);
457 shader->uniform3fv(LLShaderMgr::WATER_LIGHT_DIR, 1, light_dir.mV); 457 shader->uniform3fv(LLViewerShaderMgr::WATER_LIGHT_DIR, 1, light_dir.mV);
458 458
459 shader->uniform3fv("normScale", 1, param_mgr->getNormalScale().mV); 459 shader->uniform3fv("normScale", 1, param_mgr->getNormalScale().mV);
460 shader->uniform1f("fresnelScale", param_mgr->getFresnelScale()); 460 shader->uniform1f("fresnelScale", param_mgr->getFresnelScale());
@@ -474,12 +474,12 @@ void LLDrawPoolWater::shade()
474 if (LLViewerCamera::getInstance()->cameraUnderWater()) 474 if (LLViewerCamera::getInstance()->cameraUnderWater())
475 { 475 {
476 water_color.setVec(1.f, 1.f, 1.f, 0.4f); 476 water_color.setVec(1.f, 1.f, 1.f, 0.4f);
477 shader->uniform1f(LLShaderMgr::WATER_REFSCALE, param_mgr->getScaleBelow()); 477 shader->uniform1f(LLViewerShaderMgr::WATER_REFSCALE, param_mgr->getScaleBelow());
478 } 478 }
479 else 479 else
480 { 480 {
481 water_color.setVec(1.f, 1.f, 1.f, 0.5f*(1.f + up_dot)); 481 water_color.setVec(1.f, 1.f, 1.f, 0.5f*(1.f + up_dot));
482 shader->uniform1f(LLShaderMgr::WATER_REFSCALE, param_mgr->getScaleAbove()); 482 shader->uniform1f(LLViewerShaderMgr::WATER_REFSCALE, param_mgr->getScaleAbove());
483 } 483 }
484 484
485 if (water_color.mV[3] > 0.9f) 485 if (water_color.mV[3] > 0.9f)
@@ -527,12 +527,12 @@ void LLDrawPoolWater::shade()
527 } 527 }
528 } 528 }
529 529
530 shader->disableTexture(LLShaderMgr::ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB); 530 shader->disableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB);
531 shader->disableTexture(LLShaderMgr::WATER_SCREENTEX); 531 shader->disableTexture(LLViewerShaderMgr::WATER_SCREENTEX);
532 shader->disableTexture(LLShaderMgr::BUMP_MAP); 532 shader->disableTexture(LLViewerShaderMgr::BUMP_MAP);
533 shader->disableTexture(LLShaderMgr::DIFFUSE_MAP); 533 shader->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
534 shader->disableTexture(LLShaderMgr::WATER_REFTEX); 534 shader->disableTexture(LLViewerShaderMgr::WATER_REFTEX);
535 shader->disableTexture(LLShaderMgr::WATER_SCREENDEPTH); 535 shader->disableTexture(LLViewerShaderMgr::WATER_SCREENDEPTH);
536 shader->unbind(); 536 shader->unbind();
537 537
538 gGL.getTexUnit(0)->activate(); 538 gGL.getTexUnit(0)->activate();