From aaf7b17db047f0cb2630b479d5468062e6ca815e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 27 Sep 2022 23:32:02 -0500 Subject: 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. --- indra/llrender/llshadermgr.cpp | 23 +++++++++++++++-------- indra/llrender/llshadermgr.h | 3 +++ 2 files changed, 18 insertions(+), 8 deletions(-) (limited to 'indra/llrender') 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 -- cgit v1.3