From c4032528aff8ef1938e897ec583bbf25a3e713e1 Mon Sep 17 00:00:00 2001 From: Graham Linden Date: Thu, 2 May 2019 13:49:35 -0700 Subject: Roll back sRGB decode changes from contrib for now. Fix direct light matching across alpha/blended-material/deferred. Get diffuse lighting to match from Low to Ultra. --- .../shaders/class3/deferred/multiSpotLightF.glsl | 16 ++-------------- .../app_settings/shaders/class3/deferred/spotLightF.glsl | 11 ----------- .../shaders/class3/deferred/underWaterF.glsl | 3 --- .../app_settings/shaders/class3/deferred/waterF.glsl | 1 - .../app_settings/shaders/class3/lighting/lightV.glsl | 6 +++--- 5 files changed, 5 insertions(+), 32 deletions(-) (limited to 'indra/newview/app_settings/shaders/class3') diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl index abb6a3a5d8..52de7ceaad 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl @@ -71,19 +71,11 @@ uniform vec2 screen_res; uniform mat4 inv_proj; -vec3 srgb_to_linear(vec3 cs); -vec3 linear_to_srgb(vec3 cl); vec3 getNorm(vec2 pos_screen); -vec4 correctWithGamma(vec4 col) -{ - return vec4(srgb_to_linear(col.rgb), col.a); -} - vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret.rgb = srgb_to_linear(ret.rgb); vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); @@ -103,7 +95,6 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); @@ -121,7 +112,6 @@ vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); vec2 dist = tc-vec2(0.5); @@ -260,10 +250,6 @@ void main() //col += spec.rgb; } } - - - - if (envIntensity > 0.0) { @@ -297,6 +283,8 @@ void main() //not sure why, but this line prevents MATBUG-194 col = max(col, vec3(0.0)); + col = scaleDownLight(col); + frag_color.rgb = col; frag_color.a = 0.0; } diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl index afc542b8bc..bccd819a43 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl @@ -72,18 +72,10 @@ uniform vec2 screen_res; uniform mat4 inv_proj; vec3 getNorm(vec2 pos_screen); -vec3 srgb_to_linear(vec3 cs); -vec3 linear_to_srgb(vec3 cl); - -vec4 correctWithGamma(vec4 col) -{ - return vec4(srgb_to_linear(col.rgb), col.a); -} vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret.rgb = srgb_to_linear(ret.rgb); vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); @@ -103,7 +95,6 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); @@ -121,7 +112,6 @@ vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) { vec4 ret = texture2DLod(projectionMap, tc, lod); - ret = correctWithGamma(ret); vec2 dist = tc-vec2(0.5); @@ -256,7 +246,6 @@ void main() { float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da); col += dlit*scol*spec.rgb*shadow; - //col += spec.rgb; } } diff --git a/indra/newview/app_settings/shaders/class3/deferred/underWaterF.glsl b/indra/newview/app_settings/shaders/class3/deferred/underWaterF.glsl index 9d18d1afd8..540226e672 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/underWaterF.glsl @@ -58,9 +58,6 @@ VARYING vec4 refCoord; VARYING vec4 littleWave; VARYING vec4 view; -vec3 srgb_to_linear(vec3 cs); -vec3 linear_to_srgb(vec3 cl); - vec2 encode_normal(vec3 n); vec4 applyWaterFog(vec4 color, vec3 viewVec) diff --git a/indra/newview/app_settings/shaders/class3/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class3/deferred/waterF.glsl index 2a144ba23a..c65cf48c67 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/waterF.glsl @@ -61,7 +61,6 @@ VARYING vec4 view; VARYING vec4 vary_position; vec3 scaleSoftClip(vec3 c); -vec3 srgb_to_linear(vec3 cs); vec2 encode_normal(vec3 n); vec3 BlendNormal(vec3 bump1, vec3 bump2) diff --git a/indra/newview/app_settings/shaders/class3/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class3/lighting/lightV.glsl index f5428077fa..69267621a3 100644 --- a/indra/newview/app_settings/shaders/class3/lighting/lightV.glsl +++ b/indra/newview/app_settings/shaders/class3/lighting/lightV.glsl @@ -31,8 +31,8 @@ vec4 sumLights(vec3 pos, vec3 norm, vec4 color); vec4 calcLighting(vec3 pos, vec3 norm, vec4 color) { - vec4 c = sumLights(pos, norm, color) * 2.0; - c.rgb += atmosAmbient() * color.rgb * 0.5; - return c; + vec4 c = sumLights(pos, norm, color * 2.0); + c.rgb += atmosAmbient() * color.rgb; + return c * 2.0; } -- cgit v1.2.3