summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-09-27 23:32:02 -0500
committerDave Parks <davep@lindenlab.com>2022-09-27 23:32:02 -0500
commitaaf7b17db047f0cb2630b479d5468062e6ca815e (patch)
treea84d5d7668ff65fc6dec3315fd1a760213496e4d /indra/llrender
parent44f2286e42a10270c23ea11e308143948d1e3288 (diff)
SL-18190 WIP -- Take 2 on linear space windlight (more methodical approach -- make desired interface but brute force color conversions). Placeholder PBR water and move to deprecate forward rendering shaders.
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llshadermgr.cpp23
-rw-r--r--indra/llrender/llshadermgr.h3
2 files changed, 18 insertions, 8 deletions
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index b609a74e32..c817a59189 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -145,6 +145,11 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
// NOTE order of shader object attaching is VERY IMPORTANT!!!
if (features->calculatesAtmospherics)
{
+ if (!shader->attachVertexObject("environment/srgbF.glsl")) // NOTE -- "F" suffix is superfluous here, there is nothing fragment specific in srgbF
+ {
+ return FALSE;
+ }
+
if (!shader->attachVertexObject("windlight/atmosphericsFuncs.glsl")) {
return FALSE;
}
@@ -177,6 +182,13 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
///////////////////////////////////////
// NOTE order of shader object attaching is VERY IMPORTANT!!!
+ if (features->hasSrgb || features->hasAtmospherics || features->calculatesAtmospherics)
+ {
+ if (!shader->attachFragmentObject("environment/srgbF.glsl"))
+ {
+ return FALSE;
+ }
+ }
if(features->calculatesAtmospherics)
{
@@ -250,14 +262,6 @@ BOOL LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader)
}
}
- if (features->hasSrgb)
- {
- if (!shader->attachFragmentObject("environment/srgbF.glsl"))
- {
- return FALSE;
- }
- }
-
if (features->encodesNormal)
{
if (!shader->attachFragmentObject("environment/encodeNormF.glsl"))
@@ -1405,6 +1409,9 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms.push_back("water_edge");
mReservedUniforms.push_back("sun_up_factor");
mReservedUniforms.push_back("moonlight_color");
+ mReservedUniforms.push_back("moonlight_linear");
+ mReservedUniforms.push_back("sunlight_linear");
+ mReservedUniforms.push_back("ambient_linear");
llassert(mReservedUniforms.size() == END_RESERVED_UNIFORMS);
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index aa002014a7..4d32a62ca6 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -261,6 +261,9 @@ public:
WATER_EDGE_FACTOR, // "water_edge"
SUN_UP_FACTOR, // "sun_up_factor"
MOONLIGHT_COLOR, // "moonlight_color"
+ MOONLIGHT_LINEAR, // "moonlight_LINEAR"
+ SUNLIGHT_LINEAR, // "sunlight_linear"
+ AMBIENT_LINEAR, // "ambient_linear"
END_RESERVED_UNIFORMS
} eGLSLReservedUniforms;
// clang-format on