summaryrefslogtreecommitdiff
path: root/indra/newview/llviewershadermgr.cpp
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2023-07-17 15:06:23 -0700
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2023-07-17 15:06:23 -0700
commit040050af19ff7b5b2f5dc5ce5c4b68cfbb7e492a (patch)
treefcde4fb3af978615315f83204e6d7351f3b5f02c /indra/newview/llviewershadermgr.cpp
parentf7f9601567ce089f3335407f1d3c7d32dbb18c60 (diff)
parentf975cfd7361729195f2bb14d874e5eacc6140759 (diff)
Merge branch 'DRTVWR-559' into DRTVWR-583
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r--indra/newview/llviewershadermgr.cpp23
1 files changed, 14 insertions, 9 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index f6f1cf6854..6e5d85bc88 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -92,6 +92,7 @@ LLGLSLShader gCopyDepthProgram;
//object shaders
LLGLSLShader gObjectPreviewProgram;
+LLGLSLShader gSkinnedObjectPreviewProgram;
LLGLSLShader gPhysicsPreviewProgram;
LLGLSLShader gObjectFullbrightAlphaMaskProgram;
LLGLSLShader gSkinnedObjectFullbrightAlphaMaskProgram;
@@ -251,7 +252,6 @@ LLViewerShaderMgr::LLViewerShaderMgr() :
mShaderList.push_back(&gWaterProgram);
mShaderList.push_back(&gWaterEdgeProgram);
mShaderList.push_back(&gAvatarEyeballProgram);
- mShaderList.push_back(&gObjectPreviewProgram);
mShaderList.push_back(&gImpostorProgram);
mShaderList.push_back(&gObjectBumpProgram);
mShaderList.push_back(&gSkinnedObjectBumpProgram);
@@ -898,11 +898,20 @@ BOOL LLViewerShaderMgr::loadShadersEffects()
if (success)
{
- gGlowExtractProgram.mName = "Glow Extract Shader (Post)";
+ const bool use_glow_noise = gSavedSettings.getBOOL("RenderGlowNoise");
+ const std::string glow_noise_label = use_glow_noise ? " (+Noise)" : "";
+
+ gGlowExtractProgram.mName = llformat("Glow Extract Shader (Post)%s", glow_noise_label.c_str());
gGlowExtractProgram.mShaderFiles.clear();
gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractV.glsl", GL_VERTEX_SHADER));
gGlowExtractProgram.mShaderFiles.push_back(make_pair("effects/glowExtractF.glsl", GL_FRAGMENT_SHADER));
gGlowExtractProgram.mShaderLevel = mShaderLevel[SHADER_EFFECT];
+
+ if (use_glow_noise)
+ {
+ gGlowExtractProgram.addPermutation("HAS_NOISE", "1");
+ }
+
success = gGlowExtractProgram.createShader(NULL, NULL);
if (!success)
{
@@ -2878,20 +2887,16 @@ BOOL LLViewerShaderMgr::loadShadersObject()
if (success)
{
- gObjectPreviewProgram.mName = "Simple Shader";
- gObjectPreviewProgram.mFeatures.calculatesLighting = false;
- gObjectPreviewProgram.mFeatures.calculatesAtmospherics = false;
- gObjectPreviewProgram.mFeatures.hasGamma = false;
- gObjectPreviewProgram.mFeatures.hasAtmospherics = false;
- gObjectPreviewProgram.mFeatures.hasLighting = false;
- gObjectPreviewProgram.mFeatures.mIndexedTextureChannels = 0;
+ gObjectPreviewProgram.mName = "Object Preview Shader";
gObjectPreviewProgram.mFeatures.disableTextureIndex = true;
gObjectPreviewProgram.mShaderFiles.clear();
gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewV.glsl", GL_VERTEX_SHADER));
gObjectPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewF.glsl", GL_FRAGMENT_SHADER));
gObjectPreviewProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT];
+ success = make_rigged_variant(gObjectPreviewProgram, gSkinnedObjectPreviewProgram);
success = gObjectPreviewProgram.createShader(NULL, NULL);
gObjectPreviewProgram.mFeatures.hasLighting = true;
+ gSkinnedObjectPreviewProgram.mFeatures.hasLighting = true;
}
if (success)