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.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 93f4d22ff8..b50cb49b7e 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -401,30 +401,16 @@ void LLViewerShaderMgr::setShaders()
llassert((gGLManager.mGLSLVersionMajor > 1 || gGLManager.mGLSLVersionMinor >= 10));
- //bool canRenderDeferred = true; // DEPRECATED -- LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred");
- //bool hasWindLightShaders = true; // DEPRECATED -- LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders");
- bool doingWindLight = true; //DEPRECATED -- hasWindLightShaders&& gSavedSettings.getBOOL("WindLightUseAtmosShaders");
-
+
S32 light_class = 3;
S32 interface_class = 2;
S32 env_class = 2;
S32 obj_class = 2;
S32 effect_class = 2;
- S32 wl_class = 1;
+ S32 wl_class = 2;
S32 water_class = 3;
S32 deferred_class = 3;
- if (doingWindLight)
- {
- // user has disabled WindLight in their settings, downgrade
- // windlight shaders to stub versions.
- wl_class = 2;
- }
- else
- {
- light_class = 2;
- }
-
// Trigger a full rebuild of the fallback skybox / cubemap if we've toggled windlight shaders
if (!wl_class || (mShaderLevel[SHADER_WINDLIGHT] != wl_class && gSky.mVOSkyp.notNull()))
{
@@ -670,7 +656,7 @@ std::string LLViewerShaderMgr::loadBasicShaders()
bool has_reflection_probes = gSavedSettings.getBOOL("RenderReflectionsEnabled") && gGLManager.mGLVersion > 3.99f;
- S32 probe_count = gSavedSettings.getS32("RenderReflectionProbeCount");
+ S32 probe_count = llclamp(gSavedSettings.getS32("RenderReflectionProbeCount"), 1, LL_MAX_REFLECTION_PROBE_COUNT);
if (ambient_kill)
{
@@ -774,9 +760,11 @@ std::string LLViewerShaderMgr::loadBasicShaders()
BOOL LLViewerShaderMgr::loadShadersWater()
{
LL_PROFILE_ZONE_SCOPED;
-#if 1 // DEPRECATED -- forward rendering is deprecated
BOOL success = TRUE;
BOOL terrainWaterSuccess = TRUE;
+
+ bool use_sun_shadow = mShaderLevel[SHADER_DEFERRED] > 1 &&
+ gSavedSettings.getS32("RenderShadowDetail") > 0;
if (mShaderLevel[SHADER_WATER] == 0)
{
@@ -797,6 +785,7 @@ BOOL LLViewerShaderMgr::loadShadersWater()
gWaterProgram.mFeatures.hasTransport = true;
gWaterProgram.mFeatures.hasSrgb = true;
gWaterProgram.mFeatures.hasReflectionProbes = true;
+ gWaterProgram.mFeatures.hasShadows = use_sun_shadow;
gWaterProgram.mShaderFiles.clear();
gWaterProgram.mShaderFiles.push_back(make_pair("environment/waterV.glsl", GL_VERTEX_SHADER));
gWaterProgram.mShaderFiles.push_back(make_pair("environment/waterF.glsl", GL_FRAGMENT_SHADER));
@@ -805,6 +794,12 @@ BOOL LLViewerShaderMgr::loadShadersWater()
{
gWaterProgram.addPermutation("TRANSPARENT_WATER", "1");
}
+
+ if (use_sun_shadow)
+ {
+ gWaterProgram.addPermutation("HAS_SUN_SHADOW", "1");
+ }
+
gWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER;
gWaterProgram.mShaderLevel = mShaderLevel[SHADER_WATER];
success = gWaterProgram.createShader(NULL, NULL);
@@ -822,6 +817,7 @@ BOOL LLViewerShaderMgr::loadShadersWater()
gWaterEdgeProgram.mFeatures.hasTransport = true;
gWaterEdgeProgram.mFeatures.hasSrgb = true;
gWaterEdgeProgram.mFeatures.hasReflectionProbes = true;
+ gWaterEdgeProgram.mFeatures.hasShadows = use_sun_shadow;
gWaterEdgeProgram.mShaderFiles.clear();
gWaterEdgeProgram.mShaderFiles.push_back(make_pair("environment/waterV.glsl", GL_VERTEX_SHADER));
gWaterEdgeProgram.mShaderFiles.push_back(make_pair("environment/waterF.glsl", GL_FRAGMENT_SHADER));
@@ -831,6 +827,11 @@ BOOL LLViewerShaderMgr::loadShadersWater()
{
gWaterEdgeProgram.addPermutation("TRANSPARENT_WATER", "1");
}
+
+ if (use_sun_shadow)
+ {
+ gWaterEdgeProgram.addPermutation("HAS_SUN_SHADOW", "1");
+ }
gWaterEdgeProgram.mShaderGroup = LLGLSLShader::SG_WATER;
gWaterEdgeProgram.mShaderLevel = mShaderLevel[SHADER_WATER];
success = gWaterEdgeProgram.createShader(NULL, NULL);
@@ -880,8 +881,7 @@ BOOL LLViewerShaderMgr::loadShadersWater()
LLWorld::getInstance()->updateWaterObjects();
-#endif
- return TRUE;
+ return TRUE;
}
BOOL LLViewerShaderMgr::loadShadersEffects()