summaryrefslogtreecommitdiff
path: root/indra/newview/llviewershadermgr.cpp
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-08-13 14:42:07 -0500
committerDave Parks <davep@lindenlab.com>2010-08-13 14:42:07 -0500
commit62943202a7c4334ce7b7be96f8f64133444ee925 (patch)
treede02cd2420d1c21635d468a6e6c21add350c4f1e /indra/newview/llviewershadermgr.cpp
parent340a729d55983110a85cfc55f1ce0a952bfe15b4 (diff)
Make rigged attachments respect under water rendering.
Reviewed by Nyx.
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r--indra/newview/llviewershadermgr.cpp110
1 files changed, 87 insertions, 23 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index e887766492..20e4333209 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -84,9 +84,9 @@ LLGLSLShader gSkinnedObjectFullbrightShinyProgram;
LLGLSLShader gSkinnedObjectShinySimpleProgram;
LLGLSLShader gSkinnedObjectSimpleWaterProgram;
-//LLGLSLShader gSkinnedObjectFullbrightProgram;
-//LLGLSLShader gSkinnedObjectFullbrightShinyProgram;
-//LLGLSLShader gSkinnedObjectShinySimpleProgram;
+LLGLSLShader gSkinnedObjectFullbrightWaterProgram;
+LLGLSLShader gSkinnedObjectFullbrightShinyWaterProgram;
+LLGLSLShader gSkinnedObjectShinySimpleWaterProgram;
//environment shaders
LLGLSLShader gTerrainProgram;
@@ -164,10 +164,13 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
mShaderList.push_back(&gObjectFullbrightProgram);
mShaderList.push_back(&gObjectFullbrightShinyProgram);
mShaderList.push_back(&gSkinnedObjectSimpleProgram);
- mShaderList.push_back(&gSkinnedObjectSimpleWaterProgram);
mShaderList.push_back(&gSkinnedObjectFullbrightProgram);
mShaderList.push_back(&gSkinnedObjectFullbrightShinyProgram);
mShaderList.push_back(&gSkinnedObjectShinySimpleProgram);
+ mShaderList.push_back(&gSkinnedObjectSimpleWaterProgram);
+ mShaderList.push_back(&gSkinnedObjectFullbrightWaterProgram);
+ mShaderList.push_back(&gSkinnedObjectFullbrightShinyWaterProgram);
+ mShaderList.push_back(&gSkinnedObjectShinySimpleWaterProgram);
mShaderList.push_back(&gTerrainProgram);
mShaderList.push_back(&gTerrainWaterProgram);
mShaderList.push_back(&gObjectSimpleWaterProgram);
@@ -576,11 +579,15 @@ void LLViewerShaderMgr::unloadShaders()
gObjectShinyWaterProgram.unload();
gSkinnedObjectSimpleProgram.unload();
- gSkinnedObjectSimpleWaterProgram.unload();
gSkinnedObjectFullbrightProgram.unload();
gSkinnedObjectFullbrightShinyProgram.unload();
gSkinnedObjectShinySimpleProgram.unload();
+ gSkinnedObjectSimpleWaterProgram.unload();
+ gSkinnedObjectFullbrightWaterProgram.unload();
+ gSkinnedObjectFullbrightShinyWaterProgram.unload();
+ gSkinnedObjectShinySimpleWaterProgram.unload();
+
gWaterProgram.unload();
gUnderWaterProgram.unload();
@@ -1306,10 +1313,13 @@ BOOL LLViewerShaderMgr::loadShadersObject()
gObjectFullbrightProgram.unload();
gObjectFullbrightWaterProgram.unload();
gSkinnedObjectSimpleProgram.unload();
- gSkinnedObjectSimpleWaterProgram.unload();
gSkinnedObjectFullbrightProgram.unload();
gSkinnedObjectFullbrightShinyProgram.unload();
gSkinnedObjectShinySimpleProgram.unload();
+ gSkinnedObjectSimpleWaterProgram.unload();
+ gSkinnedObjectFullbrightWaterProgram.unload();
+ gSkinnedObjectFullbrightShinyWaterProgram.unload();
+ gSkinnedObjectShinySimpleWaterProgram.unload();
return FALSE;
}
@@ -1438,23 +1448,6 @@ BOOL LLViewerShaderMgr::loadShadersObject()
if (success)
{
- gSkinnedObjectSimpleWaterProgram.mName = "Skinned Simple Water Shader";
- gSkinnedObjectSimpleWaterProgram.mFeatures.calculatesLighting = true;
- gSkinnedObjectSimpleWaterProgram.mFeatures.calculatesAtmospherics = true;
- gSkinnedObjectSimpleWaterProgram.mFeatures.hasGamma = true;
- gSkinnedObjectSimpleWaterProgram.mFeatures.hasAtmospherics = true;
- gSkinnedObjectSimpleWaterProgram.mFeatures.hasLighting = true;
- gSkinnedObjectSimpleWaterProgram.mFeatures.hasWaterFog = true;
- gSkinnedObjectSimpleWaterProgram.mFeatures.hasObjectSkinning = true;
- gSkinnedObjectSimpleWaterProgram.mShaderFiles.clear();
- gSkinnedObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleSkinnedV.glsl", GL_VERTEX_SHADER_ARB));
- gSkinnedObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
- gSkinnedObjectSimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
- success = gSkinnedObjectSimpleWaterProgram.createShader(NULL, NULL);
- }
-
- if (success)
- {
gSkinnedObjectFullbrightProgram.mName = "Skinned Fullbright Shader";
gSkinnedObjectFullbrightProgram.mFeatures.calculatesAtmospherics = true;
gSkinnedObjectFullbrightProgram.mFeatures.hasGamma = true;
@@ -1500,6 +1493,77 @@ BOOL LLViewerShaderMgr::loadShadersObject()
success = gSkinnedObjectShinySimpleProgram.createShader(NULL, &mShinyUniforms);
}
+ if (success)
+ {
+ gSkinnedObjectSimpleWaterProgram.mName = "Skinned Simple Water Shader";
+ gSkinnedObjectSimpleWaterProgram.mFeatures.calculatesLighting = true;
+ gSkinnedObjectSimpleWaterProgram.mFeatures.calculatesAtmospherics = true;
+ gSkinnedObjectSimpleWaterProgram.mFeatures.hasGamma = true;
+ gSkinnedObjectSimpleWaterProgram.mFeatures.hasAtmospherics = true;
+ gSkinnedObjectSimpleWaterProgram.mFeatures.hasLighting = true;
+ gSkinnedObjectSimpleWaterProgram.mFeatures.hasWaterFog = true;
+ gSkinnedObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
+ gSkinnedObjectSimpleWaterProgram.mFeatures.hasObjectSkinning = true;
+ gSkinnedObjectSimpleWaterProgram.mShaderFiles.clear();
+ gSkinnedObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleSkinnedV.glsl", GL_VERTEX_SHADER_ARB));
+ gSkinnedObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
+ gSkinnedObjectSimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+ success = gSkinnedObjectSimpleWaterProgram.createShader(NULL, NULL);
+ }
+
+ if (success)
+ {
+ gSkinnedObjectFullbrightWaterProgram.mName = "Skinned Fullbright Water Shader";
+ gSkinnedObjectFullbrightWaterProgram.mFeatures.calculatesAtmospherics = true;
+ gSkinnedObjectFullbrightWaterProgram.mFeatures.hasGamma = true;
+ gSkinnedObjectFullbrightWaterProgram.mFeatures.hasTransport = true;
+ gSkinnedObjectFullbrightWaterProgram.mFeatures.isFullbright = true;
+ gSkinnedObjectFullbrightWaterProgram.mFeatures.hasObjectSkinning = true;
+ gSkinnedObjectFullbrightWaterProgram.mFeatures.hasWaterFog = true;
+ gSkinnedObjectFullbrightWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
+ gSkinnedObjectFullbrightWaterProgram.mShaderFiles.clear();
+ gSkinnedObjectFullbrightWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightSkinnedV.glsl", GL_VERTEX_SHADER_ARB));
+ gSkinnedObjectFullbrightWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
+ gSkinnedObjectFullbrightWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+ success = gSkinnedObjectFullbrightWaterProgram.createShader(NULL, NULL);
+ }
+
+ if (success)
+ {
+ gSkinnedObjectFullbrightShinyWaterProgram.mName = "Skinned Fullbright Shiny Water Shader";
+ gSkinnedObjectFullbrightShinyWaterProgram.mFeatures.calculatesAtmospherics = true;
+ gSkinnedObjectFullbrightShinyWaterProgram.mFeatures.hasGamma = true;
+ gSkinnedObjectFullbrightShinyWaterProgram.mFeatures.hasTransport = true;
+ gSkinnedObjectFullbrightShinyWaterProgram.mFeatures.isShiny = true;
+ gSkinnedObjectFullbrightShinyWaterProgram.mFeatures.isFullbright = true;
+ gSkinnedObjectFullbrightShinyWaterProgram.mFeatures.hasObjectSkinning = true;
+ gSkinnedObjectFullbrightShinyWaterProgram.mFeatures.hasWaterFog = true;
+ gSkinnedObjectFullbrightShinyWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
+ gSkinnedObjectFullbrightShinyWaterProgram.mShaderFiles.clear();
+ gSkinnedObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinySkinnedV.glsl", GL_VERTEX_SHADER_ARB));
+ gSkinnedObjectFullbrightShinyWaterProgram.mShaderFiles.push_back(make_pair("objects/fullbrightWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
+ gSkinnedObjectFullbrightShinyWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+ success = gSkinnedObjectFullbrightShinyWaterProgram.createShader(NULL, &mShinyUniforms);
+ }
+
+ if (success)
+ {
+ gSkinnedObjectShinySimpleWaterProgram.mName = "Skinned Shiny Simple Water Shader";
+ gSkinnedObjectShinySimpleWaterProgram.mFeatures.calculatesLighting = true;
+ gSkinnedObjectShinySimpleWaterProgram.mFeatures.calculatesAtmospherics = true;
+ gSkinnedObjectShinySimpleWaterProgram.mFeatures.hasGamma = true;
+ gSkinnedObjectShinySimpleWaterProgram.mFeatures.hasAtmospherics = true;
+ gSkinnedObjectShinySimpleWaterProgram.mFeatures.hasObjectSkinning = true;
+ gSkinnedObjectShinySimpleWaterProgram.mFeatures.isShiny = true;
+ gSkinnedObjectShinySimpleWaterProgram.mFeatures.hasWaterFog = true;
+ gSkinnedObjectShinySimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
+ gSkinnedObjectShinySimpleWaterProgram.mShaderFiles.clear();
+ gSkinnedObjectShinySimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/shinySimpleSkinnedV.glsl", GL_VERTEX_SHADER_ARB));
+ gSkinnedObjectShinySimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/shinyWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
+ gSkinnedObjectShinySimpleWaterProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT];
+ success = gSkinnedObjectShinySimpleWaterProgram.createShader(NULL, &mShinyUniforms);
+ }
+
if( !success )
{
mVertexShaderLevel[SHADER_OBJECT] = 0;