diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class3')
-rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index 6dd140bff3..a8a3b5d33f 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -111,9 +111,6 @@ void main() float depth = texture2DRect(depthMap, tc.xy).r; vec4 pos = getPositionWithDepth(tc, depth); vec4 norm = texture2DRect(normalMap, tc); - float envIntensity = norm.z; - norm.xyz = getNorm(tc); - vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir; float light_gamma = 1.0 / 1.3; @@ -147,6 +144,7 @@ void main() bool hasPBR = GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR); if (hasPBR) { + norm.xyz = getNorm(tc); vec3 orm = texture2DRect(emissiveRect, tc).rgb; //orm is packed into "emissiveRect" to keep the data in linear color space float perceptualRoughness = orm.g; float metallic = orm.b; @@ -164,6 +162,10 @@ void main() vec3 f0 = vec3(0.04); vec3 baseColor = diffuse.rgb; + //baseColor.rgb = vec3(0,0,0); + //colorEmissive = srgb_to_linear(norm.xyz*0.5+0.5); + + vec3 diffuseColor = baseColor.rgb*(vec3(1.0)-f0); diffuseColor *= 1.0 - metallic; @@ -187,6 +189,9 @@ void main() } else { + float envIntensity = norm.z; + norm.xyz = getNorm(tc); + float da = clamp(dot(norm.xyz, light_dir.xyz), 0.0, 1.0); da = pow(da, light_gamma); @@ -249,5 +254,6 @@ void main() frag_color.rgb = srgb_to_linear(color.rgb); } + frag_color.a = bloom; } |