summaryrefslogtreecommitdiff
path: root/indra/newview/llviewershadermgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r--indra/newview/llviewershadermgr.cpp179
1 files changed, 2 insertions, 177 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 5adc26dc73..61ccc1d43f 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -618,30 +618,12 @@ std::string LLViewerShaderMgr::loadBasicShaders()
attribs["MAX_JOINTS_PER_MESH_OBJECT"] =
boost::lexical_cast<std::string>(LLSkinningUtil::getMaxJointCount());
- BOOL ambient_kill = gSavedSettings.getBOOL("AmbientDisable");
- BOOL sunlight_kill = gSavedSettings.getBOOL("SunlightDisable");
- BOOL local_light_kill = gSavedSettings.getBOOL("LocalLightDisable");
BOOL ssr = gSavedSettings.getBOOL("RenderScreenSpaceReflections");
bool has_reflection_probes = gSavedSettings.getBOOL("RenderReflectionsEnabled") && gGLManager.mGLVersion > 3.99f;
S32 probe_level = llclamp(gSavedSettings.getS32("RenderReflectionProbeLevel"), 0, 3);
- if (ambient_kill)
- {
- attribs["AMBIENT_KILL"] = "1";
- }
-
- if (sunlight_kill)
- {
- attribs["SUNLIGHT_KILL"] = "1";
- }
-
- if (local_light_kill)
- {
- attribs["LOCAL_LIGHT_KILL"] = "1";
- }
-
S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail");
if (shadow_detail >= 1)
@@ -911,10 +893,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
bool use_sun_shadow = mShaderLevel[SHADER_DEFERRED] > 1 &&
gSavedSettings.getS32("RenderShadowDetail") > 0;
- BOOL ambient_kill = gSavedSettings.getBOOL("AmbientDisable");
- BOOL sunlight_kill = gSavedSettings.getBOOL("SunlightDisable");
- BOOL local_light_kill = gSavedSettings.getBOOL("LocalLightDisable");
-
if (mShaderLevel[SHADER_DEFERRED] == 0)
{
gDeferredTreeProgram.unload();
@@ -1145,21 +1123,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredMaterialProgram[i].addPermutation("HAS_SPECULAR_MAP", "1");
}
- if (ambient_kill)
- {
- gDeferredMaterialProgram[i].addPermutation("AMBIENT_KILL", "1");
- }
-
- if (sunlight_kill)
- {
- gDeferredMaterialProgram[i].addPermutation("SUNLIGHT_KILL", "1");
- }
-
- if (local_light_kill)
- {
- gDeferredMaterialProgram[i].addPermutation("LOCAL_LIGHT_KILL", "1");
- }
-
gDeferredMaterialProgram[i].addPermutation("DIFFUSE_ALPHA_MODE", llformat("%d", alpha_mode));
if (alpha_mode != 0)
@@ -1248,21 +1211,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
}
gDeferredMaterialWaterProgram[i].addPermutation("WATER_FOG","1");
- if (ambient_kill)
- {
- gDeferredMaterialWaterProgram[i].addPermutation("AMBIENT_KILL", "1");
- }
-
- if (sunlight_kill)
- {
- gDeferredMaterialWaterProgram[i].addPermutation("SUNLIGHT_KILL", "1");
- }
-
- if (local_light_kill)
- {
- gDeferredMaterialWaterProgram[i].addPermutation("LOCAL_LIGHT_KILL", "1");
- }
-
gDeferredMaterialWaterProgram[i].mFeatures.hasReflectionProbes = true;
gDeferredMaterialWaterProgram[i].mFeatures.hasWaterFog = true;
gDeferredMaterialWaterProgram[i].mFeatures.hasSrgb = true;
@@ -1547,21 +1495,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredLightProgram.clearPermutations();
- if (ambient_kill)
- {
- gDeferredLightProgram.addPermutation("AMBIENT_KILL", "1");
- }
-
- if (sunlight_kill)
- {
- gDeferredLightProgram.addPermutation("SUNLIGHT_KILL", "1");
- }
-
- if (local_light_kill)
- {
- gDeferredLightProgram.addPermutation("LOCAL_LIGHT_KILL", "1");
- }
-
success = gDeferredLightProgram.createShader(NULL, NULL);
llassert(success);
}
@@ -1582,21 +1515,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredMultiLightProgram[i].mShaderLevel = mShaderLevel[SHADER_DEFERRED];
gDeferredMultiLightProgram[i].addPermutation("LIGHT_COUNT", llformat("%d", i+1));
- if (ambient_kill)
- {
- gDeferredMultiLightProgram[i].addPermutation("AMBIENT_KILL", "1");
- }
-
- if (sunlight_kill)
- {
- gDeferredMultiLightProgram[i].addPermutation("SUNLIGHT_KILL", "1");
- }
-
- if (local_light_kill)
- {
- gDeferredMultiLightProgram[i].addPermutation("LOCAL_LIGHT_KILL", "1");
- }
-
success = gDeferredMultiLightProgram[i].createShader(NULL, NULL);
llassert(success);
}
@@ -1615,21 +1533,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/spotLightF.glsl", GL_FRAGMENT_SHADER));
gDeferredSpotLightProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- if (ambient_kill)
- {
- gDeferredSpotLightProgram.addPermutation("AMBIENT_KILL", "1");
- }
-
- if (sunlight_kill)
- {
- gDeferredSpotLightProgram.addPermutation("SUNLIGHT_KILL", "1");
- }
-
- if (local_light_kill)
- {
- gDeferredSpotLightProgram.addPermutation("LOCAL_LIGHT_KILL", "1");
- }
-
success = gDeferredSpotLightProgram.createShader(NULL, NULL);
llassert(success);
}
@@ -1642,16 +1545,12 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredMultiSpotLightProgram.mFeatures.hasShadows = true;
gDeferredMultiSpotLightProgram.clearPermutations();
+ gDeferredMultiSpotLightProgram.addPermutation("MULTI_SPOTLIGHT", "1");
gDeferredMultiSpotLightProgram.mShaderFiles.clear();
gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER));
- gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiSpotLightF.glsl", GL_FRAGMENT_SHADER));
+ gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/spotLightF.glsl", GL_FRAGMENT_SHADER));
gDeferredMultiSpotLightProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- if (local_light_kill)
- {
- gDeferredMultiSpotLightProgram.addPermutation("LOCAL_LIGHT_KILL", "1");
- }
-
success = gDeferredMultiSpotLightProgram.createShader(NULL, NULL);
llassert(success);
}
@@ -1757,21 +1656,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
shader->addPermutation("HAS_SUN_SHADOW", "1");
}
- if (ambient_kill)
- {
- shader->addPermutation("AMBIENT_KILL", "1");
- }
-
- if (sunlight_kill)
- {
- shader->addPermutation("SUNLIGHT_KILL", "1");
- }
-
- if (local_light_kill)
- {
- shader->addPermutation("LOCAL_LIGHT_KILL", "1");
- }
-
if (rigged)
{
shader->addPermutation("HAS_SKIN", "1");
@@ -1895,21 +1779,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
shader[i]->addPermutation("HAS_SUN_SHADOW", "1");
}
- if (ambient_kill)
- {
- shader[i]->addPermutation("AMBIENT_KILL", "1");
- }
-
- if (sunlight_kill)
- {
- shader[i]->addPermutation("SUNLIGHT_KILL", "1");
- }
-
- if (local_light_kill)
- {
- shader[i]->addPermutation("LOCAL_LIGHT_KILL", "1");
- }
-
if (i == 1)
{ // rigged variant
shader[i]->mFeatures.hasObjectSkinning = true;
@@ -2205,21 +2074,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredSoftenProgram.addPermutation("HAS_SUN_SHADOW", "1");
}
- if (ambient_kill)
- {
- gDeferredSoftenProgram.addPermutation("AMBIENT_KILL", "1");
- }
-
- if (sunlight_kill)
- {
- gDeferredSoftenProgram.addPermutation("SUNLIGHT_KILL", "1");
- }
-
- if (local_light_kill)
- {
- gDeferredSoftenProgram.addPermutation("LOCAL_LIGHT_KILL", "1");
- }
-
if (gSavedSettings.getBOOL("RenderDeferredSSAO"))
{ //if using SSAO, take screen space light map into account as if shadows are enabled
gDeferredSoftenProgram.mShaderLevel = llmax(gDeferredSoftenProgram.mShaderLevel, 2);
@@ -2255,21 +2109,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredSoftenWaterProgram.addPermutation("HAS_SUN_SHADOW", "1");
}
- if (ambient_kill)
- {
- gDeferredSoftenWaterProgram.addPermutation("AMBIENT_KILL", "1");
- }
-
- if (sunlight_kill)
- {
- gDeferredSoftenWaterProgram.addPermutation("SUNLIGHT_KILL", "1");
- }
-
- if (local_light_kill)
- {
- gDeferredSoftenWaterProgram.addPermutation("LOCAL_LIGHT_KILL", "1");
- }
-
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);
@@ -2505,20 +2344,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredAvatarAlphaProgram.addPermutation("HAS_SUN_SHADOW", "1");
}
- if (ambient_kill)
- {
- gDeferredAvatarAlphaProgram.addPermutation("AMBIENT_KILL", "1");
- }
-
- if (sunlight_kill)
- {
- gDeferredAvatarAlphaProgram.addPermutation("SUNLIGHT_KILL", "1");
- }
-
- if (local_light_kill)
- {
- gDeferredAvatarAlphaProgram.addPermutation("LOCAL_LIGHT_KILL", "1");
- }
gDeferredAvatarAlphaProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
success = gDeferredAvatarAlphaProgram.createShader(NULL, NULL);