diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llviewershadermgr.cpp | 106 |
1 files changed, 5 insertions, 101 deletions
diff --git a/linden/indra/newview/llviewershadermgr.cpp b/linden/indra/newview/llviewershadermgr.cpp index 8648271..69f7bd8 100644 --- a/linden/indra/newview/llviewershadermgr.cpp +++ b/linden/indra/newview/llviewershadermgr.cpp | |||
@@ -113,8 +113,6 @@ LLGLSLShader gDeferredAvatarProgram; | |||
113 | LLGLSLShader gDeferredAvatarAlphaProgram; | 113 | LLGLSLShader gDeferredAvatarAlphaProgram; |
114 | LLGLSLShader gDeferredLightProgram; | 114 | LLGLSLShader gDeferredLightProgram; |
115 | LLGLSLShader gDeferredMultiLightProgram; | 115 | LLGLSLShader gDeferredMultiLightProgram; |
116 | LLGLSLShader gDeferredSpotLightProgram; | ||
117 | LLGLSLShader gDeferredMultiSpotLightProgram; | ||
118 | LLGLSLShader gDeferredSunProgram; | 116 | LLGLSLShader gDeferredSunProgram; |
119 | LLGLSLShader gDeferredBlurLightProgram; | 117 | LLGLSLShader gDeferredBlurLightProgram; |
120 | LLGLSLShader gDeferredSoftenProgram; | 118 | LLGLSLShader gDeferredSoftenProgram; |
@@ -122,12 +120,6 @@ LLGLSLShader gDeferredShadowProgram; | |||
122 | LLGLSLShader gDeferredAvatarShadowProgram; | 120 | LLGLSLShader gDeferredAvatarShadowProgram; |
123 | LLGLSLShader gDeferredAlphaProgram; | 121 | LLGLSLShader gDeferredAlphaProgram; |
124 | LLGLSLShader gDeferredFullbrightProgram; | 122 | LLGLSLShader gDeferredFullbrightProgram; |
125 | LLGLSLShader gDeferredGIProgram; | ||
126 | LLGLSLShader gDeferredPostGIProgram; | ||
127 | LLGLSLShader gDeferredPostProgram; | ||
128 | |||
129 | LLGLSLShader gLuminanceGatherProgram; | ||
130 | |||
131 | 123 | ||
132 | //current avatar shader parameter pointer | 124 | //current avatar shader parameter pointer |
133 | GLint gAvatarMatrixParam; | 125 | GLint gAvatarMatrixParam; |
@@ -159,9 +151,6 @@ LLViewerShaderMgr::LLViewerShaderMgr() : | |||
159 | mShaderList.push_back(&gDeferredMultiLightProgram); | 151 | mShaderList.push_back(&gDeferredMultiLightProgram); |
160 | mShaderList.push_back(&gDeferredAlphaProgram); | 152 | mShaderList.push_back(&gDeferredAlphaProgram); |
161 | mShaderList.push_back(&gDeferredFullbrightProgram); | 153 | mShaderList.push_back(&gDeferredFullbrightProgram); |
162 | mShaderList.push_back(&gDeferredPostGIProgram); | ||
163 | mShaderList.push_back(&gDeferredPostProgram); | ||
164 | mShaderList.push_back(&gDeferredGIProgram); | ||
165 | mShaderList.push_back(&gDeferredWaterProgram); | 154 | mShaderList.push_back(&gDeferredWaterProgram); |
166 | mShaderList.push_back(&gDeferredAvatarAlphaProgram); | 155 | mShaderList.push_back(&gDeferredAvatarAlphaProgram); |
167 | } | 156 | } |
@@ -231,32 +220,13 @@ void LLViewerShaderMgr::initAttribsAndUniforms(void) | |||
231 | mReservedUniforms.push_back("shadowMap1"); | 220 | mReservedUniforms.push_back("shadowMap1"); |
232 | mReservedUniforms.push_back("shadowMap2"); | 221 | mReservedUniforms.push_back("shadowMap2"); |
233 | mReservedUniforms.push_back("shadowMap3"); | 222 | mReservedUniforms.push_back("shadowMap3"); |
234 | mReservedUniforms.push_back("shadowMap4"); | ||
235 | mReservedUniforms.push_back("shadowMap5"); | ||
236 | |||
237 | mReservedUniforms.push_back("normalMap"); | 223 | mReservedUniforms.push_back("normalMap"); |
238 | mReservedUniforms.push_back("positionMap"); | 224 | mReservedUniforms.push_back("positionMap"); |
239 | mReservedUniforms.push_back("diffuseRect"); | 225 | mReservedUniforms.push_back("diffuseRect"); |
240 | mReservedUniforms.push_back("specularRect"); | 226 | mReservedUniforms.push_back("specularRect"); |
241 | mReservedUniforms.push_back("noiseMap"); | 227 | mReservedUniforms.push_back("noiseMap"); |
242 | mReservedUniforms.push_back("lightFunc"); | ||
243 | mReservedUniforms.push_back("lightMap"); | 228 | mReservedUniforms.push_back("lightMap"); |
244 | mReservedUniforms.push_back("luminanceMap"); | 229 | |
245 | mReservedUniforms.push_back("giLightMap"); | ||
246 | mReservedUniforms.push_back("sunLightMap"); | ||
247 | mReservedUniforms.push_back("localLightMap"); | ||
248 | mReservedUniforms.push_back("projectionMap"); | ||
249 | mReservedUniforms.push_back("diffuseGIMap"); | ||
250 | mReservedUniforms.push_back("specularGIMap"); | ||
251 | mReservedUniforms.push_back("normalGIMap"); | ||
252 | mReservedUniforms.push_back("minpGIMap"); | ||
253 | mReservedUniforms.push_back("maxpGIMap"); | ||
254 | mReservedUniforms.push_back("depthGIMap"); | ||
255 | mReservedUniforms.push_back("lastDiffuseGIMap"); | ||
256 | mReservedUniforms.push_back("lastNormalGIMap"); | ||
257 | mReservedUniforms.push_back("lastMinpGIMap"); | ||
258 | mReservedUniforms.push_back("lastMaxpGIMap"); | ||
259 | |||
260 | mWLUniforms.push_back("camPosLocal"); | 230 | mWLUniforms.push_back("camPosLocal"); |
261 | 231 | ||
262 | mTerrainUniforms.reserve(5); | 232 | mTerrainUniforms.reserve(5); |
@@ -784,9 +754,9 @@ BOOL LLViewerShaderMgr::loadShadersEffects() | |||
784 | } | 754 | } |
785 | } | 755 | } |
786 | 756 | ||
787 | 757 | #if 0 | |
788 | // KL enabling loading of postprocess shaders until we fix | 758 | // disabling loading of postprocess shaders until we fix |
789 | // ATI may still have issues | 759 | // ATI sampler2DRect compatibility. |
790 | 760 | ||
791 | //load Color Filter Shader | 761 | //load Color Filter Shader |
792 | if (success) | 762 | if (success) |
@@ -827,7 +797,7 @@ BOOL LLViewerShaderMgr::loadShadersEffects() | |||
827 | gPostNightVisionProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT]; | 797 | gPostNightVisionProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT]; |
828 | success = gPostNightVisionProgram.createShader(NULL, &shaderUniforms); | 798 | success = gPostNightVisionProgram.createShader(NULL, &shaderUniforms); |
829 | } | 799 | } |
830 | 800 | #endif | |
831 | 801 | ||
832 | return success; | 802 | return success; |
833 | 803 | ||
@@ -844,8 +814,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() | |||
844 | gDeferredTerrainProgram.unload(); | 814 | gDeferredTerrainProgram.unload(); |
845 | gDeferredLightProgram.unload(); | 815 | gDeferredLightProgram.unload(); |
846 | gDeferredMultiLightProgram.unload(); | 816 | gDeferredMultiLightProgram.unload(); |
847 | gDeferredSpotLightProgram.unload(); | ||
848 | gDeferredMultiSpotLightProgram.unload(); | ||
849 | gDeferredSunProgram.unload(); | 817 | gDeferredSunProgram.unload(); |
850 | gDeferredBlurLightProgram.unload(); | 818 | gDeferredBlurLightProgram.unload(); |
851 | gDeferredSoftenProgram.unload(); | 819 | gDeferredSoftenProgram.unload(); |
@@ -855,10 +823,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() | |||
855 | gDeferredAvatarAlphaProgram.unload(); | 823 | gDeferredAvatarAlphaProgram.unload(); |
856 | gDeferredAlphaProgram.unload(); | 824 | gDeferredAlphaProgram.unload(); |
857 | gDeferredFullbrightProgram.unload(); | 825 | gDeferredFullbrightProgram.unload(); |
858 | gDeferredPostGIProgram.unload(); | ||
859 | gDeferredPostProgram.unload(); | ||
860 | gLuminanceGatherProgram.unload(); | ||
861 | gDeferredGIProgram.unload(); | ||
862 | gDeferredWaterProgram.unload(); | 826 | gDeferredWaterProgram.unload(); |
863 | return FALSE; | 827 | return FALSE; |
864 | } | 828 | } |
@@ -929,26 +893,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() | |||
929 | 893 | ||
930 | if (success) | 894 | if (success) |
931 | { | 895 | { |
932 | gDeferredSpotLightProgram.mName = "Deferred SpotLight Shader"; | ||
933 | gDeferredSpotLightProgram.mShaderFiles.clear(); | ||
934 | gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB)); | ||
935 | gDeferredSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiSpotLightF.glsl", GL_FRAGMENT_SHADER_ARB)); | ||
936 | gDeferredSpotLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; | ||
937 | success = gDeferredSpotLightProgram.createShader(NULL, NULL); | ||
938 | } | ||
939 | |||
940 | if (success) | ||
941 | { | ||
942 | gDeferredMultiSpotLightProgram.mName = "Deferred MultiSpotLight Shader"; | ||
943 | gDeferredMultiSpotLightProgram.mShaderFiles.clear(); | ||
944 | gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/pointLightV.glsl", GL_VERTEX_SHADER_ARB)); | ||
945 | gDeferredMultiSpotLightProgram.mShaderFiles.push_back(make_pair("deferred/multiSpotLightF.glsl", GL_FRAGMENT_SHADER_ARB)); | ||
946 | gDeferredMultiSpotLightProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; | ||
947 | success = gDeferredMultiSpotLightProgram.createShader(NULL, NULL); | ||
948 | } | ||
949 | |||
950 | if (success) | ||
951 | { | ||
952 | gDeferredSunProgram.mName = "Deferred Sun Shader"; | 896 | gDeferredSunProgram.mName = "Deferred Sun Shader"; |
953 | gDeferredSunProgram.mShaderFiles.clear(); | 897 | gDeferredSunProgram.mShaderFiles.clear(); |
954 | gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightV.glsl", GL_VERTEX_SHADER_ARB)); | 898 | gDeferredSunProgram.mShaderFiles.push_back(make_pair("deferred/sunLightV.glsl", GL_VERTEX_SHADER_ARB)); |
@@ -998,36 +942,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() | |||
998 | 942 | ||
999 | if (success) | 943 | if (success) |
1000 | { | 944 | { |
1001 | gDeferredPostGIProgram.mName = "Deferred Post GI Shader"; | ||
1002 | gDeferredPostGIProgram.mShaderFiles.clear(); | ||
1003 | gDeferredPostGIProgram.mShaderFiles.push_back(make_pair("deferred/postgiV.glsl", GL_VERTEX_SHADER_ARB)); | ||
1004 | gDeferredPostGIProgram.mShaderFiles.push_back(make_pair("deferred/postgiF.glsl", GL_FRAGMENT_SHADER_ARB)); | ||
1005 | gDeferredPostGIProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; | ||
1006 | success = gDeferredPostGIProgram.createShader(NULL, NULL); | ||
1007 | } | ||
1008 | |||
1009 | if (success) | ||
1010 | { | ||
1011 | gDeferredPostProgram.mName = "Deferred Post Shader"; | ||
1012 | gDeferredPostProgram.mShaderFiles.clear(); | ||
1013 | gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredV.glsl", GL_VERTEX_SHADER_ARB)); | ||
1014 | gDeferredPostProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredF.glsl", GL_FRAGMENT_SHADER_ARB)); | ||
1015 | gDeferredPostProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; | ||
1016 | success = gDeferredPostProgram.createShader(NULL, NULL); | ||
1017 | } | ||
1018 | |||
1019 | if (success) | ||
1020 | { | ||
1021 | gDeferredGIProgram.mName = "Deferred GI Shader"; | ||
1022 | gDeferredGIProgram.mShaderFiles.clear(); | ||
1023 | gDeferredGIProgram.mShaderFiles.push_back(make_pair("deferred/giV.glsl", GL_VERTEX_SHADER_ARB)); | ||
1024 | gDeferredGIProgram.mShaderFiles.push_back(make_pair("deferred/giF.glsl", GL_FRAGMENT_SHADER_ARB)); | ||
1025 | gDeferredGIProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; | ||
1026 | success = gDeferredGIProgram.createShader(NULL, NULL); | ||
1027 | } | ||
1028 | |||
1029 | if (success) | ||
1030 | { | ||
1031 | // load water shader | 945 | // load water shader |
1032 | gDeferredWaterProgram.mName = "Deferred Water Shader"; | 946 | gDeferredWaterProgram.mName = "Deferred Water Shader"; |
1033 | gDeferredWaterProgram.mFeatures.calculatesAtmospherics = true; | 947 | gDeferredWaterProgram.mFeatures.calculatesAtmospherics = true; |
@@ -1108,16 +1022,6 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() | |||
1108 | success = gDeferredAvatarAlphaProgram.createShader(&mAvatarAttribs, &mAvatarUniforms); | 1022 | success = gDeferredAvatarAlphaProgram.createShader(&mAvatarAttribs, &mAvatarUniforms); |
1109 | } | 1023 | } |
1110 | 1024 | ||
1111 | if (success) | ||
1112 | { | ||
1113 | gLuminanceGatherProgram.mName = "Luminance Gather Shader"; | ||
1114 | gLuminanceGatherProgram.mShaderFiles.clear(); | ||
1115 | gLuminanceGatherProgram.mShaderFiles.push_back(make_pair("deferred/luminanceV.glsl", GL_VERTEX_SHADER_ARB)); | ||
1116 | gLuminanceGatherProgram.mShaderFiles.push_back(make_pair("deferred/luminanceF.glsl", GL_FRAGMENT_SHADER_ARB)); | ||
1117 | gLuminanceGatherProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; | ||
1118 | success = gLuminanceGatherProgram.createShader(NULL, NULL); | ||
1119 | } | ||
1120 | |||
1121 | return success; | 1025 | return success; |
1122 | } | 1026 | } |
1123 | 1027 | ||