summaryrefslogtreecommitdiff
path: root/indra/newview/llviewershadermgr.cpp
diff options
context:
space:
mode:
authorGraham Madarasz (Graham) <graham@lindenlab.com>2013-07-11 16:21:23 -0700
committerGraham Madarasz (Graham) <graham@lindenlab.com>2013-07-11 16:21:23 -0700
commitfbf3d8b78137a5229ccfabd1e42a0712d92b061f (patch)
tree54be4abc8d7ca079be78f65d9f9b39a0da54d009 /indra/newview/llviewershadermgr.cpp
parentd7856f09999206be489183f52ae2f33020a68538 (diff)
NORSPEC-291 WIP materials underwater with haze, reflection broken, water dist broken
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rwxr-xr-xindra/newview/llviewershadermgr.cpp50
1 files changed, 17 insertions, 33 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 88593346c0..3df8115402 100755
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -168,7 +168,6 @@ LLGLSLShader gPostNightVisionProgram;
// Deferred rendering shaders
LLGLSLShader gDeferredImpostorProgram;
LLGLSLShader gDeferredWaterProgram;
-LLGLSLShader gDeferredUnderWaterProgram;
LLGLSLShader gDeferredDiffuseProgram;
LLGLSLShader gDeferredDiffuseAlphaMaskProgram;
LLGLSLShader gDeferredNonIndexedDiffuseProgram;
@@ -285,21 +284,21 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
mShaderList.push_back(&gDeferredSoftenProgram);
mShaderList.push_back(&gDeferredSoftenWaterProgram);
mShaderList.push_back(&gDeferredMaterialProgram[1]);
- mShaderList.push_back(&gDeferredMaterialWaterProgram[1]);
mShaderList.push_back(&gDeferredMaterialProgram[5]);
- mShaderList.push_back(&gDeferredMaterialWaterProgram[5]);
mShaderList.push_back(&gDeferredMaterialProgram[9]);
- mShaderList.push_back(&gDeferredMaterialWaterProgram[9]);
mShaderList.push_back(&gDeferredMaterialProgram[13]);
- mShaderList.push_back(&gDeferredMaterialWaterProgram[13]);
mShaderList.push_back(&gDeferredMaterialProgram[1+LLMaterial::SHADER_COUNT]);
- mShaderList.push_back(&gDeferredMaterialWaterProgram[1+LLMaterial::SHADER_COUNT]);
mShaderList.push_back(&gDeferredMaterialProgram[5+LLMaterial::SHADER_COUNT]);
- mShaderList.push_back(&gDeferredMaterialWaterProgram[5+LLMaterial::SHADER_COUNT]);
mShaderList.push_back(&gDeferredMaterialProgram[9+LLMaterial::SHADER_COUNT]);
- mShaderList.push_back(&gDeferredMaterialWaterProgram[9+LLMaterial::SHADER_COUNT]);
mShaderList.push_back(&gDeferredMaterialProgram[13+LLMaterial::SHADER_COUNT]);
- mShaderList.push_back(&gDeferredMaterialWaterProgram[13+LLMaterial::SHADER_COUNT]);
+ mShaderList.push_back(&gDeferredMaterialWaterProgram[1]);
+ mShaderList.push_back(&gDeferredMaterialWaterProgram[5]);
+ mShaderList.push_back(&gDeferredMaterialWaterProgram[9]);
+ mShaderList.push_back(&gDeferredMaterialWaterProgram[13]);
+ mShaderList.push_back(&gDeferredMaterialWaterProgram[1+LLMaterial::SHADER_COUNT]);
+ mShaderList.push_back(&gDeferredMaterialWaterProgram[5+LLMaterial::SHADER_COUNT]);
+ mShaderList.push_back(&gDeferredMaterialWaterProgram[9+LLMaterial::SHADER_COUNT]);
+ mShaderList.push_back(&gDeferredMaterialWaterProgram[13+LLMaterial::SHADER_COUNT]);
mShaderList.push_back(&gDeferredAlphaProgram);
mShaderList.push_back(&gDeferredSkinnedAlphaProgram);
mShaderList.push_back(&gDeferredFullbrightProgram);
@@ -1154,7 +1153,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredPostGammaCorrectProgram.unload();
gFXAAProgram.unload();
gDeferredWaterProgram.unload();
- gDeferredUnderWaterProgram.unload();
gDeferredWLSkyProgram.unload();
gDeferredWLCloudProgram.unload();
gDeferredStarProgram.unload();
@@ -1332,7 +1330,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
if (success)
{
- gDeferredMaterialProgram[i].mName = llformat("Deferred Material Shader %d", i);
+ gDeferredMaterialWaterProgram[i].mName = llformat("Deferred Underwater Material Shader %d", i);
U32 alpha_mode = i & 0x3;
@@ -1340,23 +1338,22 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredMaterialWaterProgram[i].mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredMaterialWaterProgram[i].mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredMaterialWaterProgram[i].mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
+ gDeferredMaterialWaterProgram[i].mShaderGroup = LLGLSLShader::SG_WATER;
+
gDeferredMaterialWaterProgram[i].addPermutation("HAS_NORMAL_MAP", i & 0x8? "1" : "0");
gDeferredMaterialWaterProgram[i].addPermutation("HAS_SPECULAR_MAP", i & 0x4 ? "1" : "0");
gDeferredMaterialWaterProgram[i].addPermutation("DIFFUSE_ALPHA_MODE", llformat("%d", alpha_mode));
gDeferredMaterialWaterProgram[i].addPermutation("HAS_SUN_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0");
bool has_skin = i & 0x10;
gDeferredMaterialWaterProgram[i].addPermutation("HAS_SKIN",has_skin ? "1" : "0");
-
gDeferredMaterialWaterProgram[i].addPermutation("WATER_FOG","1");
- gDeferredMaterialWaterProgram[i].mFeatures.hasWaterFog = true;
- gDeferredMaterialWaterProgram[i].mShaderGroup = SHADER_WATER;
if (has_skin)
{
gDeferredMaterialWaterProgram[i].mFeatures.hasObjectSkinning = true;
}
- success = gDeferredMaterialWaterProgram[i].createShader(NULL, NULL);
+ success = gDeferredMaterialWaterProgram[i].createShader(NULL, NULL);//&mWLUniforms);
}
}
@@ -1377,6 +1374,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredMaterialWaterProgram[5+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = true;
gDeferredMaterialWaterProgram[9+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = true;
gDeferredMaterialWaterProgram[13+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = true;
+
if (success)
{
@@ -1644,21 +1642,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
if (success)
{
- // load water shader
- /*gDeferredUnderWaterProgram.mName = "Deferred Under Water Shader";
- gDeferredUnderWaterProgram.mFeatures.calculatesAtmospherics = true;
- gDeferredUnderWaterProgram.mFeatures.hasGamma = true;
- gDeferredUnderWaterProgram.mShaderFiles.clear();
- gDeferredUnderWaterProgram.mShaderFiles.push_back(make_pair("deferred/waterV.glsl", GL_VERTEX_SHADER_ARB));
- gDeferredUnderWaterProgram.mShaderFiles.push_back(make_pair("deferred/underWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
- gDeferredUnderWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_WATER];
- gDeferredUnderWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
-
- success = gDeferredUnderWaterProgram.createShader(NULL, &mWaterUniforms);*/
- }
-
- if (success)
- {
gDeferredSoftenProgram.mName = "Deferred Soften Shader";
gDeferredSoftenProgram.mShaderFiles.clear();
gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightV.glsl", GL_VERTEX_SHADER_ARB));
@@ -1677,21 +1660,21 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
if (success)
{
gDeferredSoftenWaterProgram.mName = "Deferred Soften Underwater Shader";
- gDeferredSoftenWaterProgram.mFeatures.hasWaterFog = true;
gDeferredSoftenWaterProgram.mShaderFiles.clear();
+
gDeferredSoftenWaterProgram.mShaderFiles.push_back(make_pair("deferred/softenLightV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredSoftenWaterProgram.mShaderFiles.push_back(make_pair("deferred/softenLightF.glsl", GL_FRAGMENT_SHADER_ARB));
gDeferredSoftenWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED];
gDeferredSoftenWaterProgram.addPermutation("WATER_FOG", "1");
- gDeferredSoftenWaterProgram.mShaderGroup = SHADER_WATER;
+ gDeferredSoftenWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
if (gSavedSettings.getBOOL("RenderDeferredSSAO"))
{ //if using SSAO, take screen space light map into account as if shadows are enabled
gDeferredSoftenWaterProgram.mShaderLevel = llmax(gDeferredSoftenWaterProgram.mShaderLevel, 2);
}
- success = gDeferredSoftenWaterProgram.createShader(NULL, NULL);
+ success = gDeferredSoftenWaterProgram.createShader(NULL, &mWLUniforms);
}
if (success)
@@ -3275,3 +3258,4 @@ LLViewerShaderMgr::shader_iter LLViewerShaderMgr::endShaders() const
{
return mShaderList.end();
}
+