diff options
Diffstat (limited to 'indra/newview/llviewershadermgr.cpp')
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index c97b1d914b..1cb2c6b9ee 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -102,6 +102,7 @@ LLGLSLShader gSkinnedObjectSimpleProgram; LLGLSLShader gObjectSimpleImpostorProgram; LLGLSLShader gSkinnedObjectSimpleImpostorProgram; LLGLSLShader gObjectPreviewProgram; +LLGLSLShader gPhysicsPreviewProgram; LLGLSLShader gObjectSimpleWaterProgram; LLGLSLShader gSkinnedObjectSimpleWaterProgram; LLGLSLShader gObjectSimpleAlphaMaskProgram; @@ -758,6 +759,7 @@ void LLViewerShaderMgr::unloadShaders() gObjectSimpleImpostorProgram.unload(); gSkinnedObjectSimpleImpostorProgram.unload(); gObjectPreviewProgram.unload(); + gPhysicsPreviewProgram.unload(); gImpostorProgram.unload(); gObjectSimpleAlphaMaskProgram.unload(); gSkinnedObjectSimpleAlphaMaskProgram.unload(); @@ -1874,6 +1876,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() shader->clearPermutations(); shader->addPermutation("USE_VERTEX_COLOR", "1"); + shader->addPermutation("HAS_ALPHA_MASK", "1"); shader->addPermutation("USE_INDEXED_TEX", "1"); if (use_sun_shadow) { @@ -1950,6 +1953,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() shader->clearPermutations(); shader->addPermutation("USE_INDEXED_TEX", "1"); shader->addPermutation("FOR_IMPOSTOR", "1"); + shader->addPermutation("HAS_ALPHA_MASK", "1"); shader->addPermutation("USE_VERTEX_COLOR", "1"); if (rigged) { @@ -2021,6 +2025,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() shader[i]->addPermutation("USE_INDEXED_TEX", "1"); shader[i]->addPermutation("WATER_FOG", "1"); shader[i]->addPermutation("USE_VERTEX_COLOR", "1"); + shader[i]->addPermutation("HAS_ALPHA_MASK", "1"); if (use_sun_shadow) { shader[i]->addPermutation("HAS_SHADOW", "1"); @@ -3023,6 +3028,24 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { + gPhysicsPreviewProgram.mName = "Preview Physics Shader"; + gPhysicsPreviewProgram.mFeatures.calculatesLighting = false; + gPhysicsPreviewProgram.mFeatures.calculatesAtmospherics = false; + gPhysicsPreviewProgram.mFeatures.hasGamma = false; + gPhysicsPreviewProgram.mFeatures.hasAtmospherics = false; + gPhysicsPreviewProgram.mFeatures.hasLighting = false; + gPhysicsPreviewProgram.mFeatures.mIndexedTextureChannels = 0; + gPhysicsPreviewProgram.mFeatures.disableTextureIndex = true; + gPhysicsPreviewProgram.mShaderFiles.clear(); + gPhysicsPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewPhysicsV.glsl", GL_VERTEX_SHADER_ARB)); + gPhysicsPreviewProgram.mShaderFiles.push_back(make_pair("objects/previewPhysicsF.glsl", GL_FRAGMENT_SHADER_ARB)); + gPhysicsPreviewProgram.mShaderLevel = mShaderLevel[SHADER_OBJECT]; + success = gPhysicsPreviewProgram.createShader(NULL, NULL); + gPhysicsPreviewProgram.mFeatures.hasLighting = false; + } + + if (success) + { gObjectSimpleProgram.mName = "Simple Shader"; gObjectSimpleProgram.mFeatures.calculatesLighting = true; gObjectSimpleProgram.mFeatures.calculatesAtmospherics = true; |