diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 9041d41746..00ff7e9996 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -1441,12 +1441,13 @@ F32 LLSettingsSky::getReflectionProbeAmbiance() const
return mSettings[SETTING_REFLECTION_PROBE_AMBIANCE].asReal();
}
-F32 LLSettingsSky::getTotalReflectionProbeAmbiance() const
+F32 LLSettingsSky::getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale) const
{
// feed cloud shadow back into reflection probe ambiance to mimic pre-reflection-probe behavior
// without brightening dark/interior spaces
F32 probe_ambiance = getReflectionProbeAmbiance();
- probe_ambiance += (1.f - probe_ambiance) * getCloudShadow()*0.5f;
+
+ probe_ambiance += (1.f - probe_ambiance) * getCloudShadow()*cloud_shadow_scale;
return probe_ambiance;
}
diff --git a/indra/llinventory/llsettingssky.h b/indra/llinventory/llsettingssky.h
index b17b32ebb1..7ae569dd4c 100644
--- a/indra/llinventory/llsettingssky.h
+++ b/indra/llinventory/llsettingssky.h
@@ -137,7 +137,7 @@ public:
F32 getReflectionProbeAmbiance() const;
// get the probe ambiance setting to use for rendering (adjusted by cloud shadow, aka cloud coverage)
- F32 getTotalReflectionProbeAmbiance() const;
+ F32 getTotalReflectionProbeAmbiance(F32 cloud_shadow_scale) const;
// Return first (only) profile layer represented in LLSD
LLSD getRayleighConfig() const;
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index b414a9fd21..c9c5aa854b 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -82,12 +82,10 @@ BOOL shouldChange(const LLVector4& v1, const LLVector4& v2)
}
LLShaderFeatures::LLShaderFeatures()
- : atmosphericHelpers(false)
- , calculatesLighting(false)
+ : calculatesLighting(false)
, calculatesAtmospherics(false)
, hasLighting(false)
, isAlphaLighting(false)
- , isFullbright(false)
, isSpecular(false)
, hasWaterFog(false)
, hasTransport(false)
diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h
index edf7b59491..b0d5f308f3 100644
--- a/indra/llrender/llglslshader.h
+++ b/indra/llrender/llglslshader.h
@@ -35,12 +35,10 @@
class LLShaderFeatures
{
public:
- bool atmosphericHelpers;
bool calculatesLighting;
bool calculatesAtmospherics;
bool hasLighting; // implies no transport (it's possible to have neither though)
bool isAlphaLighting; // indicates lighting shaders need not be linked in (lighting performed directly in alpha shader to match deferred lighting functions)
- bool isFullbright; // implies no lighting
bool isSpecular;
bool hasWaterFog; // implies no gamma
bool hasTransport; // implies no lighting (it's possible to have neither though)
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index cc3c48a3fc..1bbf4e8ff7 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -28,6 +28,7 @@
#include "llshadermgr.h"
#include "llrender.h"
#include "llfile.h"
+#include "lldir.h"
#if LL_DARWIN
#include "OpenGL/OpenGL.h"
@@ -379,82 +380,7 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
}
}
}
- // NOTE order of shader object attaching is VERY IMPORTANT!!!
- else if (features->isFullbright)
- {
- if (features->hasWaterFog)
- {
- if (features->disableTextureIndex)
- {
- if (features->hasAlphaMask)
- {
- if (!shader->attachFragmentObject("lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl"))
- {
- return FALSE;
- }
- }
- else if (!shader->attachFragmentObject("lighting/lightFullbrightWaterNonIndexedF.glsl"))
- {
- return FALSE;
- }
- }
- else
- {
- if (features->hasAlphaMask)
- {
- if (!shader->attachFragmentObject("lighting/lightFullbrightWaterAlphaMaskF.glsl"))
- {
- return FALSE;
- }
- }
- else if (!shader->attachFragmentObject("lighting/lightFullbrightWaterF.glsl"))
- {
- return FALSE;
- }
- shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
- }
- }
- else
- {
- if (features->disableTextureIndex)
- {
-
- if (features->hasAlphaMask)
- {
- if (!shader->attachFragmentObject("lighting/lightFullbrightNonIndexedAlphaMaskF.glsl"))
- {
- return FALSE;
- }
- }
- else
- {
- if (!shader->attachFragmentObject("lighting/lightFullbrightNonIndexedF.glsl"))
- {
- return FALSE;
- }
- }
- }
- else
- {
- if (features->hasAlphaMask)
- {
- if (!shader->attachFragmentObject("lighting/lightFullbrightAlphaMaskF.glsl"))
- {
- return FALSE;
- }
- }
- else
- {
- if (!shader->attachFragmentObject("lighting/lightFullbrightF.glsl"))
- {
- return FALSE;
- }
- }
- shader->mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1);
- }
- }
- }
if (features->mIndexedTextureChannels <= 1)
{
if (!shader->attachVertexObject("objects/nonindexedTextureV.glsl"))
@@ -599,36 +525,57 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
S32 gpu_class;
std::string open_file_name;
- //find the most relevant file
- for (gpu_class = try_gpu_class; gpu_class > 0; gpu_class--)
- { //search from the current gpu class down to class 1 to find the most relevant shader
- std::stringstream fname;
- fname << getShaderDirPrefix();
- fname << gpu_class << "/" << filename;
-
- open_file_name = fname.str();
- /*
- Would be awesome, if we didn't have shaders that re-use files
- with different environments to say, add skinning, etc
- can't depend on cached version to have evaluate ifdefs identically...
- if we can define a deterministic hash for the shader based on
- all the inputs, maybe we can save some time here.
- if (mShaderObjects.count(filename) > 0)
+#if 0 // WIP -- try to come up with a way to fallback to an error shader without needing debug stubs all over the place in the shader tree
+ if (shader_level == -1)
+ {
+ // use "error" fallback
+ if (type == GL_VERTEX_SHADER)
{
- return mShaderObjects[filename];
+ open_file_name = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "shaders/errorV.glsl");
+ }
+ else
+ {
+ llassert(type == GL_FRAGMENT_SHADER); // type must be vertex or fragment shader
+ open_file_name = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "shaders/errorF.glsl");
}
- */
+ file = LLFile::fopen(open_file_name, "r");
+ }
+ else
+#endif
+ {
+ //find the most relevant file
+ for (gpu_class = try_gpu_class; gpu_class > 0; gpu_class--)
+ { //search from the current gpu class down to class 1 to find the most relevant shader
+ std::stringstream fname;
+ fname << getShaderDirPrefix();
+ fname << gpu_class << "/" << filename;
- LL_DEBUGS("ShaderLoading") << "Looking in " << open_file_name << LL_ENDL;
- file = LLFile::fopen(open_file_name, "r+"); /* Flawfinder: ignore */
- if (file)
- {
- LL_DEBUGS("ShaderLoading") << "Loading file: " << open_file_name << " (Want class " << gpu_class << ")" << LL_ENDL;
- break; // done
- }
- }
+ open_file_name = fname.str();
+
+ /*
+ Would be awesome, if we didn't have shaders that re-use files
+ with different environments to say, add skinning, etc
+ can't depend on cached version to have evaluate ifdefs identically...
+ if we can define a deterministic hash for the shader based on
+ all the inputs, maybe we can save some time here.
+ if (mShaderObjects.count(filename) > 0)
+ {
+ return mShaderObjects[filename];
+ }
+
+ */
+
+ LL_DEBUGS("ShaderLoading") << "Looking in " << open_file_name << LL_ENDL;
+ file = LLFile::fopen(open_file_name, "r"); /* Flawfinder: ignore */
+ if (file)
+ {
+ LL_DEBUGS("ShaderLoading") << "Loading file: " << open_file_name << " (Want class " << gpu_class << ")" << LL_ENDL;
+ break; // done
+ }
+ }
+ }
if (file == NULL)
{
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 2e4daf2ad0..e808c5aba2 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -1416,14 +1416,6 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen& size, BO
LL_INFOS("Window") << "pfd.dwDamageMask: " << pfd.dwDamageMask << LL_ENDL ;
LL_INFOS("Window") << "--- end pixel format dump ---" << LL_ENDL ;
- if (pfd.cColorBits < 32)
- {
- OSMessageBox(mCallbacks->translateString("MBTrueColorWindow"),
- mCallbacks->translateString("MBError"), OSMB_OK);
- close();
- return FALSE;
- }
-
if (!SetPixelFormat(mhDC, pixel_format, &pfd))
{
OSMessageBox(mCallbacks->translateString("MBPixelFmtSetErr"),
@@ -1705,14 +1697,6 @@ const S32 max_format = (S32)num_formats - 1;
<< " Depth Bits " << S32(pfd.cDepthBits)
<< LL_ENDL;
- // make sure we have 32 bits per pixel
- if (pfd.cColorBits < 32 || GetDeviceCaps(mhDC, BITSPIXEL) < 32)
- {
- OSMessageBox(mCallbacks->translateString("MBTrueColorWindow"), mCallbacks->translateString("MBError"), OSMB_OK);
- close();
- return FALSE;
- }
-
mhRC = 0;
if (wglCreateContextAttribsARB)
{ //attempt to create a specific versioned context
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index bb77ac4ebc..8417adce14 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -11728,6 +11728,17 @@ Change of this parameter will affect the layout of buttons in notification toast
Value
0
+ RenderCloudShadowAmbianceFactor
+
RenderComplexityColorMin