diff options
author | Graham Linden <graham@lindenlab.com> | 2013-07-03 11:51:45 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2013-07-03 11:51:45 -0700 |
commit | e6f980cfacdbccf08167035ce8b18746248738f7 (patch) | |
tree | 2945bf41747d67cf96626d75fe0ae697f4c039f6 /indra/newview/app_settings/shaders/class1 | |
parent | 6963c69c85144a8d20e4c67f65ec9334c8fde22d (diff) | |
parent | 8dedaadacd0fe8ac520c15d321465a2b00bd9c7e (diff) |
Merge vwr-dev-mat
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 4 | ||||
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl | 15 |
2 files changed, 15 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index e80e4b0fcf..640e273415 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -61,6 +61,7 @@ VARYING vec3 vary_directional; VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; VARYING vec3 vary_pointlight_col; +VARYING vec3 vary_pointlight_col_linear; VARYING vec2 vary_texcoord0; VARYING vec3 vary_norm; @@ -228,6 +229,7 @@ void main() { shadow = 1.0; } + #endif #ifdef USE_INDEXED_TEX @@ -276,7 +278,7 @@ void main() LIGHT_LOOP(6) LIGHT_LOOP(7) - color.rgb += diff.rgb * srgb_to_linear(vary_pointlight_col) * col.rgb; + color.rgb += diff.rgb * vary_pointlight_col_linear * col.rgb; color.rgb = linear_to_srgb(color.rgb); diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index 9d3ba564cd..6b5b54b863 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -68,6 +68,7 @@ VARYING vec3 vary_directional; VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; VARYING vec3 vary_pointlight_col; +VARYING vec3 vary_pointlight_col_linear; #ifdef USE_VERTEX_COLOR VARYING vec4 vertex_color; @@ -86,6 +87,16 @@ uniform vec3 light_diffuse[8]; uniform vec3 sun_dir; +vec3 srgb_to_linear(vec3 cs) +{ + +/* { cs / 12.92, cs <= 0.04045 + cl = { + { ((cs + 0.055)/1.055)^2.4, cs > 0.04045*/ + + return pow((cs+vec3(0.055))/vec3(1.055), vec3(2.4)); +} + vec3 calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector @@ -178,10 +189,8 @@ void main() vec3 diff = diffuse_color.rgb; - - vary_pointlight_col = diff; - + vary_pointlight_col_linear = srgb_to_linear(diff); col.rgb = vec3(0,0,0); |