diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 2 | ||||
-rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 32 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl | 17 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl | 30 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl | 11 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl | 14 | ||||
-rw-r--r-- | indra/newview/lldrawpoolalpha.cpp | 27 | ||||
-rw-r--r-- | indra/newview/lldrawpoolavatar.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llspatialpartition.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 47 | ||||
-rw-r--r-- | indra/newview/llviewershadermgr.h | 3 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 17 |
13 files changed, 58 insertions, 150 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 6108c6f821..dc6e158034 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -2223,7 +2223,7 @@ void LLVertexBuffer::setBuffer(U32 data_mask) if ((data_mask & required_mask) != required_mask) { - llerrs << "Shader consumption mismatches data provision." << llendl; + llwarns << "Shader consumption mismatches data provision." << llendl; } } } diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index eb5c9cc5c0..84b2bde206 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8072,7 +8072,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>RenderDebugNormalScale</key> <map> diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 00717cd6a9..e8cbf318a1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -83,11 +83,11 @@ uniform float shadow_offset; vec3 calcDirectionalLight(vec3 n, vec3 l) { - float a = pow(max(dot(n,l),0.0), 0.7); + float a = pow(max(dot(n,l),0.0), 0.7); return vec3(a,a,a); } -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) +vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector vec3 lv = lp.xyz-v; @@ -114,7 +114,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa da *= max(pow(dot(n, lv), 0.7), 0.0); } - return da; + return vec3(da,da,da); } void main() @@ -125,7 +125,7 @@ void main() vec4 pos = vec4(vary_position, 1.0); #if INDEX_MODE == INDEXED - vec4 diff = diffuseLookup(vary_texcoord0.xy); + vec4 diff= diffuseLookup(vary_texcoord0.xy); #else vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); #endif @@ -136,15 +136,14 @@ void main() float vertex_color_alpha = vertex_color.a; #endif - vec3 normal = vary_norm; - normal = texture2D(bumpMap, vary_texcoord1.xy).xyz * 2 - 1; + vec3 normal = texture2D(bumpMap, vary_texcoord1.xy).xyz * 2 - 1; normal = vec3(dot(normal.xyz, vary_rotation[0]), dot(normal.xyz, vary_rotation[1]), dot(normal.xyz, vary_rotation[2])); - + vec3 l = light_position[0].xyz; vec3 dlight = calcDirectionalLight(normal, l); - dlight = dlight * vary_directional.rgb * vary_pointlight_col; + dlight = dlight * vary_directional.rgb * vary_pointlight_col; vec4 col = vec4(vary_ambient + dlight, vertex_color_alpha); vec4 color = diff * col; @@ -152,12 +151,11 @@ void main() color.rgb = atmosLighting(color.rgb); color.rgb = scaleSoftClip(color.rgb); - vec3 light_col = vec3(0,0,0); + col = vec4(0,0,0,0); + + #define LIGHT_LOOP(i) \ + col.rgb += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, normal, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); -#ifdef MAC_GEFORCE_HACK - #define LIGHT_LOOP(i) \ - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, normal, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - LIGHT_LOOP(1) LIGHT_LOOP(2) LIGHT_LOOP(3) @@ -165,14 +163,8 @@ void main() LIGHT_LOOP(5) LIGHT_LOOP(6) LIGHT_LOOP(7) -#else - for (int i = 2; i < 8; i++) - { - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, normal, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - } -#endif - color.rgb += diff.rgb * vary_pointlight_col * light_col; + color.rgb += diff.rgb * vary_pointlight_col * col.rgb; frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl index e872dadcc1..cccc7275ab 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaNonIndexedF.glsl @@ -56,13 +56,13 @@ uniform vec3 light_direction[8]; uniform vec3 light_attenuation[8]; uniform vec3 light_diffuse[8]; -float calcDirectionalLight(vec3 n, vec3 l) +vec3 calcDirectionalLight(vec3 n, vec3 l) { float a = pow(max(dot(n,l),0.0), 0.7); - return a; + return vec3(a,a,a); } -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) +vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector vec3 lv = lp.xyz-v; @@ -89,7 +89,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa da *= max(pow(dot(n, lv), 0.7), 0.0); } - return da; + return vec3(da,da,da); } vec4 getPosition(vec2 pos_screen) @@ -126,7 +126,7 @@ void main() color.rgb = scaleSoftClip(color.rgb); vec3 light_col = vec3(0,0,0); -#if MAC_GEFORCE_HACK + #define LIGHT_LOOP(i) \ light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); @@ -137,12 +137,7 @@ void main() LIGHT_LOOP(5) LIGHT_LOOP(6) LIGHT_LOOP(7) -#else - for (int i = 2; i < 8; i++) - { - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - } -#endif + color.rgb += diff.rgb * vary_pointlight_col * light_col; frag_color = color; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 486e806434..69bcca88b5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -46,6 +46,7 @@ uniform sampler2D diffuseMap; #endif uniform vec2 screen_res; +uniform vec2 shadow_res; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); @@ -67,7 +68,6 @@ VARYING vec4 vertex_color; uniform mat4 shadow_matrix[6]; uniform vec4 shadow_clip; -uniform vec2 shadow_res; uniform float shadow_bias; uniform mat4 inv_proj; @@ -89,7 +89,7 @@ vec3 calcDirectionalLight(vec3 n, vec3 l) return vec3(a,a,a); } -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) +vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector vec3 lv = lp.xyz-v; @@ -116,7 +116,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa da *= max(pow(dot(n, lv), 0.7), 0.0); } - return da; + return vec3(da,da,da); } float pcfShadow(sampler2DShadow shadowMap, vec4 stc) @@ -209,11 +209,11 @@ void main() shadow = 1.0; } -#if INDEX_MODE == INDEXED - - vec4 diff = diffuseLookup(vary_texcoord0.xy); + vec4 diff; +#if INDEX_MODE == INDEXED + diff = diffuseLookup(vary_texcoord0.xy); #else - vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); + diff = texture2D(diffuseMap,vary_texcoord0.xy); #endif #if INDEX_MODE == NON_INDEXED_NO_COLOR @@ -222,8 +222,7 @@ void main() float vertex_color_alpha = vertex_color.a; #endif - vec3 normal = vary_norm; - normal = texture2D(bumpMap, vary_texcoord1.xy).xyz * 2 - 1; + vec3 normal = texture2D(bumpMap, vary_texcoord1.xy).xyz * 2 - 1; normal = vec3(dot(normal.xyz, vary_rotation[0]), dot(normal.xyz, vary_rotation[1]), dot(normal.xyz, vary_rotation[2])); @@ -238,11 +237,10 @@ void main() color.rgb = atmosLighting(color.rgb); color.rgb = scaleSoftClip(color.rgb); - vec3 light_col = vec3(0,0,0); + col = vec4(0,0,0,0); -#ifdef MAC_GEFORCE_HACK #define LIGHT_LOOP(i) \ - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, normal, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); + col.rgb += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, normal, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); LIGHT_LOOP(1) LIGHT_LOOP(2) @@ -251,14 +249,8 @@ void main() LIGHT_LOOP(5) LIGHT_LOOP(6) LIGHT_LOOP(7) -#else - for (int i = 2; i < 8; i++) - { - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, normal, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - } -#endif - color.rgb += diff.rgb * vary_pointlight_col * light_col; + color.rgb += diff.rgb * vary_pointlight_col * col.rgb; frag_color = color; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl index 39a5a9894d..9670d59399 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl @@ -70,7 +70,7 @@ vec3 calcDirectionalLight(vec3 n, vec3 l) return vec3(a,a,a); } -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) +vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector vec3 lv = lp.xyz-v; @@ -97,7 +97,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa da *= max(pow(dot(n, lv), 0.7), 0.0); } - return da; + return vec3(da,da,da); } vec4 getPosition(vec2 pos_screen) @@ -217,7 +217,6 @@ void main() color.rgb = scaleSoftClip(color.rgb); vec3 light_col = vec3(0,0,0); -#if MAC_GEFORCE_HACK #define LIGHT_LOOP(i) \ light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); @@ -228,12 +227,6 @@ void main() LIGHT_LOOP(5) LIGHT_LOOP(6) LIGHT_LOOP(7) -#else - for (int i = 2; i < 8; i++) - { - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - } -#endif color.rgb += diff.rgb * vary_pointlight_col * light_col; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl index 566aefea6a..fae279fba0 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl @@ -72,7 +72,7 @@ vec3 calcDirectionalLight(vec3 n, vec3 l) return vec3(a, a, a); } -float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) +vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector vec3 lv = lp.xyz-v; @@ -99,7 +99,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa da *= max(pow(dot(n, lv), 0.7), 0.0); } - return da; + return vec3(da,da,da); } vec4 getPosition(vec2 pos_screen) @@ -224,8 +224,7 @@ void main() color.rgb = scaleSoftClip(color.rgb); vec3 light_col = vec3(0,0,0); -#if MAC_GEFORCE_HACK - #define LIGHT_LOOP(i) + #define LIGHT_LOOP(i) \ light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); LIGHT_LOOP(1) @@ -235,12 +234,7 @@ void main() LIGHT_LOOP(5) LIGHT_LOOP(6) LIGHT_LOOP(7) -#else - for (int i = 2; i < 8; i++) - { - light_col += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, vary_norm, light_position[i], light_direction[i], light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z); - } -#endif + color.rgb += diff.rgb * vary_pointlight_col * light_col; frag_color = color; diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 31b84bb258..70168c53c0 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -487,14 +487,13 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) current_shader = NULL; } - if (params.mMaterial.notNull() && current_shader == simple_shader) + if (params.mMaterial.notNull() && current_shader && (current_shader == simple_shader)) { // I apologize in advance for not giving this its own shader. // We have a material. Supply the appropriate data here. if (LLPipeline::sRenderDeferred) { - current_shader->uniform4f(LLShaderMgr::SPECULAR_COLOR, params.mSpecColor.mV[0], params.mSpecColor.mV[1], params.mSpecColor.mV[2], params.mSpecColor.mV[3]); - + current_shader->uniform4f(LLShaderMgr::SPECULAR_COLOR, params.mSpecColor.mV[0], params.mSpecColor.mV[1], params.mSpecColor.mV[2], params.mSpecColor.mV[3]); current_shader->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, params.mEnvIntensity); if (params.mNormalMap) @@ -515,21 +514,15 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) current_shader->bindTexture(LLShaderMgr::SPECULAR_MAP, LLViewerFetchedTexture::sWhiteImagep); } } - } else if (current_shader == simple_shader) + + } else if (LLPipeline::sRenderDeferred && current_shader && (current_shader == simple_shader)) { - // No material. Propegate with default parameters. - if (LLPipeline::sRenderDeferred) - { - current_shader->uniform4f(LLShaderMgr::SPECULAR_COLOR, 0.0f, 0.0f, 0.0f, 0.0f); - - current_shader->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, 0.0f); - - LLViewerFetchedTexture::sFlatNormalImagep->addTextureStats(params.mVSize); - current_shader->bindTexture(LLShaderMgr::BUMP_MAP, LLViewerFetchedTexture::sFlatNormalImagep); - - LLViewerFetchedTexture::sWhiteImagep->addTextureStats(params.mVSize); - current_shader->bindTexture(LLShaderMgr::SPECULAR_MAP, LLViewerFetchedTexture::sWhiteImagep); - } + current_shader->uniform4f(LLShaderMgr::SPECULAR_COLOR, 1.0f, 1.0f, 1.0f, 1.0f); + current_shader->uniform1f(LLShaderMgr::ENVIRONMENT_INTENSITY, 0.0f); + LLViewerFetchedTexture::sFlatNormalImagep->addTextureStats(params.mVSize); + current_shader->bindTexture(LLShaderMgr::BUMP_MAP, LLViewerFetchedTexture::sFlatNormalImagep); + LLViewerFetchedTexture::sWhiteImagep->addTextureStats(params.mVSize); + current_shader->bindTexture(LLShaderMgr::SPECULAR_MAP, LLViewerFetchedTexture::sWhiteImagep); } if (params.mGroup) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 0ceb7c6c45..aa5687f338 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -274,11 +274,7 @@ void LLDrawPoolAvatar::beginPostDeferredAlpha() void LLDrawPoolAvatar::beginDeferredRiggedAlpha() { -#if LL_DARWIN - sVertexProgram = gGLManager.mIsMobileGF ? &gDeferredSkinnedAlphaProgramMac : &gDeferredSkinnedAlphaProgram; -#else sVertexProgram = &gDeferredSkinnedAlphaProgram; -#endif gPipeline.bindDeferredShader(*sVertexProgram); sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP); gPipeline.enableLightsDynamic(); diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index 426eaa1ce4..7c0be549df 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -750,7 +750,7 @@ class LLVolumeGeometryManager: public LLGeometryManager virtual void rebuildGeom(LLSpatialGroup* group); virtual void rebuildMesh(LLSpatialGroup* group); virtual void getGeometry(LLSpatialGroup* group); - void genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort = FALSE, BOOL batch_textures = FALSE); + void genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort = FALSE, BOOL batch_textures = FALSE, BOOL no_materials = FALSE); void registerFace(LLSpatialGroup* group, LLFace* facep, U32 type); }; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 0fd37a4090..c7e422139d 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1224,8 +1224,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 +1231,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"; @@ -1432,10 +1400,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"); - gDeferredAlphaProgram.addPermutation("HAS_SKIN", "0"); - gDeferredAlphaProgram.addPermutation("IS_AVATAR_SKIN", "0"); - gDeferredAlphaProgram.addPermutation("MAC_GEFORCE_HACK","0"); + success = gDeferredAlphaProgram.createShader(NULL, NULL); // Hack @@ -1608,14 +1573,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarAlphaProgram.mFeatures.isAlphaLighting = true; gDeferredAvatarAlphaProgram.mFeatures.disableTextureIndex = true; 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.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.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - 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); gDeferredAvatarAlphaProgram.mFeatures.calculatesLighting = true; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 38310ed7cf..e9283d8bad 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -331,9 +331,6 @@ extern LLGLSLShader gDeferredNonIndexedDiffuseProgram; extern LLGLSLShader gDeferredSkinnedDiffuseProgram; extern LLGLSLShader gDeferredSkinnedBumpProgram; extern LLGLSLShader gDeferredSkinnedAlphaProgram; -#if LL_DARWIN -extern LLGLSLShader gDeferredSkinnedAlphaProgramMac; -#endif extern LLGLSLShader gDeferredBumpProgram; extern LLGLSLShader gDeferredTerrainProgram; extern LLGLSLShader gDeferredTreeProgram; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 56aa69b25c..27565a8d17 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4104,15 +4104,6 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, } } - //DEBUG - LLVertexBuffer* buff = facep->getVertexBuffer(); - - if (type == LLRenderPass::PASS_ALPHA && !buff->hasDataType(LLVertexBuffer::TYPE_BINORMAL)) - { - llerrs << "WTF?" << llendl; - } - - if (idx >= 0 && draw_vec[idx]->mVertexBuffer == facep->getVertexBuffer() && draw_vec[idx]->mEnd == facep->getGeomIndex()-1 && @@ -4784,7 +4775,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) fullbright_mask = fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX; } - genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, simple_faces, FALSE, batch_textures); + genDrawInfo(group, simple_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, simple_faces, FALSE, batch_textures, TRUE); genDrawInfo(group, fullbright_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, fullbright_faces, FALSE, batch_textures); genDrawInfo(group, alpha_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, alpha_faces, TRUE, batch_textures); genDrawInfo(group, bump_mask | LLVertexBuffer::MAP_TEXTURE_INDEX, bump_faces, FALSE, FALSE); @@ -4963,7 +4954,7 @@ static LLFastTimer::DeclareTimer FTM_GEN_DRAW_INFO_RESIZE_VB("Resize VB"); -void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort, BOOL batch_textures) +void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort, BOOL batch_textures, BOOL no_materials) { LLFastTimer t(FTM_REBUILD_VOLUME_GEN_DRAW_INFO); @@ -5268,6 +5259,10 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT); } } + else if (no_materials) + { + registerFace(group, facep, LLRenderPass::PASS_SIMPLE); + } else { U32 pass[] = |