From ed1b78e32235680c3978b9830e5ba81115a0ab7d Mon Sep 17 00:00:00 2001 From: Jonathan Goodman Date: Tue, 28 Aug 2012 10:33:32 -0400 Subject: Added support for adding custom preprocessor definitions (for shader permutations) --- indra/newview/llviewershadermgr.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 4b0e0598f6..8c0ec4e275 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -826,12 +826,15 @@ BOOL LLViewerShaderMgr::loadBasicShaders() shaders.push_back( make_pair( "objects/indexedTextureV.glsl", 1 ) ); } shaders.push_back( make_pair( "objects/nonindexedTextureV.glsl", 1 ) ); - + + std::map attribs; + attribs["NULL"] = "0"; + // We no longer have to bind the shaders to global glhandles, they are automatically added to a map now. for (U32 i = 0; i < shaders.size(); i++) { // Note usage of GL_VERTEX_SHADER_ARB - if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER_ARB) == 0) + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER_ARB, attribs) == 0) { return FALSE; } @@ -879,11 +882,11 @@ BOOL LLViewerShaderMgr::loadBasicShaders() index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightShinyF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightShinyWaterF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); index_channels.push_back(ch); shaders.push_back( make_pair( "lighting/lightFullbrightShinyWaterF.glsl", mVertexShaderLevel[SHADER_LIGHTING] ) ); - + for (U32 i = 0; i < shaders.size(); i++) { // Note usage of GL_FRAGMENT_SHADER_ARB - if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER_ARB, index_channels[i]) == 0) + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER_ARB, attribs, index_channels[i]) == 0) { return FALSE; } -- cgit v1.2.3 From c911efb953a600092a6213c088d5b94fcf7779d3 Mon Sep 17 00:00:00 2001 From: Jonathan Goodman Date: Wed, 29 Aug 2012 03:41:26 -0400 Subject: Just pass in an empty preprocessor definition map from now on. The shader compiler won't add new #defines if it's empty. --- indra/newview/llviewershadermgr.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 8c0ec4e275..e70bf013e7 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -828,7 +828,6 @@ BOOL LLViewerShaderMgr::loadBasicShaders() shaders.push_back( make_pair( "objects/nonindexedTextureV.glsl", 1 ) ); std::map attribs; - attribs["NULL"] = "0"; // We no longer have to bind the shaders to global glhandles, they are automatically added to a map now. for (U32 i = 0; i < shaders.size(); i++) -- cgit v1.2.3 From d5b45b0b636557333c3408e7a60d5ef587ea99ad Mon Sep 17 00:00:00 2001 From: Jonathan Goodman Date: Wed, 29 Aug 2012 08:02:46 -0400 Subject: Use an unordered map for custom #defines instead of a map. Lookups are faster, and we don't really care about any particular order anyways for these. --- indra/newview/llviewershadermgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index e70bf013e7..43de7450c8 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -827,7 +827,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders() } shaders.push_back( make_pair( "objects/nonindexedTextureV.glsl", 1 ) ); - std::map attribs; + boost::unordered_map attribs; // We no longer have to bind the shaders to global glhandles, they are automatically added to a map now. for (U32 i = 0; i < shaders.size(); i++) -- cgit v1.2.3 From 2ae4b6976baf0556066d5a3b43b8f6148f18c1d8 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 4 Feb 2013 11:32:05 -0500 Subject: Added a new draw pool specifically for faces with materials applied to them. Removed materials rendering from the bump draw pool, and reverted it to its previous state. --- indra/newview/llviewershadermgr.cpp | 125 ++++++++++++++++++++++++++++++++++++ 1 file changed, 125 insertions(+) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 43de7450c8..20e0448c1b 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -207,6 +207,17 @@ LLGLSLShader gDeferredWLCloudProgram; LLGLSLShader gDeferredStarProgram; LLGLSLShader gNormalMapGenProgram; +// Deferred materials shaders +LLGLSLShader gDeferredMaterialShiny; +LLGLSLShader gDeferredMaterialNormal; +LLGLSLShader gDeferredMaterialShinyNormal; +LLGLSLShader gDeferredMaterialShinyAlphaTest; +LLGLSLShader gDeferredMaterialNormalAlphaTest; +LLGLSLShader gDeferredMaterialShinyNormalAlphaTest; +LLGLSLShader gDeferredMaterialShinyEmissive; +LLGLSLShader gDeferredMaterialNormalEmissive; +LLGLSLShader gDeferredMaterialShinyNormalEmissive; + LLViewerShaderMgr::LLViewerShaderMgr() : mVertexShaderLevel(SHADER_COUNT, 0), mMaxAvatarShaderLevel(0) @@ -1105,6 +1116,12 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLCloudProgram.unload(); gDeferredStarProgram.unload(); gNormalMapGenProgram.unload(); + gDeferredMaterialShiny.unload(); + gDeferredMaterialNormal.unload(); + gDeferredMaterialShinyAlphaTest.unload(); + gDeferredMaterialNormalAlphaTest.unload(); + gDeferredMaterialShinyEmissive.unload(); + gDeferredMaterialNormalEmissive.unload(); return TRUE; } @@ -1218,6 +1235,114 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredBumpProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredBumpProgram.createShader(NULL, NULL); } + + if (success) + { + gDeferredMaterialShiny.mName = "Deferred Shiny Material Shader"; + gDeferredMaterialShiny.mShaderFiles.clear(); + gDeferredMaterialShiny.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMaterialShiny.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMaterialShiny.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredMaterialShiny.addPermutation("SHINY_MATERIAL", "1"); + success = gDeferredMaterialShiny.createShader(NULL, NULL); + } + + if (success) + { + gDeferredMaterialNormal.mName = "Deferred Normal Mapped Material Shader"; + gDeferredMaterialNormal.mShaderFiles.clear(); + gDeferredMaterialNormal.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMaterialNormal.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMaterialNormal.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredMaterialNormal.addPermutation("NORMAL_MATERIAL", "1"); + success = gDeferredMaterialNormal.createShader(NULL, NULL); + } + + if (success) + { + gDeferredMaterialShinyNormal.mName = "Deferred Normal Mapped Shiny Material Shader"; + gDeferredMaterialShinyNormal.mShaderFiles.clear(); + gDeferredMaterialShinyNormal.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMaterialShinyNormal.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMaterialShinyNormal.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredMaterialShinyNormal.addPermutation("NORMAL_MATERIAL", "1"); + gDeferredMaterialShinyNormal.addPermutation("SHINY_MATERIAL", "1"); + success = gDeferredMaterialShinyNormal.createShader(NULL, NULL); + } + + if (success) + { + gDeferredMaterialShinyAlphaTest.mName = "Deferred Alpha Tested Shiny Material Shader"; + gDeferredMaterialShinyAlphaTest.mShaderFiles.clear(); + gDeferredMaterialShinyAlphaTest.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMaterialShinyAlphaTest.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMaterialShinyAlphaTest.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredMaterialShinyAlphaTest.addPermutation("SHINY_MATERIAL", "1"); + gDeferredMaterialShinyAlphaTest.addPermutation("ALPHA_TEST", "1"); + success = gDeferredMaterialShinyAlphaTest.createShader(NULL, NULL); + } + + if (success) + { + gDeferredMaterialNormalAlphaTest.mName = "Deferred Alpha Tested Normal Mapped Material Shader"; + gDeferredMaterialNormalAlphaTest.mShaderFiles.clear(); + gDeferredMaterialNormalAlphaTest.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMaterialNormalAlphaTest.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMaterialNormalAlphaTest.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredMaterialNormalAlphaTest.addPermutation("NORMAL_MATERIAL", "1"); + gDeferredMaterialNormalAlphaTest.addPermutation("ALPHA_TEST", "1"); + success = gDeferredMaterialNormalAlphaTest.createShader(NULL, NULL); + } + + if (success) + { + gDeferredMaterialNormalAlphaTest.mName = "Deferred Alpha Tested Shiny Normal Mapped Material Shader"; + gDeferredMaterialShinyNormalAlphaTest.mShaderFiles.clear(); + gDeferredMaterialShinyNormalAlphaTest.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMaterialShinyNormalAlphaTest.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMaterialShinyNormalAlphaTest.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredMaterialShinyNormalAlphaTest.addPermutation("NORMAL_MATERIAL", "1"); + gDeferredMaterialShinyNormalAlphaTest.addPermutation("SHINY_MATERIAL", "1"); + gDeferredMaterialShinyNormalAlphaTest.addPermutation("ALPHA_TEST", "1"); + success = gDeferredMaterialShinyNormalAlphaTest.createShader(NULL, NULL); + } + + if (success) + { + gDeferredMaterialShinyEmissive.mName = "Deferred Emissive Mask Shiny Material Shader"; + gDeferredMaterialShinyEmissive.mShaderFiles.clear(); + gDeferredMaterialShinyEmissive.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMaterialShinyEmissive.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMaterialShinyEmissive.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredMaterialShinyEmissive.addPermutation("SHINY_MATERIAL", "1"); + gDeferredMaterialShinyEmissive.addPermutation("EMISSIVE_MASK", "1"); + success = gDeferredMaterialShinyEmissive.createShader(NULL, NULL); + } + + if (success) + { + gDeferredMaterialNormalEmissive.mName = "Deferred Emissive Mask Normal Mapped Material Shader"; + gDeferredMaterialNormalEmissive.mShaderFiles.clear(); + gDeferredMaterialNormalEmissive.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMaterialNormalEmissive.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMaterialNormalEmissive.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredMaterialNormalEmissive.addPermutation("NORMAL_MATERIAL", "1"); + gDeferredMaterialNormalEmissive.addPermutation("EMISSIVE_MASK", "1"); + success = gDeferredMaterialNormalEmissive.createShader(NULL, NULL); + } + + if (success) + { + gDeferredMaterialShinyNormalEmissive.mName = "Deferred Emissive Mask Normal Mapped Material Shader"; + gDeferredMaterialShinyNormalEmissive.mShaderFiles.clear(); + gDeferredMaterialShinyNormalEmissive.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMaterialShinyNormalEmissive.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMaterialShinyNormalEmissive.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredMaterialShinyNormalEmissive.addPermutation("NORMAL_MATERIAL", "1"); + gDeferredMaterialShinyNormalEmissive.addPermutation("SHINY_MATERIAL", "1"); + gDeferredMaterialShinyNormalEmissive.addPermutation("EMISSIVE_MASK", "1"); + success = gDeferredMaterialShinyNormalEmissive.createShader(NULL, NULL); + } if (success) { -- cgit v1.2.3 From 6300f4f768de13823a754831797cb34022f87b60 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 27 Mar 2013 21:59:14 -0500 Subject: NORSPEC-61 Hook up material parameters to shaders. --- indra/newview/llviewershadermgr.cpp | 144 ++++++------------------------------ 1 file changed, 24 insertions(+), 120 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 17bfc24f43..4e38d2f7e9 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -208,15 +208,7 @@ LLGLSLShader gDeferredStarProgram; LLGLSLShader gNormalMapGenProgram; // Deferred materials shaders -LLGLSLShader gDeferredMaterialShiny; -LLGLSLShader gDeferredMaterialNormal; -LLGLSLShader gDeferredMaterialShinyNormal; -LLGLSLShader gDeferredMaterialShinyAlphaTest; -LLGLSLShader gDeferredMaterialNormalAlphaTest; -LLGLSLShader gDeferredMaterialShinyNormalAlphaTest; -LLGLSLShader gDeferredMaterialShinyEmissive; -LLGLSLShader gDeferredMaterialNormalEmissive; -LLGLSLShader gDeferredMaterialShinyNormalEmissive; +LLGLSLShader gDeferredMaterialProgram[LLMaterial::SHADER_COUNT]; LLViewerShaderMgr::LLViewerShaderMgr() : mVertexShaderLevel(SHADER_COUNT, 0), @@ -1116,12 +1108,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLCloudProgram.unload(); gDeferredStarProgram.unload(); gNormalMapGenProgram.unload(); - gDeferredMaterialShiny.unload(); - gDeferredMaterialNormal.unload(); - gDeferredMaterialShinyAlphaTest.unload(); - gDeferredMaterialNormalAlphaTest.unload(); - gDeferredMaterialShinyEmissive.unload(); - gDeferredMaterialNormalEmissive.unload(); + for (U32 i = 0; i < LLMaterial::SHADER_COUNT; ++i) + { + gDeferredMaterialProgram[i].unload(); + } return TRUE; } @@ -1236,114 +1226,28 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() success = gDeferredBumpProgram.createShader(NULL, NULL); } - if (success) - { - gDeferredMaterialShiny.mName = "Deferred Shiny Material Shader"; - gDeferredMaterialShiny.mShaderFiles.clear(); - gDeferredMaterialShiny.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMaterialShiny.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredMaterialShiny.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredMaterialShiny.addPermutation("SHINY_MATERIAL", "1"); - success = gDeferredMaterialShiny.createShader(NULL, NULL); - } - - if (success) - { - gDeferredMaterialNormal.mName = "Deferred Normal Mapped Material Shader"; - gDeferredMaterialNormal.mShaderFiles.clear(); - gDeferredMaterialNormal.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMaterialNormal.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredMaterialNormal.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredMaterialNormal.addPermutation("NORMAL_MATERIAL", "1"); - success = gDeferredMaterialNormal.createShader(NULL, NULL); - } - - if (success) - { - gDeferredMaterialShinyNormal.mName = "Deferred Normal Mapped Shiny Material Shader"; - gDeferredMaterialShinyNormal.mShaderFiles.clear(); - gDeferredMaterialShinyNormal.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMaterialShinyNormal.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredMaterialShinyNormal.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredMaterialShinyNormal.addPermutation("NORMAL_MATERIAL", "1"); - gDeferredMaterialShinyNormal.addPermutation("SHINY_MATERIAL", "1"); - success = gDeferredMaterialShinyNormal.createShader(NULL, NULL); - } - - if (success) - { - gDeferredMaterialShinyAlphaTest.mName = "Deferred Alpha Tested Shiny Material Shader"; - gDeferredMaterialShinyAlphaTest.mShaderFiles.clear(); - gDeferredMaterialShinyAlphaTest.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMaterialShinyAlphaTest.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredMaterialShinyAlphaTest.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredMaterialShinyAlphaTest.addPermutation("SHINY_MATERIAL", "1"); - gDeferredMaterialShinyAlphaTest.addPermutation("ALPHA_TEST", "1"); - success = gDeferredMaterialShinyAlphaTest.createShader(NULL, NULL); - } - - if (success) - { - gDeferredMaterialNormalAlphaTest.mName = "Deferred Alpha Tested Normal Mapped Material Shader"; - gDeferredMaterialNormalAlphaTest.mShaderFiles.clear(); - gDeferredMaterialNormalAlphaTest.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMaterialNormalAlphaTest.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredMaterialNormalAlphaTest.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredMaterialNormalAlphaTest.addPermutation("NORMAL_MATERIAL", "1"); - gDeferredMaterialNormalAlphaTest.addPermutation("ALPHA_TEST", "1"); - success = gDeferredMaterialNormalAlphaTest.createShader(NULL, NULL); - } - - if (success) - { - gDeferredMaterialNormalAlphaTest.mName = "Deferred Alpha Tested Shiny Normal Mapped Material Shader"; - gDeferredMaterialShinyNormalAlphaTest.mShaderFiles.clear(); - gDeferredMaterialShinyNormalAlphaTest.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMaterialShinyNormalAlphaTest.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredMaterialShinyNormalAlphaTest.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredMaterialShinyNormalAlphaTest.addPermutation("NORMAL_MATERIAL", "1"); - gDeferredMaterialShinyNormalAlphaTest.addPermutation("SHINY_MATERIAL", "1"); - gDeferredMaterialShinyNormalAlphaTest.addPermutation("ALPHA_TEST", "1"); - success = gDeferredMaterialShinyNormalAlphaTest.createShader(NULL, NULL); - } - - if (success) - { - gDeferredMaterialShinyEmissive.mName = "Deferred Emissive Mask Shiny Material Shader"; - gDeferredMaterialShinyEmissive.mShaderFiles.clear(); - gDeferredMaterialShinyEmissive.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMaterialShinyEmissive.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredMaterialShinyEmissive.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredMaterialShinyEmissive.addPermutation("SHINY_MATERIAL", "1"); - gDeferredMaterialShinyEmissive.addPermutation("EMISSIVE_MASK", "1"); - success = gDeferredMaterialShinyEmissive.createShader(NULL, NULL); - } - - if (success) - { - gDeferredMaterialNormalEmissive.mName = "Deferred Emissive Mask Normal Mapped Material Shader"; - gDeferredMaterialNormalEmissive.mShaderFiles.clear(); - gDeferredMaterialNormalEmissive.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMaterialNormalEmissive.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredMaterialNormalEmissive.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredMaterialNormalEmissive.addPermutation("NORMAL_MATERIAL", "1"); - gDeferredMaterialNormalEmissive.addPermutation("EMISSIVE_MASK", "1"); - success = gDeferredMaterialNormalEmissive.createShader(NULL, NULL); - } - - if (success) + + for (U32 i = 0; i < LLMaterial::SHADER_COUNT; ++i) { - gDeferredMaterialShinyNormalEmissive.mName = "Deferred Emissive Mask Normal Mapped Material Shader"; - gDeferredMaterialShinyNormalEmissive.mShaderFiles.clear(); - gDeferredMaterialShinyNormalEmissive.mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredMaterialShinyNormalEmissive.mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredMaterialShinyNormalEmissive.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredMaterialShinyNormalEmissive.addPermutation("NORMAL_MATERIAL", "1"); - gDeferredMaterialShinyNormalEmissive.addPermutation("SHINY_MATERIAL", "1"); - gDeferredMaterialShinyNormalEmissive.addPermutation("EMISSIVE_MASK", "1"); - success = gDeferredMaterialShinyNormalEmissive.createShader(NULL, NULL); + if (success) + { + gDeferredMaterialProgram[i].mName = llformat("Deferred Material Shader %d", i); + + U32 alpha_mode = i & 0x3; + + gDeferredMaterialProgram[i].mShaderFiles.clear(); + gDeferredMaterialProgram[i].mShaderFiles.push_back(make_pair("deferred/materialV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredMaterialProgram[i].mShaderFiles.push_back(make_pair("deferred/materialF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredMaterialProgram[i].mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredMaterialProgram[i].addPermutation("HAS_NORMAL_MAP", i & 0x8? "1" : "0"); + gDeferredMaterialProgram[i].addPermutation("HAS_SPECULAR_MAP", i & 0x4 ? "1" : "0"); + gDeferredMaterialProgram[i].addPermutation("DIFFUSE_ALPHA_MODE", llformat("%d", alpha_mode)); + + success = gDeferredMaterialProgram[i].createShader(NULL, NULL); + } } + if (success) { gDeferredTreeProgram.mName = "Deferred Tree Shader"; -- cgit v1.2.3 From bf6182daa8b4d7cea79310547f71d7a3155e17b0 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Fri, 29 Mar 2013 07:50:08 -0700 Subject: Update Mac and Windows breakpad builds to latest --- indra/newview/llviewershadermgr.cpp | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 indra/newview/llviewershadermgr.cpp (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp old mode 100644 new mode 100755 -- cgit v1.2.3 From 14f02e48b877569539c96ef5f261ac8b3943579f Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 29 Mar 2013 20:12:27 -0500 Subject: NORSPEC-66 Hook up material parameters to rigged attachments. --- indra/newview/llviewershadermgr.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 4e38d2f7e9..286152867f 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -208,7 +208,7 @@ LLGLSLShader gDeferredStarProgram; LLGLSLShader gNormalMapGenProgram; // Deferred materials shaders -LLGLSLShader gDeferredMaterialProgram[LLMaterial::SHADER_COUNT]; +LLGLSLShader gDeferredMaterialProgram[LLMaterial::SHADER_COUNT*2]; LLViewerShaderMgr::LLViewerShaderMgr() : mVertexShaderLevel(SHADER_COUNT, 0), @@ -1108,7 +1108,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLCloudProgram.unload(); gDeferredStarProgram.unload(); gNormalMapGenProgram.unload(); - for (U32 i = 0; i < LLMaterial::SHADER_COUNT; ++i) + for (U32 i = 0; i < LLMaterial::SHADER_COUNT*2; ++i) { gDeferredMaterialProgram[i].unload(); } @@ -1227,7 +1227,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() } - for (U32 i = 0; i < LLMaterial::SHADER_COUNT; ++i) + for (U32 i = 0; i < LLMaterial::SHADER_COUNT*2; ++i) { if (success) { @@ -1243,6 +1243,13 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMaterialProgram[i].addPermutation("HAS_SPECULAR_MAP", i & 0x4 ? "1" : "0"); gDeferredMaterialProgram[i].addPermutation("DIFFUSE_ALPHA_MODE", llformat("%d", alpha_mode)); + bool has_skin = i & 0x10; + gDeferredMaterialProgram[i].addPermutation("HAS_SKIN",has_skin ? "1" : "0"); + if (has_skin) + { + gDeferredMaterialProgram[i].mFeatures.hasObjectSkinning = true; + } + success = gDeferredMaterialProgram[i].createShader(NULL, NULL); } } -- cgit v1.2.3 From 893bcf34f7daa432ce70224b4d30d3c22f9c80ad Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Tue, 9 Apr 2013 12:37:57 -0700 Subject: NORSPEC-59 work around nV driver crash when doing deferred rendering on NV 9400M/9600M --- indra/newview/llviewershadermgr.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 286152867f..ce066d85f1 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -783,9 +783,6 @@ BOOL LLViewerShaderMgr::loadBasicShaders() // Load basic dependency shaders first // All of these have to load for any shaders to function -#if LL_DARWIN // Mac can't currently handle all 8 lights, - S32 sum_lights_class = 2; -#else S32 sum_lights_class = 3; // class one cards will get the lower sum lights @@ -796,14 +793,21 @@ BOOL LLViewerShaderMgr::loadBasicShaders() { sum_lights_class = 2; } -#endif // If we have sun and moon only checked, then only sum those lights. if (gPipeline.getLightingDetail() == 0) { sum_lights_class = 1; } - + +#if LL_DARWIN + // Work around driver crashes on older Macs when using deferred rendering + // NORSPEC-59 + // + if (gGLManager.mIsMobileGF) + sum_lights_class = 3; +#endif + // Use the feature table to mask out the max light level to use. Also make sure it's at least 1. S32 max_light_class = gSavedSettings.getS32("RenderShaderLightingMaxLevel"); sum_lights_class = llclamp(sum_lights_class, 1, max_light_class); -- cgit v1.2.3 From cfc375777871ec3d04b9969793379d0cd78a012e Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 11 Apr 2013 14:57:11 -0400 Subject: First pass on alpha blended materials --- indra/newview/llviewershadermgr.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 286152867f..22ff78c639 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1206,9 +1206,9 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.mFeatures.disableTextureIndex = true; gDeferredSkinnedAlphaProgram.mShaderFiles.clear(); gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - + gDeferredSkinnedAlphaProgram.addPermutation("INDEX_MODE", "2"); success = gDeferredSkinnedAlphaProgram.createShader(NULL, NULL); // Hack to include uniforms for lighting without linking in lighting file @@ -1385,6 +1385,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredAlphaProgram.addPermutation("INDEX_MODE", "1"); success = gDeferredAlphaProgram.createShader(NULL, NULL); @@ -1554,9 +1555,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true; gDeferredAvatarAlphaProgram.mShaderFiles.clear(); gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaNoColorV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedNoColorF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - + gDeferredAvatarAlphaProgram.addPermutation("INDEX_MODE", "3"); + success = gDeferredAvatarAlphaProgram.createShader(NULL, &mAvatarUniforms); gDeferredAvatarAlphaProgram.mFeatures.calculatesLighting = true; -- cgit v1.2.3 From 7d623abfc3c7f6ef99ae3189a592211f4bf696db Mon Sep 17 00:00:00 2001 From: "Graham Madarasz (Graham Linden)" Date: Thu, 11 Apr 2013 20:16:11 -0700 Subject: NORSPEC-98 redux...hopefully fix mac AND linux at the same time --- indra/newview/llviewershadermgr.cpp | 38 ++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index ce066d85f1..4d16b4869c 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -175,6 +175,9 @@ LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram; LLGLSLShader gDeferredSkinnedDiffuseProgram; LLGLSLShader gDeferredSkinnedBumpProgram; LLGLSLShader gDeferredSkinnedAlphaProgram; +#if LL_DARWIN +LLGLSLShader gDeferredSkinnedAlphaProgramMac; +#endif LLGLSLShader gDeferredBumpProgram; LLGLSLShader gDeferredTerrainProgram; LLGLSLShader gDeferredTreeProgram; @@ -276,6 +279,9 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gDeferredSoftenProgram); mShaderList.push_back(&gDeferredAlphaProgram); mShaderList.push_back(&gDeferredSkinnedAlphaProgram); +#if LL_DARWIN + mShaderList.push_back(&gDeferredSkinnedAlphaProgramMac); +#endif mShaderList.push_back(&gDeferredFullbrightProgram); mShaderList.push_back(&gDeferredEmissiveProgram); mShaderList.push_back(&gDeferredAvatarEyesProgram); @@ -1082,6 +1088,9 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedDiffuseProgram.unload(); gDeferredSkinnedBumpProgram.unload(); gDeferredSkinnedAlphaProgram.unload(); +#if LL_DARWIN + gDeferredSkinnedAlphaProgramMac.unload(); +#endif gDeferredBumpProgram.unload(); gDeferredImpostorProgram.unload(); gDeferredTerrainProgram.unload(); @@ -1212,7 +1221,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - + gDeferredSkinnedAlphaProgram.addPermutation("MAC_GEFORCE_HACK","0"); success = gDeferredSkinnedAlphaProgram.createShader(NULL, NULL); // Hack to include uniforms for lighting without linking in lighting file @@ -1220,6 +1229,33 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.mFeatures.hasLighting = true; } +#if LL_DARWIN + if (success) + { + gDeferredSkinnedAlphaProgramMac.mName = "Deferred Skinned Alpha Shader"; + gDeferredSkinnedAlphaProgramMac.mFeatures.atmosphericHelpers = true; + gDeferredSkinnedAlphaProgramMac.mFeatures.hasObjectSkinning = true; + gDeferredSkinnedAlphaProgramMac.mFeatures.calculatesAtmospherics = true; + gDeferredSkinnedAlphaProgramMac.mFeatures.hasGamma = true; + gDeferredSkinnedAlphaProgramMac.mFeatures.hasAtmospherics = true; + gDeferredSkinnedAlphaProgramMac.mFeatures.calculatesLighting = false; + gDeferredSkinnedAlphaProgramMac.mFeatures.hasLighting = false; + gDeferredSkinnedAlphaProgramMac.mFeatures.isAlphaLighting = true; + gDeferredSkinnedAlphaProgramMac.mFeatures.disableTextureIndex = true; + gDeferredSkinnedAlphaProgramMac.mShaderFiles.clear(); + gDeferredSkinnedAlphaProgramMac.mShaderFiles.push_back(make_pair("deferred/alphaSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredSkinnedAlphaProgramMac.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSkinnedAlphaProgramMac.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredSkinnedAlphaProgramMac.addPermutation("MAC_GEFORCE_HACK","1"); + + success = gDeferredSkinnedAlphaProgramMac.createShader(NULL, NULL); + + // Hack to include uniforms for lighting without linking in lighting file + gDeferredSkinnedAlphaProgramMac.mFeatures.calculatesLighting = true; + gDeferredSkinnedAlphaProgramMac.mFeatures.hasLighting = true; + } +#endif + if (success) { gDeferredBumpProgram.mName = "Deferred Bump Shader"; -- cgit v1.2.3 From 6257a8394c23b518febdf5ec9c9ecbdce224e046 Mon Sep 17 00:00:00 2001 From: Geenz Date: Mon, 15 Apr 2013 01:35:21 -0400 Subject: Normal mapped alpha support. Specular and environment map support needs a bit of extra work (in progress). --- indra/newview/llviewershadermgr.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 22ff78c639..45e5d4869a 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1205,10 +1205,12 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.mFeatures.isAlphaLighting = true; gDeferredSkinnedAlphaProgram.mFeatures.disableTextureIndex = true; gDeferredSkinnedAlphaProgram.mShaderFiles.clear(); - gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredSkinnedAlphaProgram.addPermutation("INDEX_MODE", "2"); + gDeferredSkinnedAlphaProgram.addPermutation("HAS_SKIN", "1"); + gDeferredSkinnedAlphaProgram.addPermutation("IS_AVATAR_SKIN", "0"); success = gDeferredSkinnedAlphaProgram.createShader(NULL, NULL); // Hack to include uniforms for lighting without linking in lighting file @@ -1386,7 +1388,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredAlphaProgram.addPermutation("INDEX_MODE", "1"); - + gDeferredAlphaProgram.addPermutation("HAS_SKIN", "0"); + gDeferredAlphaProgram.addPermutation("IS_AVATAR_SKIN", "0"); success = gDeferredAlphaProgram.createShader(NULL, NULL); // Hack @@ -1554,10 +1557,12 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.mFeatures.isAlphaLighting = true; gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true; gDeferredAvatarAlphaProgram.mShaderFiles.clear(); - gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaNoColorV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; gDeferredAvatarAlphaProgram.addPermutation("INDEX_MODE", "3"); + gDeferredAvatarAlphaProgram.addPermutation("HAS_SKIN", "0"); + gDeferredAvatarAlphaProgram.addPermutation("IS_AVATAR_SKIN", "1"); success = gDeferredAvatarAlphaProgram.createShader(NULL, &mAvatarUniforms); -- cgit v1.2.3 From 8025b8b2bc6028ed268e191d432cb3f740e351db Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 15 Apr 2013 13:16:14 -0500 Subject: NORSPEC-49 Add shader profiler, add support for ARB_depth_clamp where available --- indra/newview/llviewershadermgr.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index ce066d85f1..ff66828e67 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1477,6 +1477,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + gDeferredShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); success = gDeferredShadowProgram.createShader(NULL, NULL); } @@ -1486,6 +1487,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowCubeProgram.mShaderFiles.clear(); gDeferredShadowCubeProgram.mShaderFiles.push_back(make_pair("deferred/shadowCubeV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredShadowCubeProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredShadowCubeProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); gDeferredShadowCubeProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredShadowCubeProgram.createShader(NULL, NULL); } @@ -1497,6 +1499,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowAlphaMaskProgram.mShaderFiles.clear(); gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredShadowAlphaMaskProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); gDeferredShadowAlphaMaskProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredShadowAlphaMaskProgram.createShader(NULL, NULL); } @@ -1508,6 +1511,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarShadowProgram.mShaderFiles.clear(); gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); gDeferredAvatarShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredAvatarShadowProgram.createShader(NULL, &mAvatarUniforms); } @@ -1519,6 +1523,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAttachmentShadowProgram.mShaderFiles.clear(); gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAttachmentShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); gDeferredAttachmentShadowProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredAttachmentShadowProgram.createShader(NULL, NULL); } -- cgit v1.2.3 From a9f3e6d95c03a469ac6b88e8d0ed4034cb978d88 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Tue, 16 Apr 2013 12:50:45 -0700 Subject: See if we can run with no ifdefs in alpha shaders on all platforms --- indra/newview/llviewershadermgr.cpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 94e41a8953..722e4d2ee6 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -175,9 +175,6 @@ LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram; LLGLSLShader gDeferredSkinnedDiffuseProgram; LLGLSLShader gDeferredSkinnedBumpProgram; LLGLSLShader gDeferredSkinnedAlphaProgram; -#if LL_DARWIN -LLGLSLShader gDeferredSkinnedAlphaProgramMac; -#endif LLGLSLShader gDeferredBumpProgram; LLGLSLShader gDeferredTerrainProgram; LLGLSLShader gDeferredTreeProgram; @@ -279,9 +276,6 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gDeferredSoftenProgram); mShaderList.push_back(&gDeferredAlphaProgram); mShaderList.push_back(&gDeferredSkinnedAlphaProgram); -#if LL_DARWIN - mShaderList.push_back(&gDeferredSkinnedAlphaProgramMac); -#endif mShaderList.push_back(&gDeferredFullbrightProgram); mShaderList.push_back(&gDeferredEmissiveProgram); mShaderList.push_back(&gDeferredAvatarEyesProgram); @@ -1088,9 +1082,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedDiffuseProgram.unload(); gDeferredSkinnedBumpProgram.unload(); gDeferredSkinnedAlphaProgram.unload(); -#if LL_DARWIN - gDeferredSkinnedAlphaProgramMac.unload(); -#endif gDeferredBumpProgram.unload(); gDeferredImpostorProgram.unload(); gDeferredTerrainProgram.unload(); @@ -1221,7 +1212,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredSkinnedAlphaProgram.addPermutation("MAC_GEFORCE_HACK","0"); success = gDeferredSkinnedAlphaProgram.createShader(NULL, NULL); // Hack to include uniforms for lighting without linking in lighting file @@ -1229,33 +1219,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.mFeatures.hasLighting = true; } -#if LL_DARWIN - if (success) - { - gDeferredSkinnedAlphaProgramMac.mName = "Deferred Skinned Alpha Shader"; - gDeferredSkinnedAlphaProgramMac.mFeatures.atmosphericHelpers = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.hasObjectSkinning = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.calculatesAtmospherics = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.hasGamma = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.hasAtmospherics = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.calculatesLighting = false; - gDeferredSkinnedAlphaProgramMac.mFeatures.hasLighting = false; - gDeferredSkinnedAlphaProgramMac.mFeatures.isAlphaLighting = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.disableTextureIndex = true; - gDeferredSkinnedAlphaProgramMac.mShaderFiles.clear(); - gDeferredSkinnedAlphaProgramMac.mShaderFiles.push_back(make_pair("deferred/alphaSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSkinnedAlphaProgramMac.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredSkinnedAlphaProgramMac.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredSkinnedAlphaProgramMac.addPermutation("MAC_GEFORCE_HACK","1"); - - success = gDeferredSkinnedAlphaProgramMac.createShader(NULL, NULL); - - // Hack to include uniforms for lighting without linking in lighting file - gDeferredSkinnedAlphaProgramMac.mFeatures.calculatesLighting = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.hasLighting = true; - } -#endif - if (success) { gDeferredBumpProgram.mName = "Deferred Bump Shader"; -- cgit v1.2.3 From 67af268b785e8a47d7db10aa3a566c269b0f16e3 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 17 Apr 2013 01:51:39 -0500 Subject: NORSPEC-90 Alpha pool hookups for materials. --- indra/newview/llviewershadermgr.cpp | 85 ++++++++++++++----------------------- 1 file changed, 32 insertions(+), 53 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index eb43141c9b..40027672cc 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -175,9 +175,6 @@ LLGLSLShader gDeferredNonIndexedDiffuseAlphaMaskNoColorProgram; LLGLSLShader gDeferredSkinnedDiffuseProgram; LLGLSLShader gDeferredSkinnedBumpProgram; LLGLSLShader gDeferredSkinnedAlphaProgram; -#if LL_DARWIN -LLGLSLShader gDeferredSkinnedAlphaProgramMac; -#endif LLGLSLShader gDeferredBumpProgram; LLGLSLShader gDeferredTerrainProgram; LLGLSLShader gDeferredTreeProgram; @@ -277,11 +274,16 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gUnderWaterProgram); mShaderList.push_back(&gDeferredSunProgram); mShaderList.push_back(&gDeferredSoftenProgram); + mShaderList.push_back(&gDeferredMaterialProgram[1]); + mShaderList.push_back(&gDeferredMaterialProgram[5]); + mShaderList.push_back(&gDeferredMaterialProgram[9]); + mShaderList.push_back(&gDeferredMaterialProgram[13]); + mShaderList.push_back(&gDeferredMaterialProgram[1+LLMaterial::SHADER_COUNT]); + mShaderList.push_back(&gDeferredMaterialProgram[5+LLMaterial::SHADER_COUNT]); + mShaderList.push_back(&gDeferredMaterialProgram[9+LLMaterial::SHADER_COUNT]); + mShaderList.push_back(&gDeferredMaterialProgram[13+LLMaterial::SHADER_COUNT]); mShaderList.push_back(&gDeferredAlphaProgram); mShaderList.push_back(&gDeferredSkinnedAlphaProgram); -#if LL_DARWIN - mShaderList.push_back(&gDeferredSkinnedAlphaProgramMac); -#endif mShaderList.push_back(&gDeferredFullbrightProgram); mShaderList.push_back(&gDeferredEmissiveProgram); mShaderList.push_back(&gDeferredAvatarEyesProgram); @@ -789,6 +791,9 @@ BOOL LLViewerShaderMgr::loadBasicShaders() // Load basic dependency shaders first // All of these have to load for any shaders to function +#if LL_DARWIN // Mac can't currently handle all 8 lights, + S32 sum_lights_class = 2; +#else S32 sum_lights_class = 3; // class one cards will get the lower sum lights @@ -799,21 +804,14 @@ BOOL LLViewerShaderMgr::loadBasicShaders() { sum_lights_class = 2; } +#endif // If we have sun and moon only checked, then only sum those lights. if (gPipeline.getLightingDetail() == 0) { sum_lights_class = 1; } - -#if LL_DARWIN - // Work around driver crashes on older Macs when using deferred rendering - // NORSPEC-59 - // - if (gGLManager.mIsMobileGF) - sum_lights_class = 3; -#endif - + // Use the feature table to mask out the max light level to use. Also make sure it's at least 1. S32 max_light_class = gSavedSettings.getS32("RenderShaderLightingMaxLevel"); sum_lights_class = llclamp(sum_lights_class, 1, max_light_class); @@ -1088,9 +1086,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedDiffuseProgram.unload(); gDeferredSkinnedBumpProgram.unload(); gDeferredSkinnedAlphaProgram.unload(); -#if LL_DARWIN - gDeferredSkinnedAlphaProgramMac.unload(); -#endif gDeferredBumpProgram.unload(); gDeferredImpostorProgram.unload(); gDeferredTerrainProgram.unload(); @@ -1224,8 +1219,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.addPermutation("INDEX_MODE", "2"); gDeferredSkinnedAlphaProgram.addPermutation("HAS_SKIN", "1"); gDeferredSkinnedAlphaProgram.addPermutation("IS_AVATAR_SKIN", "0"); - gDeferredSkinnedAlphaProgram.addPermutation("MAC_GEFORCE_HACK","0"); - success = gDeferredSkinnedAlphaProgram.createShader(NULL, NULL); // Hack to include uniforms for lighting without linking in lighting file @@ -1233,36 +1226,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.mFeatures.hasLighting = true; } -#if LL_DARWIN - if (success) - { - gDeferredSkinnedAlphaProgramMac.mName = "Deferred Skinned Alpha Shader"; - gDeferredSkinnedAlphaProgramMac.mFeatures.atmosphericHelpers = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.hasObjectSkinning = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.calculatesAtmospherics = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.hasGamma = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.hasAtmospherics = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.calculatesLighting = false; - gDeferredSkinnedAlphaProgramMac.mFeatures.hasLighting = false; - gDeferredSkinnedAlphaProgramMac.mFeatures.isAlphaLighting = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.disableTextureIndex = true; - gDeferredSkinnedAlphaProgramMac.mShaderFiles.clear(); - gDeferredSkinnedAlphaProgramMac.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredSkinnedAlphaProgramMac.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredSkinnedAlphaProgramMac.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredSkinnedAlphaProgramMac.addPermutation("INDEX_MODE", "2"); - gDeferredSkinnedAlphaProgramMac.addPermutation("HAS_SKIN", "1"); - gDeferredSkinnedAlphaProgramMac.addPermutation("IS_AVATAR_SKIN", "0"); - gDeferredSkinnedAlphaProgramMac.addPermutation("MAC_GEFORCE_HACK","1"); - - success = gDeferredSkinnedAlphaProgramMac.createShader(NULL, NULL); - - // Hack to include uniforms for lighting without linking in lighting file - gDeferredSkinnedAlphaProgramMac.mFeatures.calculatesLighting = true; - gDeferredSkinnedAlphaProgramMac.mFeatures.hasLighting = true; - } -#endif - if (success) { gDeferredBumpProgram.mName = "Deferred Bump Shader"; @@ -1273,6 +1236,14 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() success = gDeferredBumpProgram.createShader(NULL, NULL); } + gDeferredMaterialProgram[1].mFeatures.hasLighting = false; + gDeferredMaterialProgram[5].mFeatures.hasLighting = false; + gDeferredMaterialProgram[9].mFeatures.hasLighting = false; + gDeferredMaterialProgram[13].mFeatures.hasLighting = false; + gDeferredMaterialProgram[1+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = false; + gDeferredMaterialProgram[5+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = false; + gDeferredMaterialProgram[9+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = false; + gDeferredMaterialProgram[13+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = false; for (U32 i = 0; i < LLMaterial::SHADER_COUNT*2; ++i) { @@ -1289,7 +1260,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMaterialProgram[i].addPermutation("HAS_NORMAL_MAP", i & 0x8? "1" : "0"); gDeferredMaterialProgram[i].addPermutation("HAS_SPECULAR_MAP", i & 0x4 ? "1" : "0"); gDeferredMaterialProgram[i].addPermutation("DIFFUSE_ALPHA_MODE", llformat("%d", alpha_mode)); - + gDeferredMaterialProgram[i].addPermutation("HAS_SUN_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); bool has_skin = i & 0x10; gDeferredMaterialProgram[i].addPermutation("HAS_SKIN",has_skin ? "1" : "0"); if (has_skin) @@ -1301,6 +1272,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() } } + gDeferredMaterialProgram[1].mFeatures.hasLighting = true; + gDeferredMaterialProgram[5].mFeatures.hasLighting = true; + gDeferredMaterialProgram[9].mFeatures.hasLighting = true; + gDeferredMaterialProgram[13].mFeatures.hasLighting = true; + gDeferredMaterialProgram[1+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = true; + gDeferredMaterialProgram[5+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = true; + gDeferredMaterialProgram[9+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = true; + gDeferredMaterialProgram[13+LLMaterial::SHADER_COUNT].mFeatures.hasLighting = true; + + if (success) { @@ -1435,7 +1416,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.addPermutation("INDEX_MODE", "1"); gDeferredAlphaProgram.addPermutation("HAS_SKIN", "0"); gDeferredAlphaProgram.addPermutation("IS_AVATAR_SKIN", "0"); - gDeferredAlphaProgram.addPermutation("MAC_GEFORCE_HACK","0"); success = gDeferredAlphaProgram.createShader(NULL, NULL); // Hack @@ -1609,7 +1589,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.addPermutation("INDEX_MODE", "3"); gDeferredAvatarAlphaProgram.addPermutation("HAS_SKIN", "0"); gDeferredAvatarAlphaProgram.addPermutation("IS_AVATAR_SKIN", "1"); - gDeferredAvatarAlphaProgram.addPermutation("MAC_GEFORCE_HACK","0"); success = gDeferredAvatarAlphaProgram.createShader(NULL, &mAvatarUniforms); -- cgit v1.2.3 From 1a5bba865c096473164b47a56dbb0ba1e055613d Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 18 Apr 2013 18:00:56 -0500 Subject: NORSPEC-90 Cleanup of alpha pool hook ups for materials. --- indra/newview/llviewershadermgr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index d30fe50ac8..2442e04a42 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1412,8 +1412,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.mShaderFiles.clear(); gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAlphaProgram.addPermutation("INDEX_MODE", "1"); + gDeferredAlphaProgram.addPermutation("HAS_SKIN", "0"); + gDeferredAlphaProgram.addPermutation("IS_AVATAR_SKIN", "0"); gDeferredAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - success = gDeferredAlphaProgram.createShader(NULL, NULL); // Hack -- cgit v1.2.3 From 6b836eacafd21c1ccac2c7276483ed393a4b406e Mon Sep 17 00:00:00 2001 From: Geenz Date: Thu, 18 Apr 2013 19:43:30 -0400 Subject: Use GL_SRGB8_ALPHA8 for the diffuse and specular buffers, and correct gamma *before* glow and other post processing effects that don't care about being gamma correct. --- indra/newview/llviewershadermgr.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 8096738197..4ce98f0e02 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -200,6 +200,7 @@ LLGLSLShader gDeferredEmissiveProgram; LLGLSLShader gDeferredPostProgram; LLGLSLShader gDeferredCoFProgram; LLGLSLShader gDeferredDoFCombineProgram; +LLGLSLShader gDeferredPostGammaCorrectProgram; LLGLSLShader gFXAAProgram; LLGLSLShader gDeferredPostNoDoFProgram; LLGLSLShader gDeferredWLSkyProgram; @@ -1110,6 +1111,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredPostProgram.unload(); gDeferredCoFProgram.unload(); gDeferredDoFCombineProgram.unload(); + gDeferredPostNoDoFProgram.unload(); + gDeferredPostGammaCorrectProgram.unload(); gFXAAProgram.unload(); gDeferredWaterProgram.unload(); gDeferredWLSkyProgram.unload(); @@ -1650,6 +1653,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredPostNoDoFProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredPostNoDoFProgram.createShader(NULL, NULL); } + + if (success) + { + gDeferredPostGammaCorrectProgram.mName = "Deferred Gamma Correct Shader"; + gDeferredPostGammaCorrectProgram.mShaderFiles.clear(); + gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredPostGammaCorrectProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredGammaCorrect.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredPostGammaCorrectProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredPostGammaCorrectProgram.createShader(NULL, NULL); + } if (success) { -- cgit v1.2.3 From 509c35d5bae7dbd938198c3e038011932693ff36 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 18 Apr 2013 19:21:08 -0500 Subject: NORSPEC-90 Cleanup avatar alpha shaders --- indra/newview/llviewershadermgr.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 2442e04a42..499f6a848c 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1588,8 +1588,11 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.mFeatures.isAlphaLighting = true; gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true; gDeferredAvatarAlphaProgram.mShaderFiles.clear(); - gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/avatarAlphaNoColorV.glsl", GL_VERTEX_SHADER_ARB)); - gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaNonIndexedNoColorF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredAvatarAlphaProgram.addPermutation("INDEX_MODE", "3"); + gDeferredAvatarAlphaProgram.addPermutation("HAS_SKIN", "0"); + gDeferredAvatarAlphaProgram.addPermutation("IS_AVATAR_SKIN", "1"); gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredAvatarAlphaProgram.createShader(NULL, &mAvatarUniforms); -- cgit v1.2.3 From 79318043218a9ec6cb6e52eca936487177554903 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Wed, 24 Apr 2013 06:24:21 -0700 Subject: NORSPEC-59 NORSPEC-125 make materials and alpha shaders work on Mac laptops with nV mobile graphics cards --- indra/newview/llviewershadermgr.cpp | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index edd1546263..850bf9677c 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -792,9 +792,6 @@ BOOL LLViewerShaderMgr::loadBasicShaders() // Load basic dependency shaders first // All of these have to load for any shaders to function -#if LL_DARWIN // Mac can't currently handle all 8 lights, - S32 sum_lights_class = 2; -#else S32 sum_lights_class = 3; // class one cards will get the lower sum lights @@ -805,7 +802,6 @@ BOOL LLViewerShaderMgr::loadBasicShaders() { sum_lights_class = 2; } -#endif // If we have sun and moon only checked, then only sum those lights. if (gPipeline.getLightingDetail() == 0) @@ -813,6 +809,14 @@ BOOL LLViewerShaderMgr::loadBasicShaders() sum_lights_class = 1; } +#if LL_DARWIN + // Work around driver crashes on older Macs when using deferred rendering + // NORSPEC-59 + // + if (gGLManager.mIsMobileGF) + sum_lights_class = 3; +#endif + // Use the feature table to mask out the max light level to use. Also make sure it's at least 1. S32 max_light_class = gSavedSettings.getS32("RenderShaderLightingMaxLevel"); sum_lights_class = llclamp(sum_lights_class, 1, max_light_class); @@ -1218,9 +1222,9 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredSkinnedAlphaProgram.addPermutation("INDEX_MODE", "2"); + gDeferredSkinnedAlphaProgram.addPermutation("USE_DIFFUSE_TEX", "1"); + gDeferredSkinnedAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); gDeferredSkinnedAlphaProgram.addPermutation("HAS_SKIN", "1"); - gDeferredSkinnedAlphaProgram.addPermutation("IS_AVATAR_SKIN", "0"); success = gDeferredSkinnedAlphaProgram.createShader(NULL, NULL); // Hack to include uniforms for lighting without linking in lighting file @@ -1265,6 +1269,16 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMaterialProgram[i].addPermutation("HAS_SUN_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); bool has_skin = i & 0x10; gDeferredMaterialProgram[i].addPermutation("HAS_SKIN",has_skin ? "1" : "0"); + + #if LL_DARWIN + // include spec exp clamp to fix older mac rendering artifacts + // + if (gGLManager.mIsMobileGF) + { + gDeferredMaterialProgram[i].addPermutation("UGLY_MAC_HACK","1"); + } + #endif + if (has_skin) { gDeferredMaterialProgram[i].mFeatures.hasObjectSkinning = true; @@ -1414,9 +1428,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.mShaderFiles.clear(); gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredAlphaProgram.addPermutation("INDEX_MODE", "1"); - gDeferredAlphaProgram.addPermutation("HAS_SKIN", "0"); - gDeferredAlphaProgram.addPermutation("IS_AVATAR_SKIN", "0"); + gDeferredAlphaProgram.addPermutation("USE_INDEXED_TEX", "1"); + gDeferredAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); gDeferredAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredAlphaProgram.createShader(NULL, NULL); @@ -1592,8 +1605,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.mShaderFiles.clear(); gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredAvatarAlphaProgram.addPermutation("INDEX_MODE", "3"); - gDeferredAvatarAlphaProgram.addPermutation("HAS_SKIN", "0"); + gDeferredAvatarAlphaProgram.addPermutation("USE_DIFFUSE_TEX", "1"); gDeferredAvatarAlphaProgram.addPermutation("IS_AVATAR_SKIN", "1"); gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; -- cgit v1.2.3 From 1688e995eb936c7a38b731fab902dd02aef151d5 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Fri, 26 Apr 2013 09:11:52 -0700 Subject: Provide LLGLSLShader backwards compat so as not to break the appearance utility --- indra/newview/llviewershadermgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 850bf9677c..8c21145860 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -849,7 +849,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders() for (U32 i = 0; i < shaders.size(); i++) { // Note usage of GL_VERTEX_SHADER_ARB - if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER_ARB, attribs) == 0) + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER_ARB, &attribs) == 0) { return FALSE; } @@ -901,7 +901,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders() for (U32 i = 0; i < shaders.size(); i++) { // Note usage of GL_FRAGMENT_SHADER_ARB - if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER_ARB, attribs, index_channels[i]) == 0) + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER_ARB, &attribs, index_channels[i]) == 0) { return FALSE; } -- cgit v1.2.3 From 806d09b1143894ad66cea2c228f467e8c39a8adf Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Tue, 30 Apr 2013 19:50:05 -0700 Subject: Merge 3.5.1 into Materials --- indra/newview/llviewershadermgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 850bf9677c..8c21145860 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -849,7 +849,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders() for (U32 i = 0; i < shaders.size(); i++) { // Note usage of GL_VERTEX_SHADER_ARB - if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER_ARB, attribs) == 0) + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_VERTEX_SHADER_ARB, &attribs) == 0) { return FALSE; } @@ -901,7 +901,7 @@ BOOL LLViewerShaderMgr::loadBasicShaders() for (U32 i = 0; i < shaders.size(); i++) { // Note usage of GL_FRAGMENT_SHADER_ARB - if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER_ARB, attribs, index_channels[i]) == 0) + if (loadShaderFile(shaders[i].first, shaders[i].second, GL_FRAGMENT_SHADER_ARB, &attribs, index_channels[i]) == 0) { return FALSE; } -- cgit v1.2.3 From df6bb7ace2f2ca26f5fabf8305e190e7d0066cf1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 6 May 2013 11:11:49 -0500 Subject: MATBUG-78 Fix for alpha lighting falloff not matching for sunlight when shadows are enabled. --- indra/newview/llviewershadermgr.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 8c21145860..fce06b9e13 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1225,6 +1225,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.addPermutation("USE_DIFFUSE_TEX", "1"); gDeferredSkinnedAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); gDeferredSkinnedAlphaProgram.addPermutation("HAS_SKIN", "1"); + gDeferredSkinnedAlphaProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); success = gDeferredSkinnedAlphaProgram.createShader(NULL, NULL); // Hack to include uniforms for lighting without linking in lighting file @@ -1430,6 +1431,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAlphaProgram.addPermutation("USE_INDEXED_TEX", "1"); gDeferredAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); + gDeferredAlphaProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); gDeferredAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredAlphaProgram.createShader(NULL, NULL); @@ -1607,6 +1609,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredAvatarAlphaProgram.addPermutation("USE_DIFFUSE_TEX", "1"); gDeferredAvatarAlphaProgram.addPermutation("IS_AVATAR_SKIN", "1"); + gDeferredAvatarAlphaProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); gDeferredAvatarAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; success = gDeferredAvatarAlphaProgram.createShader(NULL, &mAvatarUniforms); -- cgit v1.2.3 From a37bff8bf1add5afe154b25156d7ebe38ff9af31 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Tue, 14 May 2013 15:26:43 -0700 Subject: NORSPEC-103 reflect normal/spec UVs in face edit overlay display --- indra/newview/llviewershadermgr.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index fce06b9e13..022ddb69ce 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -143,6 +143,9 @@ LLGLSLShader gUnderWaterProgram; //interface shaders LLGLSLShader gHighlightProgram; +LLGLSLShader gHighlightNormalProgram; +LLGLSLShader gHighlightSpecularProgram; + LLGLSLShader gPathfindingProgram; LLGLSLShader gPathfindingNoNormalsProgram; @@ -752,6 +755,8 @@ void LLViewerShaderMgr::unloadShaders() gAvatarEyeballProgram.unload(); gAvatarPickProgram.unload(); gHighlightProgram.unload(); + gHighlightNormalProgram.unload(); + gHighlightSpecularProgram.unload(); gWLSkyProgram.unload(); gWLCloudProgram.unload(); @@ -2703,6 +2708,26 @@ BOOL LLViewerShaderMgr::loadShadersInterface() success = gHighlightProgram.createShader(NULL, NULL); } + if (success) + { + gHighlightNormalProgram.mName = "Highlight Normals Shader"; + gHighlightNormalProgram.mShaderFiles.clear(); + gHighlightNormalProgram.mShaderFiles.push_back(make_pair("interface/highlightNormV.glsl", GL_VERTEX_SHADER_ARB)); + gHighlightNormalProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gHighlightNormalProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gHighlightNormalProgram.createShader(NULL, NULL); + } + + if (success) + { + gHighlightSpecularProgram.mName = "Highlight Spec Shader"; + gHighlightSpecularProgram.mShaderFiles.clear(); + gHighlightSpecularProgram.mShaderFiles.push_back(make_pair("interface/highlightSpecV.glsl", GL_VERTEX_SHADER_ARB)); + gHighlightSpecularProgram.mShaderFiles.push_back(make_pair("interface/highlightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gHighlightSpecularProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gHighlightSpecularProgram.createShader(NULL, NULL); + } + if (success) { gUIProgram.mName = "UI Shader"; -- cgit v1.2.3 From f18fd226c32747dfb53f4d4f7b00b7d682133d5e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 16 May 2013 17:13:16 -0500 Subject: Fix for compilation error in shadows disabled and don't load transform feedback shaders unless transform feedback is enabled. --- indra/newview/llviewershadermgr.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index fce06b9e13..99a9bfd9fa 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -463,6 +463,12 @@ void LLViewerShaderMgr::setShaders() S32 deferred_class = 0; S32 transform_class = gGLManager.mHasTransformFeedback ? 1 : 0; + static LLCachedControl use_transform_feedback(gSavedSettings, "RenderUseTransformFeedback"); + if (!use_transform_feedback) + { + transform_class = 0; + } + if (LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && gSavedSettings.getBOOL("RenderDeferred") && gSavedSettings.getBOOL("RenderAvatarVP") && -- cgit v1.2.3 From 933d4c40f42babf74320dca70ac08009b8577fa1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 23 May 2013 12:47:52 -0500 Subject: NORSPEC-198, NORSPEC-176, NORSPEC-106 WIP Fix for various fullbright/shiny descrepencies. --- indra/newview/llviewershadermgr.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 14d98d9a5a..87c5211952 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -209,6 +209,8 @@ LLGLSLShader gDeferredPostNoDoFProgram; LLGLSLShader gDeferredWLSkyProgram; LLGLSLShader gDeferredWLCloudProgram; LLGLSLShader gDeferredStarProgram; +LLGLSLShader gDeferredFullbrightShinyProgram; +LLGLSLShader gDeferredSkinnedFullbrightShinyProgram; LLGLSLShader gNormalMapGenProgram; // Deferred materials shaders @@ -289,6 +291,8 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gDeferredAlphaProgram); mShaderList.push_back(&gDeferredSkinnedAlphaProgram); mShaderList.push_back(&gDeferredFullbrightProgram); + mShaderList.push_back(&gDeferredFullbrightShinyProgram); + mShaderList.push_back(&gDeferredSkinnedFullbrightShinyProgram); mShaderList.push_back(&gDeferredEmissiveProgram); mShaderList.push_back(&gDeferredAvatarEyesProgram); mShaderList.push_back(&gDeferredWaterProgram); @@ -1132,6 +1136,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredWLSkyProgram.unload(); gDeferredWLCloudProgram.unload(); gDeferredStarProgram.unload(); + gDeferredFullbrightShinyProgram.unload(); + gDeferredSkinnedFullbrightShinyProgram.unload(); gNormalMapGenProgram.unload(); for (U32 i = 0; i < LLMaterial::SHADER_COUNT*2; ++i) { @@ -1479,6 +1485,35 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() success = gDeferredFullbrightProgram.createShader(NULL, NULL); } + if (success) + { + gDeferredFullbrightShinyProgram.mName = "Deferred FullbrightShiny Shader"; + gDeferredFullbrightShinyProgram.mFeatures.calculatesAtmospherics = true; + gDeferredFullbrightShinyProgram.mFeatures.hasGamma = true; + gDeferredFullbrightShinyProgram.mFeatures.hasTransport = true; + gDeferredFullbrightShinyProgram.mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); + gDeferredFullbrightShinyProgram.mShaderFiles.clear(); + gDeferredFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredFullbrightShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + success = gDeferredFullbrightShinyProgram.createShader(NULL, &mShinyUniforms); + } + + if (success) + { + gDeferredSkinnedFullbrightShinyProgram.mName = "Skinned Fullbright Shiny Shader"; + gDeferredSkinnedFullbrightShinyProgram.mFeatures.calculatesAtmospherics = true; + gDeferredSkinnedFullbrightShinyProgram.mFeatures.hasGamma = true; + gDeferredSkinnedFullbrightShinyProgram.mFeatures.hasTransport = true; + gDeferredSkinnedFullbrightShinyProgram.mFeatures.hasObjectSkinning = true; + gDeferredSkinnedFullbrightShinyProgram.mFeatures.disableTextureIndex = true; + gDeferredSkinnedFullbrightShinyProgram.mShaderFiles.clear(); + gDeferredSkinnedFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinySkinnedV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredSkinnedFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSkinnedFullbrightShinyProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gDeferredSkinnedFullbrightShinyProgram.createShader(NULL, &mShinyUniforms); + } + if (success) { gDeferredEmissiveProgram.mName = "Deferred Emissive Shader"; -- cgit v1.2.3 From 743d1a777e5c2827d50051c3f5e0942a870a6ff9 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 29 May 2013 18:48:09 -0500 Subject: NORSPEC-198, NORSPEC-176, NORSPEC-106, NORSPEC-202 et al -- Material matrix testing based overhaul WIP Reviewed by Graham --- indra/newview/llviewershadermgr.cpp | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 87c5211952..a36d6c10da 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -211,6 +211,7 @@ LLGLSLShader gDeferredWLCloudProgram; LLGLSLShader gDeferredStarProgram; LLGLSLShader gDeferredFullbrightShinyProgram; LLGLSLShader gDeferredSkinnedFullbrightShinyProgram; +LLGLSLShader gDeferredSkinnedFullbrightProgram; LLGLSLShader gNormalMapGenProgram; // Deferred materials shaders @@ -293,6 +294,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gDeferredFullbrightProgram); mShaderList.push_back(&gDeferredFullbrightShinyProgram); mShaderList.push_back(&gDeferredSkinnedFullbrightShinyProgram); + mShaderList.push_back(&gDeferredSkinnedFullbrightProgram); mShaderList.push_back(&gDeferredEmissiveProgram); mShaderList.push_back(&gDeferredAvatarEyesProgram); mShaderList.push_back(&gDeferredWaterProgram); @@ -1138,6 +1140,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredStarProgram.unload(); gDeferredFullbrightShinyProgram.unload(); gDeferredSkinnedFullbrightShinyProgram.unload(); + gDeferredSkinnedFullbrightProgram.unload(); + gNormalMapGenProgram.unload(); for (U32 i = 0; i < LLMaterial::SHADER_COUNT*2; ++i) { @@ -1491,7 +1495,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightShinyProgram.mFeatures.calculatesAtmospherics = true; gDeferredFullbrightShinyProgram.mFeatures.hasGamma = true; gDeferredFullbrightShinyProgram.mFeatures.hasTransport = true; - gDeferredFullbrightShinyProgram.mFeatures.mIndexedTextureChannels = llmax(LLGLSLShader::sIndexedTextureChannels-1, 1); + gDeferredFullbrightShinyProgram.mFeatures.mIndexedTextureChannels = 0; gDeferredFullbrightShinyProgram.mShaderFiles.clear(); gDeferredFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER_ARB)); @@ -1499,6 +1503,21 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() success = gDeferredFullbrightShinyProgram.createShader(NULL, &mShinyUniforms); } + if (success) + { + gDeferredSkinnedFullbrightProgram.mName = "Skinned Fullbright Shader"; + gDeferredSkinnedFullbrightProgram.mFeatures.calculatesAtmospherics = true; + gDeferredSkinnedFullbrightProgram.mFeatures.hasGamma = true; + gDeferredSkinnedFullbrightProgram.mFeatures.hasTransport = true; + gDeferredSkinnedFullbrightProgram.mFeatures.hasObjectSkinning = true; + gDeferredSkinnedFullbrightProgram.mFeatures.disableTextureIndex = true; + gDeferredSkinnedFullbrightProgram.mShaderFiles.clear(); + gDeferredSkinnedFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); + gDeferredSkinnedFullbrightProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSkinnedFullbrightProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gDeferredSkinnedFullbrightProgram.createShader(NULL, NULL); + } + if (success) { gDeferredSkinnedFullbrightShinyProgram.mName = "Skinned Fullbright Shiny Shader"; @@ -2455,6 +2474,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectSimpleProgram.mFeatures.hasAtmospherics = true; gSkinnedObjectSimpleProgram.mFeatures.hasLighting = true; gSkinnedObjectSimpleProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectSimpleProgram.mFeatures.hasAlphaMask = true; gSkinnedObjectSimpleProgram.mFeatures.disableTextureIndex = true; gSkinnedObjectSimpleProgram.mShaderFiles.clear(); gSkinnedObjectSimpleProgram.mShaderFiles.push_back(make_pair("objects/simpleSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); @@ -2471,6 +2491,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectFullbrightProgram.mFeatures.hasTransport = true; gSkinnedObjectFullbrightProgram.mFeatures.isFullbright = true; gSkinnedObjectFullbrightProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectFullbrightProgram.mFeatures.hasAlphaMask = true; gSkinnedObjectFullbrightProgram.mFeatures.disableTextureIndex = true; gSkinnedObjectFullbrightProgram.mShaderFiles.clear(); gSkinnedObjectFullbrightProgram.mShaderFiles.push_back(make_pair("objects/fullbrightSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); @@ -2487,6 +2508,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectEmissiveProgram.mFeatures.hasTransport = true; gSkinnedObjectEmissiveProgram.mFeatures.isFullbright = true; gSkinnedObjectEmissiveProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectEmissiveProgram.mFeatures.hasAlphaMask = true; gSkinnedObjectEmissiveProgram.mFeatures.disableTextureIndex = true; gSkinnedObjectEmissiveProgram.mShaderFiles.clear(); gSkinnedObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/emissiveSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); @@ -2503,6 +2525,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectEmissiveWaterProgram.mFeatures.hasTransport = true; gSkinnedObjectEmissiveWaterProgram.mFeatures.isFullbright = true; gSkinnedObjectEmissiveWaterProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectEmissiveWaterProgram.mFeatures.hasAlphaMask = true; gSkinnedObjectEmissiveWaterProgram.mFeatures.disableTextureIndex = true; gSkinnedObjectEmissiveWaterProgram.mFeatures.hasWaterFog = true; gSkinnedObjectEmissiveWaterProgram.mShaderFiles.clear(); @@ -2521,6 +2544,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectFullbrightShinyProgram.mFeatures.isShiny = true; gSkinnedObjectFullbrightShinyProgram.mFeatures.isFullbright = true; gSkinnedObjectFullbrightShinyProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectFullbrightShinyProgram.mFeatures.hasAlphaMask = true; gSkinnedObjectFullbrightShinyProgram.mFeatures.disableTextureIndex = true; gSkinnedObjectFullbrightShinyProgram.mShaderFiles.clear(); gSkinnedObjectFullbrightShinyProgram.mShaderFiles.push_back(make_pair("objects/fullbrightShinySkinnedV.glsl", GL_VERTEX_SHADER_ARB)); @@ -2537,6 +2561,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectShinySimpleProgram.mFeatures.hasGamma = true; gSkinnedObjectShinySimpleProgram.mFeatures.hasAtmospherics = true; gSkinnedObjectShinySimpleProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectShinySimpleProgram.mFeatures.hasAlphaMask = true; gSkinnedObjectShinySimpleProgram.mFeatures.isShiny = true; gSkinnedObjectShinySimpleProgram.mFeatures.disableTextureIndex = true; gSkinnedObjectShinySimpleProgram.mShaderFiles.clear(); @@ -2558,6 +2583,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectSimpleWaterProgram.mFeatures.hasWaterFog = true; gSkinnedObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; gSkinnedObjectSimpleWaterProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectSimpleWaterProgram.mFeatures.hasAlphaMask = true; gSkinnedObjectSimpleWaterProgram.mFeatures.disableTextureIndex = true; gSkinnedObjectSimpleWaterProgram.mShaderFiles.clear(); gSkinnedObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); @@ -2574,6 +2600,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectFullbrightWaterProgram.mFeatures.hasTransport = true; gSkinnedObjectFullbrightWaterProgram.mFeatures.isFullbright = true; gSkinnedObjectFullbrightWaterProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectFullbrightWaterProgram.mFeatures.hasAlphaMask = true; gSkinnedObjectFullbrightWaterProgram.mFeatures.hasWaterFog = true; gSkinnedObjectFullbrightWaterProgram.mFeatures.disableTextureIndex = true; gSkinnedObjectFullbrightWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; @@ -2593,6 +2620,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectFullbrightShinyWaterProgram.mFeatures.isShiny = true; gSkinnedObjectFullbrightShinyWaterProgram.mFeatures.isFullbright = true; gSkinnedObjectFullbrightShinyWaterProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectFullbrightShinyWaterProgram.mFeatures.hasAlphaMask = true; gSkinnedObjectFullbrightShinyWaterProgram.mFeatures.hasWaterFog = true; gSkinnedObjectFullbrightShinyWaterProgram.mFeatures.disableTextureIndex = true; gSkinnedObjectFullbrightShinyWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; @@ -2611,6 +2639,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectShinySimpleWaterProgram.mFeatures.hasGamma = true; gSkinnedObjectShinySimpleWaterProgram.mFeatures.hasAtmospherics = true; gSkinnedObjectShinySimpleWaterProgram.mFeatures.hasObjectSkinning = true; + gSkinnedObjectShinySimpleWaterProgram.mFeatures.hasAlphaMask = true; gSkinnedObjectShinySimpleWaterProgram.mFeatures.isShiny = true; gSkinnedObjectShinySimpleWaterProgram.mFeatures.hasWaterFog = true; gSkinnedObjectShinySimpleWaterProgram.mFeatures.disableTextureIndex = true; -- cgit v1.2.3 From 08f9ef92399ab4abdc8652c48c85c1110b907e37 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 31 May 2013 12:53:58 -0500 Subject: NORSPEC-223 Fix for wrong textures displaying on fullbright+shiny faces with advanced lighting enabled. --- indra/newview/llviewershadermgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index a36d6c10da..5f08e8ca2e 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1495,7 +1495,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredFullbrightShinyProgram.mFeatures.calculatesAtmospherics = true; gDeferredFullbrightShinyProgram.mFeatures.hasGamma = true; gDeferredFullbrightShinyProgram.mFeatures.hasTransport = true; - gDeferredFullbrightShinyProgram.mFeatures.mIndexedTextureChannels = 0; + gDeferredFullbrightShinyProgram.mFeatures.mIndexedTextureChannels = LLGLSLShader::sIndexedTextureChannels-1; gDeferredFullbrightShinyProgram.mShaderFiles.clear(); gDeferredFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredFullbrightShinyProgram.mShaderFiles.push_back(make_pair("deferred/fullbrightShinyF.glsl", GL_FRAGMENT_SHADER_ARB)); -- cgit v1.2.3 From c3f14b915c38a4978745f12f1f816572cce4b5a0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 3 Jun 2013 12:50:48 -0500 Subject: NORSPEC-229 Fix for bad binormals on mirrored surfaces (use tangent calculator instead of binormal calculator, convert binormal centric code to tangent centric) --- indra/newview/llviewershadermgr.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 5f08e8ca2e..636214290d 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -68,7 +68,7 @@ LLGLSLShader gTransformPositionProgram; LLGLSLShader gTransformTexCoordProgram; LLGLSLShader gTransformNormalProgram; LLGLSLShader gTransformColorProgram; -LLGLSLShader gTransformBinormalProgram; +LLGLSLShader gTransformTangentProgram; //utility shaders LLGLSLShader gOcclusionProgram; @@ -789,7 +789,7 @@ void LLViewerShaderMgr::unloadShaders() gTransformTexCoordProgram.unload(); gTransformNormalProgram.unload(); gTransformColorProgram.unload(); - gTransformBinormalProgram.unload(); + gTransformTangentProgram.unload(); mVertexShaderLevel[SHADER_LIGHTING] = 0; mVertexShaderLevel[SHADER_OBJECT] = 0; @@ -3043,7 +3043,7 @@ BOOL LLViewerShaderMgr::loadTransformShaders() gTransformTexCoordProgram.unload(); gTransformNormalProgram.unload(); gTransformColorProgram.unload(); - gTransformBinormalProgram.unload(); + gTransformTangentProgram.unload(); return TRUE; } @@ -3106,16 +3106,16 @@ BOOL LLViewerShaderMgr::loadTransformShaders() if (success) { - gTransformBinormalProgram.mName = "Binormal Transform Shader"; - gTransformBinormalProgram.mShaderFiles.clear(); - gTransformBinormalProgram.mShaderFiles.push_back(make_pair("transform/binormalV.glsl", GL_VERTEX_SHADER_ARB)); - gTransformBinormalProgram.mShaderLevel = mVertexShaderLevel[SHADER_TRANSFORM]; + gTransformTangentProgram.mName = "Binormal Transform Shader"; + gTransformTangentProgram.mShaderFiles.clear(); + gTransformTangentProgram.mShaderFiles.push_back(make_pair("transform/binormalV.glsl", GL_VERTEX_SHADER_ARB)); + gTransformTangentProgram.mShaderLevel = mVertexShaderLevel[SHADER_TRANSFORM]; const char* varyings[] = { - "binormal_out", + "tangent_out", }; - success = gTransformBinormalProgram.createShader(NULL, NULL, 1, varyings); + success = gTransformTangentProgram.createShader(NULL, NULL, 1, varyings); } -- cgit v1.2.3 From bc57b8050c2cb7decd9ac1b3e9f640c5f25bd53c Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 3 Jun 2013 15:45:59 -0500 Subject: MATBUG-136 Fix for glow being too bright on rigged attachments. --- indra/newview/llviewershadermgr.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 636214290d..9284fb1587 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -2508,7 +2508,6 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectEmissiveProgram.mFeatures.hasTransport = true; gSkinnedObjectEmissiveProgram.mFeatures.isFullbright = true; gSkinnedObjectEmissiveProgram.mFeatures.hasObjectSkinning = true; - gSkinnedObjectEmissiveProgram.mFeatures.hasAlphaMask = true; gSkinnedObjectEmissiveProgram.mFeatures.disableTextureIndex = true; gSkinnedObjectEmissiveProgram.mShaderFiles.clear(); gSkinnedObjectEmissiveProgram.mShaderFiles.push_back(make_pair("objects/emissiveSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); @@ -2525,7 +2524,6 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectEmissiveWaterProgram.mFeatures.hasTransport = true; gSkinnedObjectEmissiveWaterProgram.mFeatures.isFullbright = true; gSkinnedObjectEmissiveWaterProgram.mFeatures.hasObjectSkinning = true; - gSkinnedObjectEmissiveWaterProgram.mFeatures.hasAlphaMask = true; gSkinnedObjectEmissiveWaterProgram.mFeatures.disableTextureIndex = true; gSkinnedObjectEmissiveWaterProgram.mFeatures.hasWaterFog = true; gSkinnedObjectEmissiveWaterProgram.mShaderFiles.clear(); -- cgit v1.2.3 From da294b79c052ff503b66a3383693beb8a3dc2173 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 5 Jun 2013 11:10:32 -0500 Subject: NORSPEC-236 Fix for rigged attachments with materials not rendering under water when advanced lighting is enabled. --- indra/newview/llviewershadermgr.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 9284fb1587..9e2a0d74db 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -2581,7 +2581,6 @@ BOOL LLViewerShaderMgr::loadShadersObject() gSkinnedObjectSimpleWaterProgram.mFeatures.hasWaterFog = true; gSkinnedObjectSimpleWaterProgram.mShaderGroup = LLGLSLShader::SG_WATER; gSkinnedObjectSimpleWaterProgram.mFeatures.hasObjectSkinning = true; - gSkinnedObjectSimpleWaterProgram.mFeatures.hasAlphaMask = true; gSkinnedObjectSimpleWaterProgram.mFeatures.disableTextureIndex = true; gSkinnedObjectSimpleWaterProgram.mShaderFiles.clear(); gSkinnedObjectSimpleWaterProgram.mShaderFiles.push_back(make_pair("objects/simpleSkinnedV.glsl", GL_VERTEX_SHADER_ARB)); -- cgit v1.2.3 From c120feb18d2b98abf6071846d2806da16b710632 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Sun, 9 Jun 2013 06:12:11 -0700 Subject: NORSPEC-246 WIP fix handling of encoded normals with single FP only cards --- indra/newview/llviewershadermgr.cpp | 51 +++++++++++++++++++++++++++++++------ 1 file changed, 43 insertions(+), 8 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 9e2a0d74db..ff9b28bc37 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -44,6 +44,18 @@ #if LL_DARWIN #include "OpenGL/OpenGL.h" + +// include spec exp clamp to fix older mac rendering artifacts +// +#define SINGLE_FP_PERMUTATION(shader) \ + if (gGLManager.mIsMobileGF) \ + { \ + shader[i].addPermutation("SINGLE_FP_ONLY","1"); \ + } + + +#else +#define SINGLE_FP_PERMUTATION(shader) #endif #ifdef LL_RELEASE_FOR_DOWNLOAD @@ -1292,14 +1304,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() bool has_skin = i & 0x10; gDeferredMaterialProgram[i].addPermutation("HAS_SKIN",has_skin ? "1" : "0"); - #if LL_DARWIN - // include spec exp clamp to fix older mac rendering artifacts - // - if (gGLManager.mIsMobileGF) - { - gDeferredMaterialProgram[i].addPermutation("UGLY_MAC_HACK","1"); - } - #endif + SINGLE_FP_PERMUTATION(gDeferredMaterialProgram); if (has_skin) { @@ -1358,6 +1363,9 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + + SINGLE_FP_PERMUTATION(gDeferredLightProgram); + success = gDeferredLightProgram.createShader(NULL, NULL); } @@ -1368,6 +1376,9 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredMultiLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredMultiLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + + SINGLE_FP_PERMUTATION(gDeferredMultiLightProgram); + success = gDeferredMultiLightProgram.createShader(NULL, NULL); } @@ -1378,6 +1389,9 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/spotLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSpotLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + + SINGLE_FP_PERMUTATION(gDeferredSpotLightProgram); + success = gDeferredSpotLightProgram.createShader(NULL, NULL); } @@ -1388,6 +1402,9 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiPointLightV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiSpotLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredMultiSpotLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + + SINGLE_FP_PERMUTATION(gDeferredMultiSpotLightProgram); + success = gDeferredMultiSpotLightProgram.createShader(NULL, NULL); } @@ -1414,6 +1431,9 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSunProgram.mShaderFiles.push_back(make_pair(vertex, GL_VERTEX_SHADER_ARB)); gDeferredSunProgram.mShaderFiles.push_back(make_pair(fragment, GL_FRAGMENT_SHADER_ARB)); gDeferredSunProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + + SINGLE_FP_PERMUTATION(gDeferredSunProgram); + success = gDeferredSunProgram.createShader(NULL, NULL); } @@ -1424,6 +1444,9 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair("deferred/blurLightV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredBlurLightProgram.mShaderFiles.push_back(make_pair("deferred/blurLightF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredBlurLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + + SINGLE_FP_PERMUTATION(gDeferredBlurLightProgram); + success = gDeferredBlurLightProgram.createShader(NULL, NULL); } @@ -1454,6 +1477,9 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAlphaProgram.addPermutation("USE_VERTEX_COLOR", "1"); gDeferredAlphaProgram.addPermutation("HAS_SHADOW", mVertexShaderLevel[SHADER_DEFERRED] > 1 ? "1" : "0"); gDeferredAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + + SINGLE_FP_PERMUTATION(gDeferredAlphaProgram); + success = gDeferredAlphaProgram.createShader(NULL, NULL); // Hack @@ -1570,6 +1596,15 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSoftenProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; +#if LL_DARWIN + // include spec exp clamp to fix older mac rendering artifacts + // + if (gGLManager.mIsMobileGF) + { + gDeferredSoftenProgram[i].addPermutation("NO_SRGB","1"); + } +#endif + if (gSavedSettings.getBOOL("RenderDeferredSSAO")) { //if using SSAO, take screen space light map into account as if shadows are enabled gDeferredSoftenProgram.mShaderLevel = llmax(gDeferredSoftenProgram.mShaderLevel, 2); -- cgit v1.2.3 From e38514f9fdb79efa77a1cf41cb4288e4cfbce932 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Sun, 9 Jun 2013 09:38:45 -0700 Subject: NORSPEC-246 WIP Fix macro bug that slipped past due to MSVC promiscuity --- indra/newview/llviewershadermgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index ff9b28bc37..a27621ecdc 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -50,7 +50,7 @@ #define SINGLE_FP_PERMUTATION(shader) \ if (gGLManager.mIsMobileGF) \ { \ - shader[i].addPermutation("SINGLE_FP_ONLY","1"); \ + shader.addPermutation("SINGLE_FP_ONLY","1"); \ } @@ -1304,7 +1304,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() bool has_skin = i & 0x10; gDeferredMaterialProgram[i].addPermutation("HAS_SKIN",has_skin ? "1" : "0"); - SINGLE_FP_PERMUTATION(gDeferredMaterialProgram); + SINGLE_FP_PERMUTATION(gDeferredMaterialProgram[i]); if (has_skin) { -- cgit v1.2.3 From 75c4b50f88ead9f9a40e4154a9cf75621b6a1002 Mon Sep 17 00:00:00 2001 From: Graham Madarasz Date: Sun, 9 Jun 2013 12:40:43 -0700 Subject: NORSPEC-246 WIP fix callsite missed when swapping in macro impl --- indra/newview/llviewershadermgr.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index a27621ecdc..b9e0847935 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1596,14 +1596,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSoftenProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; -#if LL_DARWIN - // include spec exp clamp to fix older mac rendering artifacts - // - if (gGLManager.mIsMobileGF) - { - gDeferredSoftenProgram[i].addPermutation("NO_SRGB","1"); - } -#endif + SINGLE_FP_PERMUTATION(gDeferredSoftenProgram); if (gSavedSettings.getBOOL("RenderDeferredSSAO")) { //if using SSAO, take screen space light map into account as if shadows are enabled -- cgit v1.2.3 From ccd04cd66c0a550694fefe41042ef47466780a92 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 18 Jun 2013 17:24:21 -0500 Subject: Occlusion culling overhaul. --- indra/newview/llviewershadermgr.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'indra/newview/llviewershadermgr.cpp') diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index b9e0847935..e24237522a 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -93,6 +93,8 @@ LLGLSLShader gTwoTextureAddProgram; LLGLSLShader gOneTextureNoColorProgram; LLGLSLShader gDebugProgram; LLGLSLShader gClipProgram; +LLGLSLShader gDownsampleDepthProgram; +LLGLSLShader gDownsampleDepthRectProgram; LLGLSLShader gAlphaMaskProgram; //object shaders @@ -702,6 +704,8 @@ void LLViewerShaderMgr::unloadShaders() gOcclusionCubeProgram.unload(); gDebugProgram.unload(); gClipProgram.unload(); + gDownsampleDepthProgram.unload(); + gDownsampleDepthRectProgram.unload(); gAlphaMaskProgram.unload(); gUIProgram.unload(); gPathfindingProgram.unload(); @@ -3001,6 +3005,26 @@ BOOL LLViewerShaderMgr::loadShadersInterface() success = gClipProgram.createShader(NULL, NULL); } + if (success) + { + gDownsampleDepthProgram.mName = "DownsampleDepth Shader"; + gDownsampleDepthProgram.mShaderFiles.clear(); + gDownsampleDepthProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthV.glsl", GL_VERTEX_SHADER_ARB)); + gDownsampleDepthProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDownsampleDepthProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gDownsampleDepthProgram.createShader(NULL, NULL); + } + + if (success) + { + gDownsampleDepthRectProgram.mName = "DownsampleDepthRect Shader"; + gDownsampleDepthRectProgram.mShaderFiles.clear(); + gDownsampleDepthRectProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthV.glsl", GL_VERTEX_SHADER_ARB)); + gDownsampleDepthRectProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthRectF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDownsampleDepthRectProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gDownsampleDepthRectProgram.createShader(NULL, NULL); + } + if (success) { gAlphaMaskProgram.mName = "Alpha Mask Shader"; -- cgit v1.2.3