diff options
author | Rider Linden <rider@lindenlab.com> | 2018-07-03 14:19:52 -0700 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-07-03 14:19:52 -0700 |
commit | cb178672c63e78f478cc987828be575f09f1b4aa (patch) | |
tree | 1a21575ba0eb2adaec8681e6f967634d70da7a20 /indra/newview/llviewershadermgr.cpp | |
parent | a4137d72ebc9f49dfd8bd124b255da0dfbc4ba92 (diff) | |
parent | 8969b114357d189e1bf39024762698eeddddfc78 (diff) |
Merge
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index ea97765e5b..cd378c0a56 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -176,6 +176,7 @@ LLGLSLShader gImpostorProgram; // WindLight shader handles LLGLSLShader gWLSkyProgram; LLGLSLShader gWLCloudProgram; +LLGLSLShader gWLSunProgram; LLGLSLShader gWLMoonProgram; // Effects Shaders @@ -232,6 +233,7 @@ LLGLSLShader gFXAAProgram; LLGLSLShader gDeferredPostNoDoFProgram; LLGLSLShader gDeferredWLSkyProgram; LLGLSLShader gDeferredWLCloudProgram; +LLGLSLShader gDeferredWLSunProgram; LLGLSLShader gDeferredWLMoonProgram; LLGLSLShader gDeferredStarProgram; LLGLSLShader gDeferredFullbrightShinyProgram; @@ -251,6 +253,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : //ONLY shaders that need WL Param management should be added here mShaderList.push_back(&gWLSkyProgram); mShaderList.push_back(&gWLCloudProgram); + mShaderList.push_back(&gWLSunProgram); mShaderList.push_back(&gWLMoonProgram); mShaderList.push_back(&gAvatarProgram); mShaderList.push_back(&gObjectShinyProgram); @@ -345,6 +348,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gDeferredWLSkyProgram); mShaderList.push_back(&gDeferredWLCloudProgram); mShaderList.push_back(&gDeferredWLMoonProgram); + mShaderList.push_back(&gDeferredWLSunProgram); } LLViewerShaderMgr::~LLViewerShaderMgr() @@ -831,6 +835,7 @@ void LLViewerShaderMgr::unloadShaders() gWLSkyProgram.unload(); gWLCloudProgram.unload(); + gWLSunProgram.unload(); gWLMoonProgram.unload(); gPostColorFilterProgram.unload(); @@ -1213,6 +1218,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredUnderWaterProgram.unload(); gDeferredWLSkyProgram.unload(); gDeferredWLCloudProgram.unload(); + gDeferredWLSunProgram.unload(); gDeferredWLMoonProgram.unload(); gDeferredStarProgram.unload(); gDeferredFullbrightShinyProgram.unload(); @@ -2159,6 +2165,24 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() if (success) { + gDeferredWLSunProgram.mName = "Deferred Windlight Sun Program"; + gDeferredWLSunProgram.mFeatures.calculatesAtmospherics = true; + gDeferredWLSunProgram.mFeatures.hasTransport = true; + gDeferredWLSunProgram.mFeatures.hasGamma = true; + gDeferredWLSunProgram.mFeatures.hasAtmospherics = true; + gDeferredWLSunProgram.mFeatures.isFullbright = true; + gDeferredWLSunProgram.mFeatures.disableTextureIndex = true; + gDeferredWLSunProgram.mShaderFiles.clear(); + gDeferredWLSunProgram.mShaderFiles.push_back(make_pair("deferred/sunDiscV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredWLSunProgram.mShaderFiles.push_back(make_pair("deferred/sunDiscF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredWLSunProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredWLSunProgram.mShaderGroup = LLGLSLShader::SG_SKY; + success = gDeferredWLSunProgram.createShader(NULL, NULL); + llassert(success); + } + + if (success) + { gDeferredWLMoonProgram.mName = "Deferred Windlight Moon Program"; gDeferredWLMoonProgram.mFeatures.calculatesAtmospherics = true; gDeferredWLMoonProgram.mFeatures.hasTransport = true; @@ -2171,10 +2195,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLMoonProgram.mShaderFiles.push_back(make_pair("deferred/moonF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredWLMoonProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredWLMoonProgram.mShaderGroup = LLGLSLShader::SG_SKY; - if (mVertexShaderLevel[SHADER_WINDLIGHT] >= 3) - { - gDeferredWLSkyProgram.mExtraLinkObject = gAtmosphere->getAtmosphericShaderForLink(); - } success = gDeferredWLMoonProgram.createShader(NULL, NULL); llassert(success); } @@ -3510,6 +3530,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() { gWLSkyProgram.unload(); gWLCloudProgram.unload(); + gWLSunProgram.unload(); gWLMoonProgram.unload(); gDownsampleMinMaxDepthRectProgram.unload(); gInscatterRectProgram.unload(); @@ -3548,6 +3569,24 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() if (success && (mVertexShaderLevel[SHADER_WINDLIGHT] < 3)) { + gWLSunProgram.mName = "Windlight Sun Program"; + gWLSunProgram.mShaderFiles.clear(); + gWLSunProgram.mFeatures.calculatesAtmospherics = true; + gWLSunProgram.mFeatures.hasTransport = true; + gWLSunProgram.mFeatures.hasGamma = true; + gWLSunProgram.mFeatures.hasAtmospherics = true; + gWLSunProgram.mFeatures.isFullbright = true; + gWLSunProgram.mFeatures.disableTextureIndex = true; + gWLSunProgram.mShaderGroup = LLGLSLShader::SG_SKY; + gWLSunProgram.mShaderFiles.push_back(make_pair("windlight/sunDiscV.glsl", GL_VERTEX_SHADER_ARB)); + gWLSunProgram.mShaderFiles.push_back(make_pair("windlight/sunDiscF.glsl", GL_FRAGMENT_SHADER_ARB)); + gWLSunProgram.mShaderLevel = mVertexShaderLevel[SHADER_WINDLIGHT]; + gWLSunProgram.mShaderGroup = LLGLSLShader::SG_SKY; + success = gWLSunProgram.createShader(NULL, NULL); + } + + if (success && (mVertexShaderLevel[SHADER_WINDLIGHT] < 3)) + { gWLMoonProgram.mName = "Windlight Moon Program"; gWLMoonProgram.mShaderFiles.clear(); gWLMoonProgram.mFeatures.calculatesAtmospherics = true; |