diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index eb367d4ad6..97f3063a9e 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -34,7 +34,6 @@ uniform sampler2DRect specularRect; uniform sampler2DRect normalMap; uniform sampler2DRect lightMap; uniform sampler2DRect depthMap; -uniform sampler2D noiseMap; uniform samplerCube environmentMap; uniform sampler2D lightFunc; uniform vec3 gi_quad; @@ -60,7 +59,7 @@ uniform vec4 distance_multiplier; uniform vec4 max_y; uniform vec4 glow; uniform float scene_light_strength; -uniform vec3 env_mat[3]; +uniform mat3 env_mat; uniform vec4 shadow_clip; uniform mat3 ssao_effect_mat; @@ -279,8 +278,7 @@ void main() vec3 pos = getPosition_d(tc, depth).xyz; vec3 norm = texture2DRect(normalMap, tc).xyz; norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - //vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; - + float da = max(dot(norm.xyz, sun_dir.xyz), 0.0); vec4 diffuse = texture2DRect(diffuseRect, tc); @@ -315,6 +313,11 @@ void main() vec3 spec_contrib = dumbshiny * spec.rgb; bloom = dot(spec_contrib, spec_contrib); col += spec_contrib; + + //add environmentmap + vec3 env_vec = env_mat * refnormpersp; + col = mix(col.rgb, textureCube(environmentMap, env_vec).rgb, + max(spec.a-diffuse.a*2.0, 0.0)); } col = atmosLighting(col); |