diff options
5 files changed, 15 insertions, 12 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index e8cbf318a1..f63e2f7198 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -72,7 +72,6 @@ uniform vec3 light_direction[8]; uniform vec3 light_attenuation[8]; uniform vec3 light_diffuse[8]; -uniform sampler2D bumpMap; uniform samplerCube environmentMap; uniform mat3 env_mat; @@ -125,7 +124,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,7 +135,7 @@ void main() float vertex_color_alpha = vertex_color.a; #endif - vec3 normal = texture2D(bumpMap, vary_texcoord1.xy).xyz * 2 - 1; + vec3 normal = vec3(0,0,1); normal = vec3(dot(normal.xyz, vary_rotation[0]), dot(normal.xyz, vary_rotation[1]), dot(normal.xyz, vary_rotation[2])); diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index 79a06bed2c..9674d9e88e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -566,11 +566,13 @@ void main() col *= diffuse.rgb; + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + if (spec.a > 0.0) // specular reflection { // the old infinite-sky shiny reflection // - vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnormpersp, sun_dir.xyz); vec3 dumbshiny = vary_SunlitColor*shadow*(texture2D(lightFunc, vec2(sa, spec.a)).r); @@ -578,7 +580,10 @@ void main() vec3 spec_contrib = dumbshiny * spec.rgb; bloom = dot(spec_contrib, spec_contrib) / 6; col += spec_contrib; + } + if (envIntensity > 0.0) + { //add environmentmap vec3 env_vec = env_mat * refnormpersp; col = mix(col.rgb, textureCube(environmentMap, env_vec).rgb, diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 5faa94fb03..293613e74c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -217,7 +217,7 @@ void main() float vertex_color_alpha = vertex_color.a; #endif - vec3 normal = texture2D(bumpMap, vary_texcoord1.xy).xyz * 2 - 1; + vec3 normal = vec3(0,0,1); vec3 l = light_position[0].xyz; vec3 dlight = calcDirectionalLight(normal, l); @@ -244,7 +244,6 @@ void main() color.rgb += diff.rgb * vary_pointlight_col * col.rgb; - frag_color = vec4(1,0,1,1); - //frag_color = color; + frag_color = color; } diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index 3f041a3a85..1912ae0c16 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -152,8 +152,7 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) gPipeline.mDeferredDepth.copyContents(gPipeline.mDeferredScreen, 0, 0, gPipeline.mDeferredScreen.getWidth(), gPipeline.mDeferredScreen.getHeight(), 0, 0, gPipeline.mDeferredDepth.getWidth(), gPipeline.mDeferredDepth.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); gPipeline.mDeferredDepth.bindTarget(); - simple_shader = NULL; - fullbright_shader = NULL; + simple_shader = fullbright_shader = &gObjectFullbrightAlphaMaskProgram; gObjectFullbrightAlphaMaskProgram.bind(); gObjectFullbrightAlphaMaskProgram.setMinimumAlpha(0.33f); } @@ -504,7 +503,6 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) if(use_shaders && (current_shader != target_shader)) {// If we need shaders, and we're not ALREADY using the proper shader, then bind it // (this way we won't rebind shaders unnecessarily). - llassert(target_shader != NULL); current_shader = target_shader; current_shader->bind(); } @@ -514,7 +512,7 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask) current_shader = NULL; } - if (mat && !params.mFullbright) + if (use_shaders && mat && !params.mFullbright) { // I apologize in advance for not giving this its own shader. // We have a material. Supply the appropriate data here. 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 |