diff options
author | Graham Linden <graham@lindenlab.com> | 2018-06-08 22:22:20 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-06-08 22:22:20 +0100 |
commit | 507c4921826e73635f6ae31087ab0e6cd1280f43 (patch) | |
tree | 1f6a5aba26ba21f43ae79b3eddd1f8d5a458c481 /indra/newview/llviewershadermgr.cpp | |
parent | 363f7f84a149c0bc4fe21df80aead821f02a7ff0 (diff) |
Add specific shader for the moon to allow different rendering at day vs night.
Add MouseMoon positioning ala MouseSun debug setting and accessors to use it.
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 820e18290f..48c72d8dc0 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -176,7 +176,7 @@ LLGLSLShader gImpostorProgram; // WindLight shader handles LLGLSLShader gWLSkyProgram; LLGLSLShader gWLCloudProgram; - +LLGLSLShader gWLMoonProgram; // Effects Shaders LLGLSLShader gGlowProgram; @@ -250,6 +250,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(&gWLMoonProgram); mShaderList.push_back(&gAvatarProgram); mShaderList.push_back(&gObjectShinyProgram); mShaderList.push_back(&gObjectShinyNonIndexedProgram); @@ -828,6 +829,7 @@ void LLViewerShaderMgr::unloadShaders() gWLSkyProgram.unload(); gWLCloudProgram.unload(); + gWLMoonProgram.unload(); gPostColorFilterProgram.unload(); gPostNightVisionProgram.unload(); @@ -3480,6 +3482,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() { gWLSkyProgram.unload(); gWLCloudProgram.unload(); + gWLMoonProgram.unload(); gDownsampleMinMaxDepthRectProgram.unload(); gInscatterRectProgram.unload(); return TRUE; @@ -3503,7 +3506,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() success = gWLSkyProgram.createShader(NULL, NULL); } - if (success && (mVertexShaderLevel[SHADER_WINDLIGHT] < 3)) + if (success) { gWLCloudProgram.mName = "Windlight Cloud Program"; //gWLCloudProgram.mFeatures.hasGamma = true; @@ -3515,6 +3518,24 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() success = gWLCloudProgram.createShader(NULL, NULL); } + if (success && (mVertexShaderLevel[SHADER_WINDLIGHT] < 3)) + { + gWLMoonProgram.mName = "Windlight Moon Program"; + gWLMoonProgram.mShaderFiles.clear(); + gWLMoonProgram.mFeatures.calculatesAtmospherics = true; + gWLMoonProgram.mFeatures.hasTransport = true; + gWLMoonProgram.mFeatures.hasGamma = true; + gWLMoonProgram.mFeatures.hasAtmospherics = true; + gWLMoonProgram.mFeatures.isFullbright = true; + gWLMoonProgram.mFeatures.disableTextureIndex = true; + gWLMoonProgram.mShaderGroup = LLGLSLShader::SG_SKY; + gWLMoonProgram.mShaderFiles.push_back(make_pair("windlight/moonV.glsl", GL_VERTEX_SHADER_ARB)); + gWLMoonProgram.mShaderFiles.push_back(make_pair("windlight/moonF.glsl", GL_FRAGMENT_SHADER_ARB)); + gWLMoonProgram.mShaderLevel = mVertexShaderLevel[SHADER_WINDLIGHT]; + gWLMoonProgram.mShaderGroup = LLGLSLShader::SG_SKY; + success = gWLMoonProgram.createShader(NULL, NULL); + } + return success; } |