diff options
author | Dave Parks <davep@lindenlab.com> | 2011-02-10 18:39:22 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2011-02-10 18:39:22 -0600 |
commit | 536e90a2fa037cd669bbdba7be9afb67e394c812 (patch) | |
tree | 0b7f471e4bb035a6b645a82c6e8f7a7bdd97738a /indra/newview | |
parent | 7a43bd5d9de75215a2015c0d232113747c3ad604 (diff) | |
parent | 2111bb8eff0469647028a5a8102ee5201321ac10 (diff) |
merge
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 10 | ||||
-rw-r--r-- | indra/newview/llviewershadermgr.cpp | 7 |
2 files changed, 10 insertions, 7 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 0fb26bd9a1..29340c7e9f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -270,14 +270,10 @@ void main() vec4 diffuse = texture2DRect(diffuseRect, tc); vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); - vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; - float scol = max(scol_ambocc.r, diffuse.a); - float ambocc = scol_ambocc.g; - - calcAtmospherics(pos.xyz, ambocc); + calcAtmospherics(pos.xyz, 1.0); vec3 col = atmosAmbient(vec3(0)); - col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a)); + col += atmosAffectDirectionalLight(max(min(da, 1.0), diffuse.a)); col *= diffuse.rgb; @@ -287,7 +283,7 @@ void main() // vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, vary_light.xyz); - vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; + vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).a; /* // screen-space cheap fakey reflection map diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 7c84357de8..a9462c9d50 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1149,7 +1149,14 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSoftenProgram.mShaderFiles.clear(); gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDeferredSoftenProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; + + 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); + } + success = gDeferredSoftenProgram.createShader(NULL, NULL); } |