diff options
Diffstat (limited to 'indra/newview/lldrawpoolwater.cpp')
-rw-r--r-- | indra/newview/lldrawpoolwater.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index e76423c8eb..f7770f001c 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -51,7 +51,7 @@ #include "llvowater.h" #include "llworld.h" #include "pipeline.h" -#include "llglslshader.h" +#include "llviewershadermgr.h" #include "llwaterparammanager.h" const LLUUID WATER_TEST("2bfd3884-7e27-69b9-ba3a-3e673f680004"); @@ -100,8 +100,8 @@ LLDrawPool *LLDrawPoolWater::instancePool() void LLDrawPoolWater::prerender() { - mVertexShaderLevel = (gGLManager.mHasCubeMap && LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap")) ? - LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_WATER) : 0; + mVertexShaderLevel = (gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps) ? + LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_WATER) : 0; // got rid of modulation by light color since it got a little too // green at sunset and sl-57047 (underwater turns black at 8:00) @@ -385,7 +385,7 @@ void LLDrawPoolWater::shade() sTime = (F32)LLFrameTimer::getElapsedSeconds()*0.5f; - S32 reftex = shader->enableTexture(LLShaderMgr::WATER_REFTEX); + S32 reftex = shader->enableTexture(LLViewerShaderMgr::WATER_REFTEX); if (reftex > -1) { @@ -395,7 +395,7 @@ void LLDrawPoolWater::shade() } //bind normal map - S32 bumpTex = shader->enableTexture(LLShaderMgr::BUMP_MAP); + S32 bumpTex = shader->enableTexture(LLViewerShaderMgr::BUMP_MAP); LLWaterParamManager * param_mgr = LLWaterParamManager::instance(); @@ -410,15 +410,15 @@ void LLDrawPoolWater::shade() mWaterNormp->setMipFilterNearest (mWaterNormp->getMipFilterNearest(), !gSavedSettings.getBOOL("RenderWaterMipNormal")); - S32 screentex = shader->enableTexture(LLShaderMgr::WATER_SCREENTEX); + S32 screentex = shader->enableTexture(LLViewerShaderMgr::WATER_SCREENTEX); stop_glerror(); shader->bind(); if (screentex > -1) { - shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV); - shader->uniform1f(LLShaderMgr::WATER_FOGDENSITY, + shader->uniform4fv(LLViewerShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV); + shader->uniform1f(LLViewerShaderMgr::WATER_FOGDENSITY, param_mgr->getFogDensity()); } @@ -427,7 +427,7 @@ void LLDrawPoolWater::shade() if (mVertexShaderLevel == 1) { sWaterFogColor.mV[3] = param_mgr->mDensitySliderValue; - shader->uniform4fv(LLShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV); + shader->uniform4fv(LLViewerShaderMgr::WATER_FOGCOLOR, 1, sWaterFogColor.mV); } F32 screenRes[] = @@ -438,7 +438,7 @@ void LLDrawPoolWater::shade() shader->uniform2fv("screenRes", 1, screenRes); stop_glerror(); - S32 diffTex = shader->enableTexture(LLShaderMgr::DIFFUSE_MAP); + S32 diffTex = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); stop_glerror(); light_dir.normVec(); @@ -447,14 +447,14 @@ void LLDrawPoolWater::shade() light_diffuse *= 6.f; //shader->uniformMatrix4fv("inverse_ref", 1, GL_FALSE, (GLfloat*) gGLObliqueProjectionInverse.mMatrix); - shader->uniform1f(LLShaderMgr::WATER_WATERHEIGHT, eyedepth); - shader->uniform1f(LLShaderMgr::WATER_TIME, sTime); - shader->uniform3fv(LLShaderMgr::WATER_EYEVEC, 1, LLViewerCamera::getInstance()->getOrigin().mV); - shader->uniform3fv(LLShaderMgr::WATER_SPECULAR, 1, light_diffuse.mV); - shader->uniform1f(LLShaderMgr::WATER_SPECULAR_EXP, light_exp); - shader->uniform2fv(LLShaderMgr::WATER_WAVE_DIR1, 1, param_mgr->getWave1Dir().mV); - shader->uniform2fv(LLShaderMgr::WATER_WAVE_DIR2, 1, param_mgr->getWave2Dir().mV); - shader->uniform3fv(LLShaderMgr::WATER_LIGHT_DIR, 1, light_dir.mV); + shader->uniform1f(LLViewerShaderMgr::WATER_WATERHEIGHT, eyedepth); + shader->uniform1f(LLViewerShaderMgr::WATER_TIME, sTime); + shader->uniform3fv(LLViewerShaderMgr::WATER_EYEVEC, 1, LLViewerCamera::getInstance()->getOrigin().mV); + shader->uniform3fv(LLViewerShaderMgr::WATER_SPECULAR, 1, light_diffuse.mV); + shader->uniform1f(LLViewerShaderMgr::WATER_SPECULAR_EXP, light_exp); + shader->uniform2fv(LLViewerShaderMgr::WATER_WAVE_DIR1, 1, param_mgr->getWave1Dir().mV); + shader->uniform2fv(LLViewerShaderMgr::WATER_WAVE_DIR2, 1, param_mgr->getWave2Dir().mV); + shader->uniform3fv(LLViewerShaderMgr::WATER_LIGHT_DIR, 1, light_dir.mV); shader->uniform3fv("normScale", 1, param_mgr->getNormalScale().mV); shader->uniform1f("fresnelScale", param_mgr->getFresnelScale()); @@ -474,12 +474,12 @@ void LLDrawPoolWater::shade() if (LLViewerCamera::getInstance()->cameraUnderWater()) { water_color.setVec(1.f, 1.f, 1.f, 0.4f); - shader->uniform1f(LLShaderMgr::WATER_REFSCALE, param_mgr->getScaleBelow()); + shader->uniform1f(LLViewerShaderMgr::WATER_REFSCALE, param_mgr->getScaleBelow()); } else { water_color.setVec(1.f, 1.f, 1.f, 0.5f*(1.f + up_dot)); - shader->uniform1f(LLShaderMgr::WATER_REFSCALE, param_mgr->getScaleAbove()); + shader->uniform1f(LLViewerShaderMgr::WATER_REFSCALE, param_mgr->getScaleAbove()); } if (water_color.mV[3] > 0.9f) @@ -527,12 +527,12 @@ void LLDrawPoolWater::shade() } } - shader->disableTexture(LLShaderMgr::ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB); - shader->disableTexture(LLShaderMgr::WATER_SCREENTEX); - shader->disableTexture(LLShaderMgr::BUMP_MAP); - shader->disableTexture(LLShaderMgr::DIFFUSE_MAP); - shader->disableTexture(LLShaderMgr::WATER_REFTEX); - shader->disableTexture(LLShaderMgr::WATER_SCREENDEPTH); + shader->disableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, GL_TEXTURE_CUBE_MAP_ARB); + shader->disableTexture(LLViewerShaderMgr::WATER_SCREENTEX); + shader->disableTexture(LLViewerShaderMgr::BUMP_MAP); + shader->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); + shader->disableTexture(LLViewerShaderMgr::WATER_REFTEX); + shader->disableTexture(LLViewerShaderMgr::WATER_SCREENDEPTH); shader->unbind(); gGL.getTexUnit(0)->activate(); |